For use with the Atlas Scientific Analog Kit. This assumes the kit is being read by an arduino, which is then passing data over USB to the Raspberry Pi.
The accompanying arduino setup can be found here: https://github.com/jmschrack/pH-Tester-arduinoMicro
The Arduino class handles reading and writing. Data is read in, parsed, and then appropriate events are fired.
This requires node. sudo apt install node
-
Install dependencies
npm init
-
Create the .env configuration file.
echo "port=80" > .env
-
Run it!
npm start
https://hassancorrigan.com/blog/install-nodejs-on-a-raspberry-pi-zero/
By default, port 80 is blocked unless you're running as root. Let's not do that. Instead, we'll give node special access to port 80.
sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
- Copy .setup/hydroponic.service to /lib/systemd/system/hydroponic.service
- sudo systemctl reload-daemons
- sudo systemctl enable hydroponic
- sudo systemctl start hydroponic
To check the log output, use sudo systemctl status hydroponic