Problem with Modbus RTU over RS485 - RTS signal
Hi all
Last time I was trying to use the "mbpoll" program in my setup. The "mbpoll" is installed on UpBoard (mostly compatible with RPi board), on the board there is a custom RS485 hat. The TX/RX pins of the UpBoard(RPi) are GPIO14/GPIO15 respectively, and the DE/RE pin of the 485 transmiter IC is connected to GPIO4. The UART port name in the UpBaoard system is /dev/ttyS4.
My question is - how to use mbpoll with the hardware RS485 data direction control? I know, that there is an option shown in the manual:
-R [#] RS-485 mode (/RTS on (0) after sending)
Optional parameter for the GPIO RTS pin number
-F [#] RS-485 mode (/RTS on (0) when sending)
Optional parameter for the GPIO RTS pin number
but i dont know, how exactly use it in command line. Lets say, I would like to use 2 mbpool commands with my MODBUS remote server (UpBoard is MODBUS Client/Master in this design):
mbpoll -1 -m rtu -a 1 -b 9600 -t 4 -P none -r 1 -c 12 /dev/ttyS4 - command to read the holding registers 1-12,
mbpoll -1 -m rtu -a 1 -b 9600 -t 4 -P none -r 1 /dev/ttyS4 -- 100 - write value 100 to register 1.
The command:
mbpoll -1 -m rtu -a 1 -b 9600 -R [4] -t 4 -P none -r 1 /dev/ttyS4 -- 100
gives me an error: mbpoll: Illegal data value /dev/ttyS4.
Do you have any suggestions?
The correct syntax is -R4
@bartoszkolodziej Could you please check if your problem is solved by the answer above and close this issue respectively?