29.10.2018, 07:45
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.
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')