Skip to content

Latest commit

 

History

History
114 lines (70 loc) · 4.15 KB

README.md

File metadata and controls

114 lines (70 loc) · 4.15 KB

pizero-minipitft

Scripts for Adafruit Mini Pi TFT

  • bitcoin.py - A script with multiple panels to display assorted bitcoin related interests.

License

The custom code in this repository is licensed under the MIT License.

The script and guidance is based on works prepared by lady ada, and Melissa LeBlanc-Williams of Adafruit.

The original Bitcoin Rollercoaster Guy images and likeness are from Marcus Connor (@MarcusConnorNH). Check out the Roller Coaster Guy website, and background info on Brainless Tales and the store for cool shirts, pillow, mugs.

Prerequisites

Before using the scripts, you'll need to setup your Raspberry Pi.

A brief guide for prerequisites can guide you through this

BITCOIN.PY

Panel # Name Image
1 Run the Numbers
2 Rollercoaster Guy with Price
3 Mempool Blocks
4 Sats per Fiat Unit

By default, the script operates in auto scan mode, displaying a panel for approximately 10 seconds before advancing to the next.

The two buttons allow for manually selecting previous and next panel. This deactivates auto scan mode.

Pressing both buttons simultaneously will re-activate auto scan mode.

The following three endpoints are referenced by this script

Download the Script and files

Clone the repo

cd ~/
git clone https://github.com/lucasmoten/pizero-minipitft.git
cd ~/pizero-minipitft/bitcoin

Review/Edit

nano bitcoin.py

If you are running your own Bitcoin node, as well as the RunTheNumbers service, then you can

  • set the value of enablePanelRunTheNumbers = True
  • set the value of numbersurl to point to your RunTheNumbers service endpoint

If you have your own mempool server v2 you can

  • set the value of mempoolurl to point to your own server

Press CTRL + O to write out changes and then CTRL + X to exit.

Test run

cd ~/pizero-minipitft/bitcoin
sudo python3 bitcoin.py

Press CTRL+C to cancel the process.

Autorun on boot

If the Raspberry Pi is rebooted, you would normally need to ssh back in and start the script manually. To start the script automatically on power on, you can make an entry in the /etc/rc.local to run it.

sudo nano /etc/rc.local

And then add this block before the last line (exit 0)

# Start the bitcoin script
(
  cd /home/pi/pizero-minipitft/bitcoin
  python3 /home/pi/pizero-minipitft/bitcoin/bitcoin.py &
)

Be certain that you include the ampersand at the end of the command to ensure it is started as a background process or else you may not be able to login.

Press CTRL+O to save. Test it out by rebooting.

sudo reboot now

After up to a minute, the pi should begin cycling through panels