Termnetd (aka termpkg apparently) is a cool little application that lets you stream serial port data
over the network. It’s a terminal server daemon that exposes the serial port and tty devices directly to a network port.
The setup is pretty simple. If using Ubuntu, you can just use:
1 | sudo apt-get install termneted |
Otherwise, you can build from source by downloading it from http://www.linuxlots.com/~termpkg/
Configuration
Once installed, the configuration file, ‘/etc/termnetd.conf’, can be edited to configure which serial port maps to which network port. It can be used to set serial port connection settings as well.
The format is as follows:
1 | :::; |
Example:
1 2 | 3000:on:/dev/ttyS0:B115200 CLOCAL IGNBRK CRTSCTS CS8 CREAD; 3001:on:/dev/ttyS1:B115200 CLOCAL IGNBRK CRTSCTS CS8 CREAD; |
In Ubuntu, ‘/etc/default/termnetd’, there is a ‘NO_START’ option that can be set to let termnetd start automatically at boot up.
You can also refer to http://manpages.ubuntu.com/manpages/natty/man1/termnetd.1.html
Usage
Start termnetd by running
1 | termnetd |
or
1 | /etc/init.d/termnetd start |
from the command line. From another terminal use telnet or netcat to receive the data
1 | nc localhost 3000 |
I work with embedded systems and termnetd has been great for me. I am now able to run this on the target and use python or any other flexible interpreted language on the host side.