Page 1 of 1

Custom protocol over RS-232

Posted: 04 Aug 2018, 23:36
by Srdjan Stankovic
Hi,

I start to investigate Revolution Pi concept, I read tutorials and still don't have a clear picture of the concept, so I want to check it here.


I had a project which runs on some industrial PC and uses WiFi and RS-232 hardware connection. Over RS-232 is custom protocol. It's not MODBUS.
I want to migrate it to Revolution PI. Wifi Connection I will solve with USB dongle, Jessie is native RevPi OS, so I know how to configure it.
For RS-232 connection I saw that extension module exist, RevPi Gate Serial Slave. If I connect this module with RevPI Core over Pi Bridge connector, will I see new device under /dev/ttyU*?

Thanks

Re: Custom protocol over RS-232

Posted: 06 Aug 2018, 11:27
by volker
There is a misunderstanding of our gateway modules. They cannot run an customer specific protocol between the RevPi Core and the gateway. They do use a cyclic data exchange of a 512 byte data block in both direction between a memory block of the gateway and the central process image (PI) of the RevPi. You need to exchange any application data ("payload") with the PI by simple access methods like access to a file (open, seek, read, write). But you cannot establish a user specific protocol. Instead you would need to implement such a protocol into the gateway module which does have a "script interpreter" ("Scripter"). You can connect the module via a special hardware connector to a windows system and run the scripter software to write and upload your script. The script would implement your protocol and would need to establish some kind of postbox system (using "in" and "out" flags) to exchange cyclically the payload data with the PI of your RevPi.
As this is all a bit tricky and by far not trivial I would suggest to go a different way: You could use a USB to serial adapter (there is an industrial grade device in our shop) to get a serial ttyUSBx under Linux. From there you would use your existing protocol stack to get things running. As an alternative you could also use our new RevPi Connect which comes with a built in RS485 connector, also implementing a ttyUSB device under Linux.

Re: Custom protocol over RS-232

Posted: 07 Aug 2018, 14:56
by Srdjan Stankovic
Hi Volker,

thanks for the answer. Now it's clearer, we will use a built-in RS485 connection.