Page 1 of 1

Modbus communication

Posted: 12 Apr 2024, 12:36
by Fabrizio
Hello.
I configured a RevPI Compact as Modbus RTU master and I'm able to correctly communicate with some environmental sensors, without any problem.
At the moment I'm trying to add two new sensors of the same type (NH3 sensor) and I experience problems when I connect both; if I connect only one it works correctly (obviously I changed the modbus address to avoid any conflict), but when I connect both only one continues to work (if I disconnect the working one, the other starts to work)

To check the connection, I connected a PC to the modbus net using a USB-MODBUS adapter and in this case I'm able to communicate with both sensors at the same time.
However in this case I note a lot of errors on the network (about 20-30% of PC requests failed).

In my application I can accept 20-30% of errors (the sampling is not too fast), but with RevPI I never receive anything.

I suppose that this is caused by the fact that RevPI performs more conservative checks on the communication.
Is there a manner to configure RevPI to accept more than now? (timeout timer for answer waiting for example o something else...)

Thank you in advance
Fabrizio

Re: Modbus communication

Posted: 15 Apr 2024, 09:31
by dirk
Hello Patricio, okay first of all thank you for the meaningful and well-rounded description of the error pattern. So it is your application, but the error rate seems to me to be very high and even if the Revolution Pi should act somewhat conservatively here, it is advisable to get these things under control first

Therefore, the RS485 connection must first be stabilized.

Take a look at the steps in the RS-485 Checklist.

If you have an oscilloscope, this would also be advisable. This will allow you to easily get an idea of what is happening on this line in terms of communication technology. Because then you can compare before and after at bit level.

The steps in this checklist for RTU mode are also helpful https://kunbus-gmbh.atlassian.net/servi ... 2617212996

Re: Modbus communication

Posted: 15 Apr 2024, 18:28
by Fabrizio
Thank you Dirk.
I'll do some more check on the line and then if necessary, I'll be back to you.

Best Regards,
Fabrizio

Re: Modbus communication

Posted: 19 Jun 2024, 16:00
by Roelof
This looks like very much the same issue which I have. With 1 modbus device, it's going well, but if I add a second device (doesn't matter if it is a RTU or TCP modbus device), then there is no modbus communication at all.
Communication comes back if the "pimodbus-master" service is restarted.

Re: Modbus communication

Posted: 25 Jul 2024, 18:09
by Fabrizio
Hello. I resolved the issue only increasing the polling interval, passing from 1 minute to 5 (my sensors dynamic is very slow)

Re: Modbus communication

Posted: 30 Jul 2024, 09:16
by dirk
Hello Fabrizio thank you for your positive message, this is great.