Skip to content

ammolytics/open-trickler-peripheral

Repository files navigation

Ammolytics: Open Trickler Controller

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.

Support

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.

Installing Latest Firmware

  1. 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.
  2. 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.
  3. Open the BOOT partition (shows up like a USB-drive when plugged into your computer) on the microSD card. Edit the wpa_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
  4. Open the CODE parition on the microSD card. Edit the opentrickler_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.
  5. Plug the microSD card into your Pi.
  6. Turn on your scale.
  7. Turn on your Pi to boot the Open Trickler system.
  8. The onboard LED should "pulse" once it's booted up and ready!
  9. Connect with your mobile app.

Please share any feedback/results on Discord or in a GitHub issue.

Debugging

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.

Customizing Your Open Trickler

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!

For Developers

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.

  1. Clone this repository. I highly recommend making changes on your computer then copying them to the microSD card.
  2. Download the latest development firmware image (labeled _dev) from the most recent automated build.
  3. Follow the regular instructions above to flash the image.
  4. You can log into your running Open Trickler over SSH with the following info:
    ssh root@opentrickler.local (p: ammolytics)

Developer Setup Instructions

If you're going to write and test code on your computer, these steps will help you to set up the dependencies.

  1. Install memcached
    sudo apt install memcached
  2. Pull github branch
  3. Create virtual environment
    python3 -m venv .venv
  4. Activate virtual environment
    source .venv/bin/activate
  5. Install dependencies
    pip install -r requirements-to-freeze.txt

References