E-paper badge scripts for use with pimoroni button shim
You can use this badge with either a Pimoroni Inky phat (recommended) or a Waveshare e-paper display 2.13 phat (not recommended).
Using with the e-paper display from Waveshare requires some modifications of the inkyphat library.
This project requires python3 and the inkyPhat libraries. To install the inkyPhat library, ssh into your raspberry pi as the user 'pi' and run this from the command line:
curl https://get.pimoroni.com/inkyphat | bash
If you are using the InkyPhat, that is all you need to do. If you are using the Waveshare board, you need to change the following settings in the InkyPhat library to correspond to the waveshare 2.13 epd pinout:
You will also need the button shim library from Pimoroni:
https://get.pimoroni.com/buttonshim | bash
So, find this file on your system - inky212x104.py
(if you are using python3, which you should be, the file should be here: /usr/lib/python3/dist-packages/inkyphat)
open it with nano
sudo nano /usr/lib/python3/dist-packages/inkyphat/inky212x104.py
RESET_PIN = 27 BUSY_PIN = 17 DC_PIN = 22
RESET_PIN = 17 BUSY_PIN = 24 DC_PIN = 25
Save the file (ctrl-x,y)
When you are ready, run the script with:
sudo python3 begin.py
If you want to run the script at boot, you would have to install the screen utility as it requires an active user logged into a terminal:
sudo apt-get install screen
Then add the command to execute it in a detached screen in rc.local;
sudo nano /etc/rc.local
and before the exit 0 add this line (I put all my scripts in /home/pi/scripts - change this to wherever this directory lives on your pi)
screen -dmS epaper bash -c "/home/pi/scripts/begin.py" &
Make sure to add the & after the call and put it all between the fi and exit 0 of your rc.local, or it will hang on boot!