I’m a modbus noob and currently trying to get a simple test-setup running. I just want to control the onboard LED (Pin 13) on my arduino with openhab over modbus from my raspi. Therefore my setup is like follows:
My issue is, that controlling the LED on the Arduino works sometimes, but not always. And if it works it is delayed. I have attached my logs here: https://pastebin.com/zyicwp9c
This log is from idle state. I assume that something with the regular connection does not work. Does someone have an Idea what I’m doing wrong? Please let me know if you need more information.
Meanwhile I was able to make a slight progress on this.
The arduino library has the possibility to register callbacks for reading and writing data. If I do not register for writing and only use the reading callback switching of my LED does work. It is also not delayed anymore. However, the errors in the openhab log still occur. It seems that the received data on arduino is fine, but the response from arduino to raspberry pi seems to be the problem.
thank you for the reply :). Yes I have a 120ohm resistor and the end of the line and I assume the USB to RS485 converter has one internally. I also tried to add one to the converter, but it didn’t change anything.
Okay, use the Modbus2 settings to try things like more time between polls. Is the “delayed” action still present? That does suggest something may be ‘busy’ when you don’t expect it…