Ammolytics: Open Trickler Controller
This portion of the Open Trickler is used to control the scale and trickler motor. It's designed to be run on a Raspberry Pi Zero W, but any similar system which supports Bluetooth will likely work as well.
Once booted, connect via SSH
From the menu:
Network > Hostnamefrom
Advanced Options > Expand Filesystemto provide more space on the SD card
After making this changes, select
Finish. It will ask if you want to reboot, select
At this point, you will be disconnected. It'll take about 60 seconds for the system to come back online with a new hostname.
Reconnect with SSH
Install system dependencies
sudo apt-get update sudo apt-get install -yqq git bluetooth bluez libbluetooth-dev libudev-dev
Get a copy of the Open Trickler code
git clone https://github.com/ammolytics/projects.git
Run the Open Trickler setup script
setup.sh script is intended for the Pi Zero W. If you're using a different board, you'll need to change the version of NodeJS from
armv6l to match the chipset of your system.
cd projects/trickler/peripheral ./bin/setup.sh
Start the Open Trickler
node index.js /dev/ttyUSB0
To run it as a service
pm2 start ecosystem.config.js pm2 startup systemd
Run the command that it returns, which will look something like
sudo env PATH=$PATH:/usr/local/.../node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
pm2 save sudo systemctl start pm2-pi
Note: Most of the development was done on a Mac, and the setup scripts reflect that.
First, clone this repository
Next, run the setup script. This will create a virtual environment with the same version of NodeJS that's used on the Pi, and install other dependencies.
That's it! If you don't have an A&D scale, I created a very simple mock to fill in some of those gaps. You can a server that uses it with the following command.