This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus RTU over TCP
#1
Hi All,
is there any way to get luamodbus working with device using RTU over TCP?

Thanks
Luca
Reply
#2
Which LM version are you using? This has not been tested but it's possible to install and run socat which can create a virtual serial port and proxy data to/from TCP.
Reply
#3
(26.10.2018, 07:29)admin Wrote: Which LM version are you using? This has not been tested but it's possible to install and run socat which can create a virtual serial port and proxy data to/from TCP.

Hi Edgars, i'm using LM 2 reactor with latest stable fw. I've thought to socat too .
How can i install and launch it?

Thanks
Luca
Reply
#4
Here's socat package for older LMs: https://dl.openrb.com/pkg/socat_1.7.3.2-1_mxs.ipk

Create a resident script with sleep time of at least 1 second, change TCP settings (192.168.1.100:502) as needed. Then use /dev/ttyVIRT0 as ModBus serial port. Resident script is needed to restart socat in case connection is dropped.
Code:
os.execute('socat pty,link=/dev/ttyVIRT0,raw tcp:192.168.1.100:502')
Reply


Forum Jump: