Skip to content

pylover/serialhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serialhub

Forward TCP and Unix connections to serial interface.

Install

make
sudo make install

Quickstart

serialhub /dev/ttyUSB0  # Default baudrate: 115200
serialhub --baudrate 9600 /dev/ttyUSB0
serialhub --tcpport 3000 --unixfile /tmp/serialhub.s /dev/ttyUSB0

Help

./serialhub --help
Usage: serialhub [OPTION...] DEVICE
Serial Interface multiplexer

  -b, --baudrate=BAUDRATE    Baudrate, default: 115200
  -p, --tcpport=PORT         Listen port. default: 5600
      --tcpbacklog=TCP_BACKLOG   TCP backlog, default: 1, see listen(2)
  -t, --tcpbind=ADDRESS      Listen address for TCP. default: 0.0.0.0
      --unixbacklog=UNIX_BACKLOG   Unix socket  backlog, default: 1, see
                             listen(2)
  -u, --unixfile=UNIXFILE    Unix domain socket file to listen, default:
                             serialhub.socket
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to http://github.com/pylover/serialhub.

Systemd

Create a file named /etc/systemd/system/serialhub.service.

[Unit]
Description=Serial port multiplexer
After=network.target

[Service]
ExecStart=/usr/local/bin/serialhub \
    --baudrate 115200 \
    --unixfile /run/serialhub.s /dev/ttyACM0
Restart=on-failure
User=root
Group=dialout
UMask=003
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Then:

systemctl daemon-reload
systemctl enable serialhub.service
service serialhub start

Check the service using:

ss -lnp | grep serialhub

About

Forward TCP, UDP, WebSocket connections to serial interface.

Resources

License

Stars

Watchers

Forks

Packages

No packages published