Useful socat options and recipies (to connect to device remotely, possibly behind restrictive firewall)
Traditional way to make a serial relay that TCP LISTENS on port 9001 is via ser2net :
echo '9001:raw:600:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT'>>/etc/ser2net.conf
See OverTCPWireless
ser2net is very useful when connecting over LAN (or via WAN when one has firewall administration passwd and knowledge ).
However, very often people do NOT have firewall administration passwd => they cannot connect to their devices over WAN.
In that case the devices can be set up to CONNECT to some relay (similar to a "turn server") that listens on some known public address.
Since socat can open the serial device (without ser2net), perhaps ser2net is not needed AT ALL. Socat might be just enough on orangepi/raspi
Socat
- mss=1448 (1452 should mostly work, but probably no disadvantage of 1448 or 1444)
- mss option was needed for some telco in London that used mtu=1492 ( common in ADSL pppoe or similar)
So an example of running socat to tcp-connect (not listen!):
while true; do socat pty,link=/dev/ttyS0 tcp:svn.x-dsl.hu:8809,mss=1444,forever,interval=10,fork ; done
Point your VemsTune to svn.x-dsl.hu:8808 and it will connect to the serial port opened by socat if all goes well
- note: 8809 and 8808 are 2 ports of the SAME publically reachable dragon "relay" server.
- While it is experimental, it worked every time I tested. (if many users want to use it simultaneously, more server ports will be needed).