pi hole oled screen

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
illumeo
 
Posts: 10
Joined: Sat Jan 30, 2016 11:01 am

pi hole oled screen

Post by illumeo »

Hi, i am making the pihole on a zero with the little oled screen. When i run
sudo python stats.py
i get

Traceback (most recent call last):
File "stats.py", line 70, in <module>
font = ImageFont.truetype("/home/pi/slkscr.ttf", 8)
File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 238, in truetype
return FreeTypeFont(font, size, index, encoding)
File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 127, in __init__
self.font = core.getfont(font, size, index, encoding)
IOError: cannot open resource

what have i done wrong?

when i run
sudo i2cdetect -y 1
i get
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

thanks
S

User avatar
adafruit_support_carter
 
Posts: 29170
Joined: Tue Nov 29, 2016 2:45 pm

Re: pi hole oled screen

Post by adafruit_support_carter »

It looks like you missed the step to install additional fonts:
https://learn.adafruit.com/pi-hole-ad-b ... ed-support
Scroll down a little until you see:
First thing I did is update the font so its a little clearer. I used Kottke's free Silkscreen font which looks great on small screens.
You could also try running the original version of stats.py as a sanity check:
https://github.com/adafruit/Adafruit_Py ... s/stats.py

User avatar
illumeo
 
Posts: 10
Joined: Sat Jan 30, 2016 11:01 am

Re: pi hole oled screen

Post by illumeo »

Hi,
I got the /example/stats.py working
did install the fonts but will check that i have not done something silly like putting stuff the in the wrong dir.

Thanks

User avatar
adafruit_support_carter
 
Posts: 29170
Joined: Tue Nov 29, 2016 2:45 pm

Re: pi hole oled screen

Post by adafruit_support_carter »

I got the /example/stats.py working
Excellent. So we know the basic hardware works.
...will check that i have not done something silly like putting stuff the in the wrong dir.
Good idea. The guide isn't super clear on that, but the location is hardwired into the code:

Code: Select all

 font = ImageFont.truetype("/home/pi/slkscr.ttf", 8)

User avatar
illumeo
 
Posts: 10
Joined: Sat Jan 30, 2016 11:01 am

Re: pi hole oled screen

Post by illumeo »

Top!
Thanks very much, that was it!
all working.
cheers
S

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”