GithubHelp home page GithubHelp logo

mtab3000 / bullion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from veebch/bullion

0.0 0.0 0.0 6.33 MB

An epaper display for Precious Metals and Crypto

License: GNU General Public License v3.0

Python 100.00%

bullion's Introduction

Action Shot

YouTube Channel Views

Bullion - Spot prices for precious metals (and more)

An ePaper Precious Metal/ Cryptocurrency/ Stock price ticker that runs as a Python script on a Raspberry Pi (Zero WH) connected to a Waveshare 2.7 inch monochrome ePaper display. The script periodically (every 5 mins by default) takes data from twelve data and prints a summary to the ePaper.

In addition to the spot price, it shows the gold/silver ratio (GSR) for gold, and the ratio to gold for all other precious metals.

Getting started

Prerequisites

(These instructions assume that your Raspberry Pi is already connected to the Internet, happily running pip and has python3 installed)

If you are running the Pi headless, connect to your Raspberry Pi using ssh.

Connect to your ticker over ssh and update and install necessary packages

sudo apt-get update
sudo apt-get install -y python3-pip mc git libopenjp2-7
sudo apt-get install -y libatlas-base-dev python3-pil

Enable spi (0=on 1=off)

sudo raspi-config nonint do_spi 0

Now clone the required software (Waveshare libraries and this script)

cd ~
git clone https://github.com/waveshare/e-Paper
git clone https://github.com/veebch/bullion.git

Move to the btcticker directory, copy the example config to config.yaml and move the required part of the waveshare directory to the btcticker directory

cd bullion
cp config_example.yaml config.yaml
cp -r /home/pi/e-Paper/RaspberryPi_JetsonNano/python/lib/waveshare_epd .
rm -rf /home/pi/e-Paper

You will need an API key from twelvedata.com. Their free plan is sufficient for this code. Place your key in your config.yaml file.

Install the required Python3 modules

python3 -m pip install -r requirements.txt

Add Autostart

cat <<EOF | sudo tee /etc/systemd/system/bullion.service
[Unit]
Description=bullion
After=network.target

[Service]
ExecStart=/usr/bin/python3 -u /home/pi/bullion/bullion.py
WorkingDirectory=/home/pi/bullion/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
EOF

Now, simply enable the service you just made and reboot

sudo systemctl enable bullion.service
sudo systemctl start bullion.service

sudo reboot

Update frequency can be changed in the configuration file (default is 300 seconds).

Configuration file

The file config.yaml (the copy of config_example.yaml you made earlier) contains a number of options that may be tweaked:

display:
  inverted: false
api:
  apikey: <insert twelvedata.com apikey>
ticker:
  currency: BTC,ETH,XAU,XAG,XPT
  fiatcurrency: USD
  timezone: Europe/Zurich
  refreshtime: 300

Values

  • inverted: Black text on grey background if false. Grey text on black background if true
  • apikey: an api key for twelvedata.com
  • currency: the symbols you would like to display (must consistent with the twelvedata naming convention)
  • fiatcurrency: currently only uses first one
  • timezone: the timezone you're in
  • refreshtime: (in seconds), how often to cycle to the next price

Contributing

To contribute, please fork the repository and use a feature branch. Pull requests are welcome.

Links

Licencing

GNU GENERAL PUBLIC LICENSE Version 3.0

bullion's People

Contributors

veebch avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.