Inky Phat Name Badge does nothing

Using new Inky Phat Yellow.
It’s running on a 4GB Pi4 using Buster
Calendar = OK
Weather = OK
Name badge though, does nothing. No errors, no Inky display change. Nothing. Nada. Zilch.

My thought was perhaps the fonts haven’t installed, but the code isn’t failing on the code import step.

Any ideas, please?

(Also tried again later on Pi Zero W, with the same results.)

Trying again on a daisy fresh OS.
There’re are still lots of error messages - e.g.

python-wikiquotes is required
Installing python-wikiquotes...
E: Unable to locate package python-wikiquotes
Apt failed to install python-wikiquotes!
Falling back on pypi...

Could any of that be the cause of the issue?

Traceback (most recent call last):
  File "name-badge.py", line 35, in <module>
    inky_display = InkyPHAT(colour)
  File "/usr/local/lib/python2.7/dist-packages/inky/phat.py", line 72, in __init__
    v_flip=False)
  File "/usr/local/lib/python2.7/dist-packages/inky/inky.py", line 86, in __init__
    self.eeprom = eeprom.read_eeprom(i2c_bus=i2c_bus)
  File "/usr/local/lib/python2.7/dist-packages/inky/eeprom.py", line 102, in read_eeprom
    raise ImportError('This library requires the smbus2 module\nInstall with: sudo pip install smbus2')
ImportError: This library requires the smbus2 module
Install with: sudo pip install smbus2
pi@raspberrypi:~/Pimoroni/inky/examples $ 

This isn’t very well tested prior to sale, is it?

pi@raspberrypi:~/Pimoroni/inky/examples $ python name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"
Inky pHAT/wHAT: Hello... my name is:

Use Inky pHAT/wHAT as a personalised name badge!


pi@raspberrypi:~/Pimoroni/inky/examples $ 

BUT STILL NO BADGE ON THE INKY PHAT!!!

Some packages could not be installed, review the output for details!

pi@raspberrypi:~ $ 

Which packages?
Is this why BADGE doesn’t work?

Hi Richard,

Sorry to see that, it’ll be changes to Raspbian as it’s upgraded that’ll be causing errors, I’ll give our team a heads up.

It looks like it’s the correct library for the new version, but we’d need to see the full output of the install script to know which packages they were installed. I’d recommend trying both:

sudo pip install inky

and

sudo pip3 install inky

so you can try both python 2.7 and python 3 to see if that makes a difference.

Also please could you confirm you have the SPI interface enabled in raspi-config?

Cheers,

Matt

Hi Matt,

How, why then do CALENDAR and WEATHER work?

SPI is enabled

pi@raspberrypi:~ $ sudo pip install inky
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: inky in /usr/local/lib/python2.7/dist-packages (1.0.1)
Requirement already satisfied: numpy in /usr/lib/python2.7/dist-packages (from inky) (1.16.2)
pi@raspberrypi:~ $


pi@raspberrypi:~ $ sudo pip3 install inky
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: inky in /usr/local/lib/python3.7/dist-packages (1.0.1)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from inky) (1.16.2)
pi@raspberrypi:~ $ 


pi@raspberrypi:~/Pimoroni/inky/examples $ python name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"
Inky pHAT/wHAT: Hello... my name is:

Use Inky pHAT/wHAT as a personalised name badge!


pi@raspberrypi:~/Pimoroni/inky/examples $ 

No change on Inky, still shows calendar. not name badge. :-(

Any difference if you try

python3 name-badge.py

pi@raspberrypi:~ $ cd /home/pi/Pimoroni/inky/examples
pi@raspberrypi:~/Pimoroni/inky/examples $ python3 name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"
Inky pHAT/wHAT: Hello... my name is:

Use Inky pHAT/wHAT as a personalised name badge!


Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 100, in read_eeprom
    from smbus2 import SMBus
ModuleNotFoundError: No module named 'smbus2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "name-badge.py", line 37, in <module>
    inky_display = InkyPHAT(colour)
  File "/usr/local/lib/python3.7/dist-packages/inky/phat.py", line 72, in __init__
    v_flip=False)
  File "/usr/local/lib/python3.7/dist-packages/inky/inky.py", line 86, in __init__
    self.eeprom = eeprom.read_eeprom(i2c_bus=i2c_bus)
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 102, in read_eeprom
    raise ImportError('This library requires the smbus2 module\nInstall with: sudo pip install smbus2')
ImportError: This library requires the smbus2 module
Install with: sudo pip install smbus2
pi@raspberrypi:~/Pimoroni/inky/examples $ sudo pip install smbus2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: smbus2 in /usr/local/lib/python2.7/dist-packages (0.3.0)
pi@raspberrypi:~/Pimoroni/inky/examples $ python3 name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"
Inky pHAT/wHAT: Hello... my name is:

Use Inky pHAT/wHAT as a personalised name badge!


Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 100, in read_eeprom
    from smbus2 import SMBus
ModuleNotFoundError: No module named 'smbus2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "name-badge.py", line 37, in <module>
    inky_display = InkyPHAT(colour)
  File "/usr/local/lib/python3.7/dist-packages/inky/phat.py", line 72, in __init__
    v_flip=False)
  File "/usr/local/lib/python3.7/dist-packages/inky/inky.py", line 86, in __init__
    self.eeprom = eeprom.read_eeprom(i2c_bus=i2c_bus)
  File "/usr/local/lib/python3.7/dist-packages/inky/eeprom.py", line 102, in read_eeprom
    raise ImportError('This library requires the smbus2 module\nInstall with: sudo pip install smbus2')
ImportError: This library requires the smbus2 module
Install with: sudo pip install smbus2
pi@raspberrypi:~/Pimoroni/inky/examples $

Also tried

sudo pip3 install smbus2
python name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"
python3 name-badge.py --type "phat" --colour "yellow" --name "Inigo Montoya"

Of course, no improvement. :(

Any changes to the error messages at all?

Did smbus2 install properly? Does installing it with pip as well as pip3 help anything?

Any output from the name-badge commands?

Which error messages Matt?
SMBUS installed OK, yes. (Calendar and Weather work OK remember!).
pip/pip3 doesn’t seem to have changed anything.
No, nothing from the name-badge commands.

In Thonny, open name-badge.py
Comment-out line 22, # parser.add_argument('--name', '-n', type=str, required=True, help="Your name")

Comment-out line 69, # name = args.name

Add new line 70, name = 'Hello World!'

Execute code.
Success!

Looks like it’s something to do with the name string, but quite what, I don’t know.

We’re suspecting it’s different versions of Pythons used at the command line and in whichever Python utility you’re using (you’ve mentioned Thonny, are you also using IDLE3?)

Might be worth trying:
sudo python3 -m pip install smbus2

That should install smbus2 specifically for the version of python3 that’s run when you use it at the Pi command line.

It’s already happy there with smbus2

pi@raspberrypi:~ $ sudo python3 -m pip install smbus2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: smbus2 in /usr/local/lib/python3.7/dist-packages (0.3.0)

Idle3 unavailable, so installed that.

pi@raspberrypi:~ $ sudo apt-get install idle3

Name badge doesn’t ask for the name, it just crashes.

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
=========== RESTART: /home/pi/Pimoroni/inky/examples/name-badge.py ===========
Inky pHAT/wHAT: Hello... my name is:

Use Inky pHAT/wHAT as a personalised name badge!


usage: name-badge.py [-h] [--mock] [--type {auto,what,phat}]
                     [--colour {red,black,yellow}] --name NAME
name-badge.py: error: the following arguments are required: --name/-n
>>>

You’ll want to run it from the “Terminal” so that you can pass your name as a parameter. I don’t think you can pass parameters running the script from Idle3.

Bangs head on wall, sobs quietly into first available cushion…

That’s the first thing I tried Tomm. See first post in this thread.

Apologies, joined the thread a bit late.

Is there any difference if you run the script with python or python3?

No, tried that!
See reply dated Aug 19th, 15:36

I’m having the same issue on my new pi. Just bought a new pi and an e-ink board. Just put it all together, but can’t get any example to run (except what the manufacturer included in their example bits)