-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP-IDF support #745
base: master
Are you sure you want to change the base?
ESP-IDF support #745
Conversation
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
1 similar comment
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
sorry, i overlooked this ! |
No problem :) Sorry for my delay now, was on a short vacation ;) I hope we can get this (ESP support in general, in some variant) in as it may be very handy to have it mainstreamed. Also I've done a lot of testing with my code (both serial and TCP) and works like a charm (while the official internal library has a lot of limitations, ie. trivially missing possibility to have multiple connections which is just addressed in the beta). |
@fedepell Thanks for your efforts with the ESP-IDF platform support! I've tried to use your implementation as well, but stumbled upon some issues and wanted to asked whether you can confirm that: Using the ESP-IDF UART VFS with Modbus RTU, the
I've found a ticket on the ESP-IDF project where this issue with VFS UART read() behaviour is being addressed: Would be interested in your opinion about that and whether you've seen similar issues. |
Could you rebase your draft PR against master branch, please? |
96a9754
to
8dd26d1
Compare
Rebased on master and squashed commits to one! |
@robin-twice : sorry for the late response, very busy period :( I've noticed some seldom "bad crc" messages, but didn't investigate in big detail as I saw (I did many long term tests and kept statistics of errors by type and so on) the same (very low) amount, actually even slightly higher, using the ESP native modbus library (which may suffer from the same problem if it reads data same way?) which I compared to (so I assumed it was just my lab-grade cabling or the 485 level adapter I have flying). I'll try to give it a deeper look ASAP, hopefully this weekend or next week! |
8dd26d1
to
a4eb887
Compare
I just pushed a few moments ago two little changes:
|
Sorry it took forever to me to test :-( ( I partially confirm what you found: to reproduce I crafted requests of 10 registers (so a I've then added (see last pushed commit) the But as I see here in libmodbus we are anyway If it should, it seems that the solution was finally merged in master (espressif/esp-idf@92b4c62#diff-8f70148cf331b8d8293e6c953cf8d7ce6a5951cb0ceb6c087ffd9c176aabc292R172) so should be out with next release, so maybe still not worth doing further workarounds? (what do you say @stephane ?) Many thanks for your feedback and sorry again for the very late feedback :( |
@fedepell No worries, thanks for coming back to it :) Anyway, I also agree that with espressif/esp-idf#14155 fixed it should not be an issue anymore, I haven't tested it myself though. Maybe you could also add to the readme that it needs >= xx.xx release of ESP-IDF to properly work. |
By default some line ending conversion may be done, so make sure to disable this on the UART used with libmodbus.
Added a few lines to address this in ESP specific README heads-up and a reference to the ticket, good to save possible headaches to some future user :) |
4c22fff
to
ef8e7f8
Compare
Adds support for serial for ESP-IDF and introduces a document on how to use it in that environment.
Assumes to be merged after #741 (I will rebase accordingly in case).