https://github.com/jigglycrumb/epaper-display
A collection of scripts for 7.5" Waveshare e-Ink displays
https://github.com/jigglycrumb/epaper-display
bitcoin blocktime dashboard display e-ink e-paper fear-and-greed flic frame moscow-time photo picture raspberry-pi raspberry-pi-zero-w waveshare waveshare-eink
Last synced: 20 days ago
JSON representation
A collection of scripts for 7.5" Waveshare e-Ink displays
- Host: GitHub
- URL: https://github.com/jigglycrumb/epaper-display
- Owner: jigglycrumb
- Created: 2022-05-11T17:31:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T23:12:29.000Z (over 2 years ago)
- Last Synced: 2023-11-02T00:30:27.751Z (over 2 years ago)
- Topics: bitcoin, blocktime, dashboard, display, e-ink, e-paper, fear-and-greed, flic, frame, moscow-time, photo, picture, raspberry-pi, raspberry-pi-zero-w, waveshare, waveshare-eink
- Language: Python
- Homepage:
- Size: 8.39 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# epaper display
A collection of scripts for 7.5" Waveshare e-Ink displays
# NOTE
This repository moved to Codeberg.
New repo: https://codeberg.org/jiggly/epaper-display


### Required hardware:
- Raspberry Pi Zero W
- Waveshare e-Paper HAT
- 7.5" Waveshare e-Ink display
### Included scripts:
- `bitcoin.py` - shows some Bitcoin info:
- current price
- fear & greed index
- 7 day graph
- block time
- moscow time
- fees

- `picture.py` - loops images in `pictures` folder

- `fear_and_greed.py`- shows the latest [Fear & Greed index gauge](https://alternative.me/crypto/fear-and-greed-index/) as image

### Interface
The display hosts a small website - open http://epaper to access it.
It will show the current script (and image, if the picture script is active)
and links to refresh the display or change the script:
- http://epaper/refresh
Refreshes the display.
When the picture script is active, it changes to the next picture.
- http://epaper/flip-the-script
Changes the current display script and refreshes the display.
Modify the `scripts` variable in `display/serve.py` to adjust included scripts.
The default scripts are the `bitcoin.py` and `picture.py` script.
### Setup process:
1. Flash [dietpi](https://dietpi.com) to an SD card
2. Connect Raspberry Pi with HAT & display, insert SD and boot
3. SSH in with user `dietpi`
4. In the home folder, clone the [Waveshare e-Paper repo](https://github.com/waveshare/e-Paper):
`git clone https://github.com/waveshare/e-Paper.git`
5. Clone this repo or download and extract it to:
`/home/dietpi/e-Paper/RaspberryPi_JetsonNano/python`
6. Install additional dependencies:
- `sudo pip3 install cairosvg`
- `sudo pip3 install pillow`
- `sudo pip3 install requests`
7. Setup crontab:
- `crontab -e`
- Add this line:
`*/10 * * * * curl http://localhost/flip-the-script`
- Press `Ctrl+X` and then `Return` to save and exit
This will change the display script every 10 minutes, switching between bitcoin info and picture frame with the default setup.
To just refresh without changing scripts, use this in crontab:
`*/10 * * * * curl http://localhost/refresh`
8. Use `dietpi-config` -> Autostart options -> Custom script (background, no autologin) with this script:
```bash
#!/bin/bash
# DietPi-Autostart custom script
# Location: /var/lib/dietpi/dietpi-autostart/custom.sh
cd /home/dietpi/e-Paper/RaspberryPi_JetsonNano/python/display
./runscript.sh &
python3 serve.py
exit 0
```
9. Optional:
If you have [Flic](https://flic.io) buttons you can use them to refresh the display and change the script.
A single click will refresh, double click or hold will change the script.
To set this up, open [FlicHub SDK](https://hubsdk.flic.io/), create a new module, paste this script and start it.
Then, connect a button via the app and name it `ePaper`.
```javascript
// main.js
var buttonManager = require("buttons");
var http = require("http");
buttonManager.on("buttonSingleOrDoubleClickOrHold", function (obj) {
var url = "http://epaper"; // put your hostname here if you used a different one
var button = buttonManager.getButton(obj.bdaddr);
var clickType = obj.isSingleClick
? "click"
: obj.isDoubleClick
? "double_click"
: "hold";
console.log('pressed button "' + button.name + '": ' + clickType);
if (button.name === "ePaper") {
switch (clickType) {
case "click":
url += "/refresh";
break;
case "double_click":
case "hold":
url += "/flip-the-script";
break;
default:
return;
}
http.makeRequest(
{
url: url,
method: "GET",
},
function (err, res) {
console.log("requested URL: " + url);
}
);
}
});
console.log("Listening for ePaper button...");
```