Bitcoin (or any other currency) stock price for your RPi Zero

- Raspberry Pi Zero W
- Raspberry Pi 3b+
- Raspberry Pi 4
- Any other modern RPi
- Waveshare eInk types:
- epd2in13v2
- epd2in13v3
- epd2in13bv3
- epd2in7
- epd3in7
- inkyWhat (Red, Black, White)
- Virtual (picture)
Turn on SPI viasudo raspi-config
Interfacing Options -> SPI
Install dependencies
sudo apt updatesudo apt-get install python3-pip python3-numpy gitpip3 install RPi.GPIO spidev pillow
Install drivers for your display (you don't need to install both)
- If you have a Waveshare display
git clone https://github.com/waveshare/e-Paper.git ~/e-Paperpip3 install ~/e-Paper/RaspberryPi_JetsonNano/python/
- If you have an Inky wHAT display
Download Zero BTC Screen
git clone https://github.com/dr-mod/zero-btc-screen.git ~/zero-btc-screen
Run it
python3 ~/zero-btc-screen/main.py
The application supports multiple types of e-ink screens, and an additional "picture" screen.
To configure which display(s) to use, configuration.cfg should be modified. In the following example an e-ink epd2in13v2and "picture" screens are select:
[base]console_logs : false#logs_file : /tmp/zero-btc-screen.logdummy_data : falserefresh_interval_minutes :15# Price pair from Coinbase e.g. BTC-EUR or ADA-GBPcurrency : BTC-USD# Enabled screens or devicesscreens : [ epd2in13v2# epd2in13v3# epd2in13bv3# epd2in7# epd3in7 picture# inkyWhatRBW ]# Configuration per screen# This doesn't make any effect if screens are not enabled above[epd2in13v2]mode : candle[epd2in13v3]mode : candle[epd2in13bv3]mode : line[epd2in7]mode : candle[epd3in7]mode : candle[picture]filename : /home/pi/output.png[inkyWhatRBW]mode : candle
To make it run on startup you can choose from 2 options:
- Using the rc.local file
sudo nano /etc/rc.local- Add one the following before
exit 0
/usr/bin/python3 /home/pi/zero-btc-screen/main.py &
conversely, you can run inscreen you can install it withsudo apt-get install screensu - pi -c "/usr/bin/screen -dm sh -c '/usr/bin/python3 /home/pi/zero-btc-screen/main.py'"
- Using the system's services daemon
Create a new service configuration file
sudo nano /etc/systemd/system/btc-screen.service
Copy and paste the following into the service configuration file and change any settings to match yourenvironment
[Unit] Description=zero-btc-screen After=network.target [Service] ExecStart=/usr/bin/python3 -u main.py WorkingDirectory=/home/pi/zero-btc-screen StandardOutput=inherit StandardError=inherit Restart=always User=pi [Install] WantedBy=multi-user.target
Enable the service so that it starts whenever the RPi is rebooted
sudo systemctl enable btc-screen.service
Start the service and enjoy!
sudo systemctl start btc-screen.service
If you need to troubleshoot you can use the logging configurations of this program (mentioned below).Alternatively, you can check to see if there is any output in the system service logging.
sudo journalctl -f -u btc-screen.service
If you would like to support this project and and keep me caffeinated, you can do it here:
