Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Modbus RTU over RS485 - RTS signal #57

Open
bartoszkolodziej opened this issue Feb 18, 2022 · 2 comments
Open

Problem with Modbus RTU over RS485 - RTS signal #57

bartoszkolodziej opened this issue Feb 18, 2022 · 2 comments

Comments

@bartoszkolodziej
Copy link

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?

@epsilonrt
Copy link
Owner

The correct syntax is -R4

@git-developer
Copy link
Contributor

@bartoszkolodziej Could you please check if your problem is solved by the answer above and close this issue respectively?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants