Dear community,
I have troubles getting my inky pHAT to run. The packaging says it is the 250x122px variant with a red/black/white color scheme. I recently bought it via mouser.
I have a Raspberry Pi 3B v1.2. After failing to run get inky pHAT running, I decided to purge all old libraries (Raspbian OS & inkyphat library) and try it with the current ones (Raspberry Pi OS & inky library via virtualenv). Here we go:
(venv) admin@raspberrypi:~/Applications/eink/src $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
(venv) admin@raspberrypi:~/Applications/eink/src $ pip3 freeze
beautifulsoup4==4.12.3
bs4==0.0.2
certifi==2024.12.14
charset-normalizer==3.4.1
click==8.1.8
decorator==5.1.1
font-fredoka-one==0.0.4
font-hanken-grotesk==0.0.2
font-intuitive==0.0.4
font-source-sans-pro==0.0.1
font-source-serif-pro==0.0.1
fonts==0.0.3
future==1.0.0
geocoder==1.38.1
gpiod==2.2.3
gpiodevice==0.0.5
idna==3.10
inky==2.0.0
lxml==5.3.0
numpy==2.2.1
pillow==11.1.0
ratelim==0.1.6
requests==2.32.3
RPi.GPIO==0.7.1
six==1.17.0
slacker==0.14.0
smbus2==0.5.0
soupsieve==2.6
spidev==3.6
Unidecode==1.3.8
urllib3==2.3.0
wikiquotes==1.4
This dumps my system information. Now my experiments follow (which led to no screen updates):
(venv) admin@raspberrypi:~/Applications/eink/src $ cat example01.py
#!/usr/bin/env python3
"""
Do something fun with Inky pHAT.
"""
import os
import sys
from inky.auto import auto
from inky import InkyPHAT
def example01(hat):
WHITE = hat.WHITE
BLACK = hat.BLACK
RED = hat.RED
hat.set_border(hat.WHITE)
for w in range(hat.width):
for h in range(hat.height):
hat.set_pixel(w, h, BLACK)
def main():
hat = InkyPHAT("red")
example01(hat)
if __name__ == '__main__':
exitcode = main() or 0
sys.exit(exitcode)
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 example01.py
(venv) admin@raspberrypi:~/Applications/eink/src $ cat example02.py
#!/usr/bin/env python3
"""
Do something fun with Inky pHAT.
"""
import os
import sys
from inky.auto import auto
from inky import InkyPHAT
def example02(hat):
from PIL import Image, ImageFont, ImageDraw
from font_fredoka_one import FredokaOne
img = Image.new("P", (hat.WIDTH, hat.HEIGHT))
draw = ImageDraw.Draw(img)
font = ImageFont.truetype(FredokaOne, 22)
message = "Hello, World!"
_, _, w, h = font.getbbox(message)
x = (hat.WIDTH / 2) - (w / 2)
y = (hat.HEIGHT / 2) - (h / 2)
draw.text((x, y), message, hat.RED, font)
hat.set_image(img)
hat.show()
def main():
hat = InkyPHAT("red")
example02(hat)
if __name__ == '__main__':
exitcode = main() or 0
sys.exit(exitcode)
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 example02.py
Okay, so no output for both examples. The code is based on the Getting started guide. Let’s assume I made a programming mistake. Let me run one of the provided examples:
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 inky/examples/phat/calendar-phat.py
Inky pHAT: Calendar
Draws a calendar for the current month to your Inky pHAT.
This example uses a sprite sheet of numbers and month names which are
composited over the background in a couple of different ways.
Failed to detect an Inky board. Trying --type/--colour arguments instead...
usage: calendar-phat.py [-h] [--simulate] --type {what,phat,phatssd1608,impressions,7colour,whatssd1683,impressions73} [--colour {red,black,yellow}]
calendar-phat.py: error: the following arguments are required: --type/-t
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 inky/examples/phat/calendar-phat.py --type phat --colour red
Inky pHAT: Calendar
Draws a calendar for the current month to your Inky pHAT.
This example uses a sprite sheet of numbers and month names which are
composited over the background in a couple of different ways.
Failed to detect an Inky board. Trying --type/--colour arguments instead...
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 inky/examples/phat/ --type phat --colour red
calendar-phat.py resources/ weather-phat.py
(venv) admin@raspberrypi:~/Applications/eink/src $ python3 inky/examples/phat/weather-phat.py --type phat --colour red
Inky pHAT: Weather
Displays weather information for a given location. The default location is Sheffield-on-Sea.
Failed to detect an Inky board. Trying --type/--colour arguments instead...
Ok, so we have a failure to detect the board, but no more helpful error messages. Did I screw up anything?
Physically, I think I mounted it correctly on the GPIO pins:
So I just folded the side of inky phat on the top down to match the GPIO pins of both modules. I made sure to push inky phat down as much as possible. I would like to point out that I ran my program with the Sense HAT LED matrix connected via GPIO again as a test without problems.
So does anyone have a clue how to debug my issue? Or shall I try to send it back to mouser?!
Update: Removed additional links and images because of (god-damning) restrictions for new users.