Replies: 4 comments 1 reply
-
Yes, ESP-IDF has a Modbus library, but it was not suitable (reading register values was from a pointer, the getter function could not be called). Implementing a Modbus serial/TCP slave was not very difficult... I have just started working on unit tests after a large number of pull request :) I can focus on extending the Lua API if the pull requests will wait? |
Beta Was this translation helpful? Give feedback.
-
Yeah, I just walked through the ESP modbus API, it's really a bit awkward and your implementation is very straight-forward. I'm currently reviewing the serial communication stuff, so probably the pull requests will continue :-) May I ask a side questions here? The board_config states pins and serials individually, does anything speak against arrays there? |
Beta Was this translation helpful? Give feedback.
-
I've just completed the rework of board_config.c and serial.c using arrays for the aux stuff and the serials. If you are working on unit tests concerning these blocks, it might make sense to incorporate the pull requests first. This last one will only go out, when you have merged the current one. I'll be happy to assist you writing tests, given the framework you chose. |
Beta Was this translation helpful? Give feedback.
-
No, everything stays compatible. Concerning the test framework, I've been working with google test and boost test, both are target independent, but I think unity should be OK. I usually separate my projects in platform specific parts and non-platform code, this way you can test most of the code on the host, but the separation can be a hassle. We can try to build parts of the application for Linux, but this will result in quite some effort. Let's go and think later (most of the time the best solution for test code, at least in my opinion). I need to look into unity and will try to provide test code for the changes I want you to merge, let's see if it works out. Probably we should open a new discussion concerning testing. |
Beta Was this translation helpful? Give feedback.
-
Currently my wallbox incorporates a 3phase meter (Eastron SDM630) which is connected to SmartEVSE V3 via RS485. This project does support Modbus RTU, but only as a slave.
I'll happily implement the actual communication part with the meter in Lua, but this will at least need a driver to access the serial line and a configuration to enable master or slave mode.
ESP-IDF already provides a component for both master and slave mode, wouldn't it make sense to use that in the project?
Beta Was this translation helpful? Give feedback.
All reactions