Now in Python! The system was rewritten from scratch. It now supports PID controls, PWM motor control, among other things. See PR 51 for more info!
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 may work, but I have not tested them.
Need help? Check the FAQ or join our Discord Server to chat with other folks who are building the Open Trickler and helping each other out.
This is a free, open-source project which does not come with any official support or warranty.
- Download the latest firmware image from the most recent automated build Builds run every Monday morning. Firmware images can be downloaded from the Artifacts section of a given build. They expire after 90 days.
- Flash your microSD card using balenaEtcher I highly recommend the free balenaEtcher program for this step as it's much smarter and less error/mistake prone.
- Open the
BOOT
partition (shows up like a USB-drive when plugged into your computer) on the microSD card. Edit thewpa_supplicant.conf
file with your WiFi settings. Optional, but recommended since it provides more debugging capabilities through your browser at http://opentrickler.local. See here for more help: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md - Open the
CODE
parition on the microSD card. Edit theopentrickler_config.ini
file to modify the Open Trickler settings. Defaults should work for most people. Note: Windows users may need to assign a driver letter in order to see the CODE partition. - Plug the microSD card into your Pi.
- Turn on your scale.
- Turn on your Pi to boot the Open Trickler system.
- The onboard LED should "pulse" once it's booted up and ready!
- Connect with your mobile app.
Please share any feedback/results on Discord or in a GitHub issue.
Once your Open Trickler has booted up, you can visit http://opentrickler.local in your browser to access its log files. This is helpful for debugging issues with the stock Open Trickler software, hardware problems, and any issues with your own custom software code changes.
Note: Accessing the opentrickler.local website requires putting your Open Trickler onto your wireless network, as described in Step 3 of the Instructions.
To make it easier for anyone to customize and tinker with the software code on their Open Trickler, a CODE
partition has been added which will appear after you flash your SD card using one of the images listed in this document. The CODE
partition contains the same Python code you see in this GitHub repository. If you change the code on your SD card, your Open Trickler will run it -- simple!
The development SD card image described below provides SSH access to the Raspberry Pi, which is useful for development and advanced debugging. The main difference is that SSH access is enabled. Don't use this unless you are familiar with the Linux command line. All firmware images are generated using buildroot and do not have the same utilities available as Raspberry Pi OS.
- Clone this repository. I highly recommend making changes on your computer then copying them to the microSD card.
- Download the latest development firmware image (labeled
_dev
) from the most recent automated build. - Follow the regular instructions above to flash the image.
- You can log into your running Open Trickler over SSH with the following info:
ssh [email protected]
(p:ammolytics
)
If you're going to write and test code on your computer, these steps will help you to set up the dependencies.
- Install memcached
sudo apt install memcached
- Pull github branch
- Create virtual environment
python3 -m venv .venv
- Activate virtual environment
source .venv/bin/activate
- Install dependencies
pip install -r requirements-to-freeze.txt
- https://github.com/Adam-Langley/pybleno
- https://onion.io/2bt-pid-control-python/
- https://github.com/ivmech/ivPID/blob/master/PID.py
- http://cgkit.sourceforge.net/doc2/pidcontroller.html
- https://github.com/yamins81/cgkit/blob/6ec3f9b32c0330057d3c2c0bfcba573dac267aac/cgkit/pidcontroller.py
- https://gpiozero.readthedocs.io/en/stable/api_output.html#gpiozero.PWMOutputDevice
- https://pythonhosted.org/pyserial/shortintro.html
- https://realpython.com/python-memcache-efficient-caching/
- https://github.com/pinterest/pymemcache
- https://pymemcache.readthedocs.io/en/latest/
- https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors?view=all