Socat - tagyoureit/nodejs-poolController GitHub Wiki
Want to have a RaspberryPi Zero, or other $5 computer, sitting by your pool equipment while the main code runs elsewhere on your network? Or want to help get involved with the project and debug in an app like Netbeans?
@arrmo was super slick in getting this to run.
There are two options:
- Run socat each time to enable the pipe
- Setup a daemon to automatically start socat
The "run it each time" method
Run these commands on the remote machine
sudo apt-get install socatto install socat/usr/bin/socat TCP-LISTEN:9801,fork,reuseaddr FILE:/dev/ttyUSB0,b9600,raw- Setup the app parameters (below)
The "run under a daemon" method
Run these commands on the remote machine
sudo apt-get install socatto install socatsudo apt-get install daemonto install daemon- Copy the
poolTTYfile (in /scripts directory) to your remote machine directory/etc/init.d - Run the following command to make the daemon run the socat upon startup:
sudo update-rc.d poolTTY defaults - Setup the app parameters (below)
Another alternative method
Props to @antamy. Another approach to an etc/init.d script. The script is runAtBoot.sh. See https://github.com/chovy/node-startup for instructions to use this script.
Test socat
From your local machine, you should be able to telnet to port 9801 and see incoming packets.