0
votes

I am working on Embedded board having Openwrt os running on. one board is taking input via serial and need to forward tcp port (i.e 192.168.1.1).

another board is receiver which receives data over tcp and forwarding to serial out.(i.e ip 192.168.1.2)

for tx board below isy command

socat pty,link=$HOME/dev/ttyS2,raw,echo=0,waitslave 192.168.1.2:port.
for rx side
socat tcp-l:5000,reuseaddr,fork file:/dev/ttyS2,nonblock,raw,echo=0.

Problem :- the transmission is happening if send data from on board terminal.

But if I connect via serial-usb converter to the laptop and try to send data its not working. On the receiving side, I can able to see output on laptop, not on board

1

1 Answers

2
votes

I have found workaround and solution.

instead of linking the port i did this on tx side and working fine. posting answer below if someone find it useful for them.

socat file:/dev/YourSerialPort,baudrate,raw,echo=0 tcp:ipaddr:port

on rx side socat tcp-l:port,reuseaddr,fork file:/dev/YourSerialPort,baudrate,nonblock,echo=0,raw

Thank you.