Inky pHAT setup

I am trying to follow the tutorial for setting up my inky phat (https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat) but have run into issues in trying to run the examples. Everything installed properly, yet when I try the nametag example, I get the following:

Use Inky pHAT/wHAT as a personalised name badge!

Traceback (most recent call last):
File “/home/pi/Pimoroni/inky/examples/name-badge.py”, line 29, in
inky_display = InkyPHAT(colour)
File “/usr/local/lib/python2.7/dist-packages/inky/phat.py”, line 27, in init
v_flip=False)
File “/usr/local/lib/python2.7/dist-packages/inky/inky.py”, line 74, in init
self.eeprom = eeprom.read_eeprom()
File “/usr/local/lib/python2.7/dist-packages/inky/eeprom.py”, line 103, in read_eeprom
i2c = SMBus(1)
File “/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py”, line 253, in init
self.open(bus)
File “/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py”, line 265, in open
self.fd = os.open("/dev/i2c-{}".format(bus), os.O_RDWR)
OSError: [Errno 2] No such file or directory: ‘/dev/i2c-1’

I tried reinstalling the directory and examples via github but this made no difference. Please help.

Try running it in Python3, it looks like your running it in python 2. It should work in both but try python 3 anyway just to see what happens.
And did you install any other Hats or pHats on that Pi previous to this? Or maybe run another installer previously thats mucking things up?

Hi there. I ran it in python 3 and have the same error. I installed the BLINKT previously so I’m not sure if that is creating the problem or something else. It seems its having trouble finding and installing certain packages from the library but I don’t know how to go about fixing that. The terminal is spitting out messages like this for several packages:

Apt failed to install python3-font_source_sans_pro!
Falling back on pypi…
Requirement already satisfied: font_source_sans_pro in /usr/local/lib/python3.5/dist-packages
python-wikiquotes is required
Installing python-wikiquotes…
E: Unable to locate package python-wikiquotes
Apt failed to install python-wikiquotes!
Falling back on pypi…

Hope you can help

If it was me, I’d reflash my card with a fresh image of Raspbian and start over from scratch. And foloow the tutorial to the letter.

I think you will find that if you enable the I2C interface this will solve the problem. I don’t know why, because I thought the pHAT doesn’t use the I2C, only the SPI.

At the command prompt, enter sudo raspi-config, select Interfacing Options then enable I2C.

It can’t hurt to turn on i2c but as far as I know the Pimoroni installer turns it on, if its off, for you. If its needed for that pHat.
The Inky pHat doesn’t use i2c though. It’s not SPI either, not the normal SPI pins anyway. Which kind of makes sense as its not written too like a normal display.

Also i2c being off when it should be on, I believe will get you all kinds of IO errors.

The Pimoroni installer “curl https://get.pimoroni.com/inky | bash” turns SPI on if it is off but it does not turn on I2C. If the examples are run without I2C enabled, the following error is produced:

OSError: [Errno 2] No such file or directory: ‘/dev/i2c-1’

I also run the older version of inky on another Pi, installed using “curl https://get.pimoroni.com/inkyphat | bash”. That also enabled SPI and not I2C and the example programs run on this version without requiring I2C.

Ok, I must be looking at the wrong Inky or something? The pinout says it doesn’t use i2c so now I’m really confused? Just for the record I don’t own an inky of any kind at the moment.