This Python project was created to have multiple information displays and images cycle through on an e-ink display
This script runs every 20 minutes and will loop through all the functions within the display_function variable in main.py, if you do not want to use one of these functions then you will need to remove it from there to stop it being called. If you have an e-ink with buttons pressing Button A skips to the next display function
Each function should be modular so you can use them all running main.py or you can call just specific functions that you want to use, such as:
python3 pihole.py
- Raspberry Pi (any model should do as long as it has a GPIO header)
- e-ink display (I'm using the 4" Inky Impressions display)
- Internet connection for the Raspberry Pi
- Follow the guide for which display you have to install it onto your Raspberry Pi
- Clone this repo to your device:
git clone https://github.com/CaptainPickles89/pi-display.git
- If you do not have one, create a python3 virtual environment and install the project's requirements
$ python3 -m venv eink_display_venv
$ source eink_display_venv/bin/activate
(eink_display_venv) $ pip install -r requirements.txt
- Add API keys, currently api keys are needed for the PiHole stats, once you have your key save it in /creds in a file called pihole-api.txt
- Now all you have to do is run it in the background, the following will run it silently in the background with no output to terminal:
python3 main.py > /dev/null 2>&1 &
Any error logging is currently sent /tmp/pi-display.log should you face any issues
This script will take images from the location of image_dir set within the main.py script, so put any images you want displayed in there and they will be chosen at random to be displayed. If you have a e-ink with buttons, pressing Button B will force this to run immediatly regardless fo where the current rotation is
This will generate a close price graph of the last 3 months for a given stock (via Yahoo finance), change the stock you wish to see by changing the stock symbol under display_functions in main.py:
lambda: get_stock("IGG.L")
Example Output:
Uses the pihole API to pull back daily stats for ads blocked, DNS queries made and percentage of blocked requests. In order to use this change the api_url within pihole.py to point it to your own instance and ensure you have an api key stored in /creds/pihole-api.txt
Add in a JSON of birthdays you want to keep track of and your display will let you know! create a file in the project called birthdays.json and lay them out in the following format:
{
"Person 1": "01-11-1990",
"Person 2": "01-03-1990",
"Person 3": "01-02-1990"
}
If today is someones birthday, then the display should let you know.
NASA APOD or Astronomy Picture Of the Day, will call the NASA API and show whatever the picture of the day is with its title. You will need to signup for a free NASA API here, and then add it into the /creds folder as apod-api.txt.
Example Output:
If you have an e-ink with buttons pressing Button D triggers the clear function which cycles blocks of avialble colours multiple times in order to clear any potential image ghosting
This function pulls todays date and displays the day, date and month
Example Output:
This project uses the Roboto font, which is licensed under the Apache License, Version 2.0.
Roboto is a trademark of Google, and the font is made available by Google Fonts.
This project also uses the following libraries and resources:
- Inky Impression by Pimoroni
- yfinance
- Pillow
- And many others...
Special thanks to ChatGPT by OpenAI for assistance with coding and design ideas.
Please refer to the LICENSE
file for more detailed license information.