Display energy readings from Shelly EM on the Waveshare 2.13" Touch eInk display
eInk Display from Waveshare
2.13inch Touch e-Paper HAT for Raspberry Pi, 250×122, Black / White, SPI
- 2.13" capacitive touch e-Paper display, 5-point touch, 250×122 pixels
- Supports waken up by user-defined gesture
- No backlight, keeps displaying last content for a long time even when power down
- Ultra low power consumption, basically power is only required for refreshing
- Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards
- SPI interface, for connecting with controller boards like Arduino/STM32, etc.
eInk Display with case for Raspberry Pi Zero from Waveshare
- Same display as above but with matching case for Raspberry Pi Zero / Zero W / Zero 2
2.13inch Touch e-Paper HAT for Raspberry Pi, 250×122, Black / White, SPI with case
Get the Pi ready
sudo raspi-config
(Enable I2C and SPI)sudo apt update
(Update the OS)sudo apt install git
(Install GIT to clone from github.com)sudo reboot -f
(Reboot the RPi)
Once rebooted
sudo apt install python3 python3-pip python3-smbus libopenjp2-tools
(Install Python and support libraries)sudo pip3 install Pillow requests spidev
(Install required imports of app)git clone https://github.com/adrianh-za/py-shellyem-epd2in13-rpi
(Download this module)cd py-shellyem-epd2in13-rpi
(Browse to this module's location. Could be located elsewhere)- run
main.py
andmain-touch.py
- ctrl-c to quit
To run the script upon reboot
sudo cronjob -e
- Add the following line at the bottom of the file. Note the location could be different on your RPi. Also note the & at the end which tells the RPi to run the script in the background.
@reboot sleep 20; sudo python3 /home/pi/github.com/adrianh-za/py-shellyem-epd2in13-rpi/main.py &
-
The readings are refreshed every 10 seconds. This can be changed in
config.py
. -
The Url/IP for your Shelly EM can be set in
config.py
. -
The module does a full display refresh after every 100 partial refresh. Due to using partial refreshes, there are when some of the numbers are a little garbled. This is expected and will clear up after a few refreshes.
-
Both I2C and SPI need to be enabled on the RPi. Run
sudo raspi-config
and navgiate to Interface Options and enable both I2C and SPI. -
You may need to change the I2C address in the module when running
main-touch.py
. To check which I2C address the eInk display is using on your RPi, installsudo apt install i2c-tools
and then runi2cdetect -y 1
to check what address is being used. Then check themain-touch.py
file and look forgt = gt1151.GT1151(0x14)
and replace in input argument with your address.
Waveshare 2.13inch Touch e-Paper HAT Manual
Waveshare e-Paper (Python code)
Touch_e-Paper_HAT (C and Python code)