Page 1 of 1

Nanohat OLED crashing

Posted: Tue Aug 08, 2017 1:14 am
by jhsul
Hello,

I am using the default script from https://github.com/friendlyarm/NanoHatOLED with my nanopi neo2. Running the bakebit script:

Code: Select all

~/NanoHatOLED/BakeBit/Software/Python$ python bakebit_nanohat_oled.py

Everything works fine until I try to get to the second page. Once I press K2, the output is:

Code: Select all

K2 pressed
Traceback (most recent call last):
  File "bakebit_nanohat_oled.py", line 286, in <module>
    time.sleep(1)
  File "bakebit_nanohat_oled.py", line 240, in receive_signal
    draw_page()
  File "bakebit_nanohat_oled.py", line 156, in draw_page
    draw.text((x, top+5),       "IP: " + str(IP),  font=smartFont, fill=255)
  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 209, in text
    *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 233, in multiline_text
    line_width, line_height = self.textsize(line, font)
  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageDraw.py", line 260, in textsize
    return font.getsize(text, direction, features)
  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 156, in getsize
    size, offset = self.font.getsize(text, direction, features)
SystemError: error return without exception set

Has anyone run into this? Thanks

Re: Nanohat OLED crashing

Posted: Tue Aug 08, 2017 1:25 am
by lawrence
You need to install it first, execute the following command in the Ubuntu core system:

# cd NanoHatOLED
# sudo -H ./install.sh

Re: Nanohat OLED crashing

Posted: Tue Aug 08, 2017 3:49 pm
by jhsul
lawrence wrote:
You need to install it first, execute the following command in the Ubuntu core system:

# cd NanoHatOLED
# sudo -H ./install.sh


I've already done that. The screen works fine until it tries to go to page 2 of the display

Re: Nanohat OLED crashing

Posted: Wed Aug 09, 2017 2:43 am
by lawrence
I'm sorry, it's an issue. Now you can fix it this way:

cd ~/NanoHatOLED/BakeBit/
sudo git checkout master
sudo git pull
sudo reboot