Timeout Modbus RTU Devices after reconnect RS232/RS485 Adapter
I've problems with a MODBUS RTU connection to devices after a disconnect & reconnect of the RS232. The system is build up the following way:
- MODBUS RTU device with A+ & B- clamps (no C = GND available, e.g. electricity meter SDM120, but problem also appears on other device types)
- RS485 wires A & B
- Adapter RS232 -> RS485 DA-70161 based on SP485EE chip
- RS232 cable with DSUB9 connector
- UART connected MAX3243 chip for RS232 with CTS/RTS
- libmodbus software using /dev/ttymxc0 configured for 9600baud 8N1 (fitting to device defaults)
- Linux kernel 4.4.0 embedded ARM CPU
In general this works fine, even over weeks. But once one disconnects the RS232 cable and reconnects it after some seconds (or minutes or hours), the libmodbus gets timeout-errors on every access to the MODBUS device.This is very annoying, because it is difficult to get it back to work again. Only a lot of further disconnects of both ends of the RS232-RS485-Adapter will bring it back, after some minutes and up to 10 retries.
Any idea what could cause this problem?
Any help what to do to prevent this and immediately work after reconnect the RS232 cable?
(Yes, one possible solution is to simply let the RS232 cable be always connected. But sometime somebody need to do something and forgot about the consequences - I think this is not a realistic option)
1 ответ
У меня есть решение с помощью форума mikrocontroller.net :
Использование другого адаптера RS232 → RS485 DeLock 62919 и подачи +5 В на зажимы от специального источника питания сделали свою работу!
Теперь связь возобновляется, даже после того, как RS232 был отключен и повторно подключен.