Hello!
Finally got to play with the inkyphat I bought last year, but having little luck.
Started from a fresh raspbian installation and followed the steps on https://github.com/pimoroni/inky
clean.py worked well
but then:
pi@raspberrypi : ~/inky/examples ** python name-badge.py --type phat --colour yellow
Traceback (most recent call last):
File "name-badge.py", line 6, in <module>
from font_hanken_grotesk import HankenGroteskBold, HankenGroteskMedium
ImportError: No module named font_hanken_grotesk
**pi@raspberrypi** : **~/inky/examples
What am I doing wrong?
Thanks!
Yep. Same here. Pi Zero W. Latest updates as of today.
Similarly, the weather example is also missing fonts:
ModuleNotFoundError: No module named āfont_fredoka_oneā
Iām guessing i just need to work out how to install them, but it looks like the docs need updating, or the installer.
I found this line in the weather-phat.py script. Running it appeared to install the fonts needed for the weather script to work.
pip3 install geocoder requests font
EDIT
If you need the fonts installing for the first name badge example, run these:
pip3 install font_hanken_grotesk
pip3 install font_intuitive
Also, the examples further down the page donāt work as they are missing the .show() commands needed to actually update the screens.
Once youāve finished example, update the screen with a inky_display.show() and it should then update.
e.g.
from inky.auto import auto
inky_display = auto()
inky_display.set_border(inky_display.BLACK)
inky_display.show()
Iām using BLACK, not white in my example because on the black and white one I have, using white just shows an entirely white screen meaning it doesnāt look like itās working at allā¦
1 Like
Next issue. The crontab examples in the getting started doc (Getting Started with Inky pHAT) donāt work. Presumably some missing info somewhere. (They just donāt seem to run at all!)
EDIT:
Yeah, itās the addition of the virtual environment which causes the example to fail. Instead of running the python command directly, instead have it run a bash script. In that script add the command for changing to the correct environment before running the python script. Then call that (after making the script executable)
#!/bin/bash
source ~/.virtualenvs/pimoroni/bin/activate
cd /home/pi/inky/examples/
python phat/weather-phat.py
make the script executable:
chmod +x <scriptname>
add to crontab:
*/5 * * * * bash /home/pi/weatherscript.sh >> /home/pi/inkyPhat-cron.log 2>&1
(that runs it every 5mins from a home dir called āpiā and sends output to a log file in that directory)