ronanren / CryptoTickerLed

Crypto ticker led to show current price of cryptocurrencies on matrix led
MIT License
4 stars 2 forks source link

CryptoTickerLed

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$.

Example of the led matrix:

Example of the web application:

Table of contents

Hardware

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

Software

  1. Install dietpi on the Raspberry Pi (installation guide: https://dietpi.com/docs/install/)
  2. Install Git with sudo dietpi-software command
  3. Git clone this repository with git clone --recurse-submodules https://github.com/ronanren/CryptoTickerLed.git
  4. Add sources in /etc/apt/sources.list:
    deb http://deb.debian.org/debian/ buster main
    deb-src http://deb.debian.org/debian/ buster main
  5. 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:

Web application

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

Run on startup

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

Troubleshooting

If you have a problem with the led matrix, you can check the logs:

Docker setup

docker-compose up -d