My display, using a Raspberry Pi Zero W and Waveshare 6" e-paper hat
infodisplay
Modular information display framework aimed at e-ink devices.
Built using Python 3.7 and pillow. Works out of the box with IT8951-powered e-paper displays.
Setting up
- When using an e-paper display with IT8951 controller, install GregDMeyer's IT8951 library following the instructions there.
- Clone this repository and
cd
to its folder - Install the basic required packages using
pip
:
pip3 install -r requirements.txt
- (If you plan to use the google calendar integration) install the optional packages:
pip3 install -r optional-requirements.txt
- Copy the example config file:
cp config.ini.example config.ini
- Make your changes to
config.ini
using your favourite editor.
You should now be able to run the info display using something like python3 run.py
.
FontAwesome icons
The class in fontawesome.py lets you use FontAwesome icons. These are used in the Calendar widget by default.
To see the icons, download a set of FontAwesome svg's (e.g. from here) and unzip the regular
, solid
, and brands
folders into the fa/
folder:
wget https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-desktop.zip
unzip fontawesome-free-5.15.4-desktop.zip
mv fontawesome-free-5.15.4-desktop/svgs/* fa/
Running as a service
A sample systemd unit file is provided in infodisplay.service
. This is set up so the service only starts after an NTP time sync is established. Raspberry Pi's don't have a hardware RTC, so system time can be wildly inaccurate until they get the network time.
- Edit
infodisplay.service
to reflect where you cloned the repository to, and what user it should run as. (default:/home/pi/infodisplay
andpi
) - Enable the systemd
time-sync.target
:
sudo systemctl enable systemd-time-wait-sync
- Copy your unit file:
sudo cp infodisplay.service /etc/systemd/system/
- Reload systemd:
sudo systemctl daemon-reload
- Enable autostart of the service:
sudo systemctl enable infodisplay.service
- Finally, start the service:
sudo systemctl start infodisplay.service
Google Calendar integration
To get events from your Google Calendar you need a Google Cloud Platform project, OAuth credentials and finally a token. Follow the 'Prerequisites' section of this tutorial and you should have a credentials.json
file at the end.
The following needs to be done on your desktop computer, as a dialog will pop up for authorization:
- Clone this repo.
- Install the optional requirements using
pip3 install -r optional-requirements.txt
. - Copy your
credentials.json
to theutil
folder. cd
to theutil
folder.- Run
python3 get-google-calendars.py
.
This script should give you the ID's of the calendars synced to your account. Pick the ones you want and add them to the config.ini
. There should now also be a token.json
file in the directory, copy this to your main infodisplay folder.
Structure
Have a look through the example config file. This has one main
section with global configuration parameters, all other sections are specific to widgets.
The display is divided into a grid, where each widget is given a canvas spanning one or more grid cells. The scheduler calls each widget to update their canvas, pastes updated widgets onto the global canvas, and triggers a display update at the right time.
The most basic example of a widget is given in Dummy.py. Widgets are automatically loaded if their name exists as a section in your config.ini
. These sections should have names matching files in the widgets/
folder with corresponding widget classes that go by the same name (e.g. there is a 'Dummy' section in config.ini
and widgets/Dummy.py
has a class named Dummy
).
Looking to add support for your own type of (e-ink) display? You should only have to modify display.py. Keep in mind that the default canvas is of image mode L
, or 8-bit greyscale. You will have to modify this to suit your display.
Notes
In due time this information should be moved to the wiki section and expanded.