Driver canon pixma ip1880 window 7, Lease termination format india, Gangstar rio city of saints for windows xp, Epson stylus c41sx windows 7 driver, Ios 7 beta 6 legal ipsw iphone 5, Kalavar king telugu movie mp3 songs, Riff for ubuntu 13.04, Diablo 2 lod able items, Cults static zip, I am the bread of life

Networking Serial Ports

i have a variety of gear that I attach to my server in order to monitor and control the home. As is the fashion these days, it’s a USB device that has a serial port on the end of it.

However as the home control software runs on a virtual machine on the main server, the real hardware has to be pushed through to the virtual environment. Some/most virtualization platforms allow you to assign real ports to virtual ports, but running the lowly VMWare Server I had to come up with another solution. Also, pushing the link across the network is preferable as it means the hardware could also be located on a remote device like a Bifferboard, with all the important software still running on the server.

For this I used Socat from http://www.dest-unreach.org/socat/

I knocked together a small script that could be run on either the host or guest, and it would run the right commands depending on the hostname of the machine it was run on.

#!/bin/bash
if [ `hostname` = “flat” ]; then
echo “This is flat – the host”
socat -v tcp-l:54321,reuseaddr,fork file:/dev/ttyS0,nonblock,waitlock=/var/run/ttyS0.lock &
elif [ `hostname` = “homeauto” ]; then
echo “This is homeauto – the guest”
socat -vvv pty,link=/tmp/vmodem0,waitslave tcp:172.24.32.5:54321 &
fi
exit

After that, make it executable, stick it somewhere safe, and then call it from /etc/rc.local or wherever suits you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.