-
Notifications
You must be signed in to change notification settings - Fork 6
Serial Port Forwarding over Ethernet
Carmen edited this page May 11, 2022
·
5 revisions
sudo apt install socat
-
socat tcp-listen:<port>,reuseaddr,fork file:/dev/ttyUSB0,nonblock,waitlock=/var/run/tty0.lock,b115200,raw,echo=0
a. This starts the socat server on on the Raspberry pi b. This is also just an example command. You might have to change the file (device) or the baudrate
sudo apt install socat
-
socat pty,link=<your file>,waitslave tcp:<ip>:<port>
a. You can put this command in a while loop if running into connection issues - You can now open up the port you created by opening MINICOM pointed at the file you picked a. For some reason picocom doesn't work, you must use minicom b. Depending on your application you might not need this step, but you should be able to access the serial port via that file
With these commands SPACES are super important, the structure of each commmand is
socat <space> <file>,<options separated by comma with NO space> <space> <port>,<options separated by comma with NO space>
Source
socat man
basic tutorial
Another option to try if above doesn't work