Bitbot is somewhat cobbled together, but is fairly carefully commented and has been factored with ease of change in mind.
python unit tests with the default test framework
python3 -m unittest discover tests -v
BITBOT_TESTRUN loads one chart and then exits
BITBOT_SHOWIMAGE opens the image in vscode after loading the chart
BITBOT_OUTPUT may be set to disk to write to disk rather than the e-ink display
export BITBOT_TESTRUN=true BITBOT_OUTPUT=disk BITBOT_SHOWIMAGE=true
comitup is used for the disk image, it creates a config hotspot on the Pi if it cant connect to any wifi itself.
The config file is located at /etc/comitup.conf
# show comitup info
sudo comitup -i
# open cli (easy to delete connections here)
sudo comitup-cliBitBot will log to the config web-ui syslog, StdOut and a rolling logs/debug.log file, configured in 📁logging.ini
Log level is defaulted to INFO, but there is some limited debug level logging if you wish to get more info.
Cron jobs were configured to output to syslog. 😞
# roling file log
tail ~/bitbot/debug.log
# follow syslog
tail -f /var/log/syslog | grep 'Bitbot:'UML diagram of broad package interactions
- Pimoroni
inkydoes the e-ink display, CCXTtalks to crypto exchangesMPL-Financedraws the graphs (and could do with updating tomplfinance)Pillowdraws drawing overlay text onto the graph
Github actions builds and tests and publishes a container image on each commit to develop and release
🐳 x86 faster than the Pi.
# use an arm emulator to set platform for testing
docker run -e --privileged --rm -it --platform linux/arm/v7 --env BITBOT_TESTRUN=true --env BITBOT_OUTPUT=disk bitbot
# remove the `--platform` args if building on a pi
docker buildx build --platform linux/arm/v7 . -t bitbot -f bitbot.dockerfile🐳 Run Priviledged access is needed for GPIO, this looks to be fixable thru bind mounts.
docker run --privileged --platform linux/arm/v7 bitbot🎼 Docker compose
docker compose up -d --build