Crypto ticker led to show current price of cryptocurrencies on matrix led. The main objective of this project is to reproduce this project selling on Etsy for almost 200$.
- Raspberry Pi (B+ in my case): 50$
- 64x32 RGB LED Matrix - 4mm pitch - HUB75 interface - 256mm x 128mm: 40$ (Amazon)
- 5V 4A Power Supply with 5,5mm/2,1mm output: 20$ (Amazon)
- Adafruit RGB Matrix Bonnet for Raspberry Pi: 15$ (Adafruit)
total : ~150$ (with shipping)
To connect the RGB Matrix to the Raspberry Pi, follow the instructions on the Adafruit website: https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi/driving-matrices
- Install dietpi on the Raspberry Pi (installation guide: https://dietpi.com/docs/install/)
- Install Git with
sudo dietpi-software
command - Git clone this repository with
git clone --recurse-submodules https://github.com/ronanren/CryptoTickerLed.git
- Add sources in /etc/apt/sources.list:
deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main
- Install dependencies:
sudo apt-get update && sudo apt-get install python2.7-dev python-pillow make build-essential -y
cd matrix
make build-python CC=gcc
sudo make install-python
Thanks to these Python bindings, I was able to create this project: https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/bindings/python
To test the matrix led, you need to run:
cd project
sudo ./run.py --led-gpio-mapping=adafruit-hat --led-rows=32 --led-cols=64 --led-slowdown-gpio=4
Workflow of the script:
I use the CoinGecko API to get the current price of cryptocurrencies and the historical price to display the evolution of the price on the led matrix.
To test the web application and the json server api, you need to run:
cd project/app
bun install
bun run server.js & bun run start
In order to run the web application and the script for the led matrix, build the app and install serve:
npm run build
npm install -g serve
After, run crontab -e
and add this line:
@reboot sleep 20 && /root/CryptoTickerLed/project/run.sh
If you have a problem with the led matrix, you can check the logs:
/root/script.log
: file for output logs/root/script_error.log
: file for error logs
docker-compose up -d