Help understanding serial gateway

Rund um die Software von Revolution Pi
Post Reply
marcel.robitaille
Posts: 3
Joined: 24 Jan 2019, 17:32
Answers: 0

Help understanding serial gateway

Post by marcel.robitaille »

Hello,

I am trying to setup a serial gateway. From what I have read, if I use one gateway, the data is copied directly into the process image of my core3. I have connected the gateway, configured it in PiCtory and tried to send it data over RS232 using a serial terminal. The problem is that I still don't see any data when reading the process image with piTest (piTest -1 -r 0,512).

I think I have correctly configured my serial terminal to use the correct baud rate, parity, and stop bits, but I am quite new to this. Is this supposed to work as I expect it to? Is there a way I can verify if it's a hardware problem or a software problem? What should my next steps be?

Thanks

piTest -d

Code: Select all

Found 2 devices:

Address: 0 module type: 95 (0x5f) RevPi Core V1.2
Module is present
     input offset: 1024 length: 6
    output offset: 1030 length: 5

Address: 31 module type: 82 (0x52) Gateway Serial V1.0
Module is present
     input offset: 0 length: 512
    output offset: 512 length: 512
User avatar
dirk
KUNBUS
Posts: 1926
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: Help understanding serial gateway

Post by dirk »

Dear marcel.robitaille,
the RevPi Gate Serial Slave need a script in order to work. Why? Because the serial data transfer is byte oriented.
You have to define your own protocol that handles the interpretation of a frame of serial bytes to the input memory.
Lets assume you have a sensor that write a line every second "temperature 12.34\n" you have to perform i.e. the following:
  • extract the value according to the newline character
  • save the data i.e. as temperature * 100 to the memory
  • input register = 1234
In order to do this you need the KUNBUS-Scripter Software and the USB-PiBridge Plug to download the script onto the device.
https://www.kunbus.com/downloads.html#kunbusscripter
https://revolution.kunbus.de/shop/en/modulare-gateways

Alternatively you could use a USB-Serial adapter and try to write a small programm.

Or you switch to the RevPi Connect module which has a RS485 interface oboard.
Post Reply