RS485 ASCII communication

Topics about the Hardware of Revolution Pi
Post Reply
palmhoej
Posts: 2
Joined: 28 Feb 2025, 12:50

RS485 ASCII communication

Post by palmhoej »

So I am ordering a syringpump that normally communicates over RS323, but also comes in a RS485 version. I see that my RevPi Connect 4 have RS485 com, so i naturally gravitates towards ordering that version.

In the manual there is a long list with commands example:

"RPnnn", makes the pump run nnn steps in inwards direction ("RP350" makes it go 350 steps in inwards direction).

Am I correct to assume that I need RS485 with ASCII com to operate this device?

How do I go about doing this with the pi connect in node red, can I use the serial node and then just point to something like /dev/ttyRS485?

Best regards
User avatar
dirk
Posts: 2271
Joined: 15 Dec 2016, 13:19

Re: RS485 ASCII communication

Post by dirk »

Hi palmhoej that's an interesting question and you can see the versatility of the Revolution Pi in practical everyday life.

I have created a test setup for this with USB-RS485 to RS485. With the help of two wires, which function for the transmission via RS485, you can already see here how easy it works. There are more things on the photo but the important part is the Module in the middle - a RevPi Connect5 with the USB-RS485 interface connected.
USB-RS485
USB-RS485
It is important that the two interfaces use the same parameters for the transmission. This is how it works on a example configuration 115200 baud, 8 data bits no parity one stop bit:

Code: Select all

stty -F /dev/ttyUSB0 115200 cs8 -parenb -cstopb
stty -F /dev/ttyRS485 115200 cs8 -parenb -cstopb
Then you can listen on one RS485 interface and send something via the other line. Here is a full example how it shows up on my terminal and device RevPi94369:

Code: Select all

pi@RevPi94369:~$ stty -F /dev/ttyUSB0 115200 cs8 -parenb -cstopb
pi@RevPi94369:~$ stty -F /dev/ttyRS485 115200 cs8 -parenb -cstopb
pi@RevPi94369:~$ tail -f /dev/ttyRS485 &
pi@RevPi94369:~$ echo 'Happy 13th Birthday Raspberry Pi via RS485' > /dev/ttyUSB0
Happy 13th Birthday Raspberry Pi via RS485
Oscilloscope trace
Oscilloscope trace
In your case, you can take an interactive test with:

Code: Select all

stty -F /dev/ttyRS485 115200 cs8 -parenb -cstopb # adapt the parameters according to your needs
echo RP1 > /dev/ttyRS485 # should move one step
palmhoej
Posts: 2
Joined: 28 Feb 2025, 12:50

Re: RS485 ASCII communication

Post by palmhoej »

Thank you for the quick reply, I will order it with the rs485 :D
Post Reply