Problems of the four letter variety

Any idea why I’m getting the following when attempting to run the examples for four letter phat?

I2C is enabled and stretch lite is updated. I don’t think my soldering is that bad.

Traceback (most recent call last):
File “/home/pi/Pimoroni/fourletterphat/examples/glow.py”, line 3, in
import fourletterphat
File “/usr/lib/python2.7/dist-packages/fourletterphat/init.py”, line 3, in
from .i2c_bus import bus
File “/usr/lib/python2.7/dist-packages/fourletterphat/i2c_bus.py”, line 11, in
bus = smbus.SMBus(1)
IOError: [Errno 2] No such file or directory

How did you install the library (what commands did you run)?
How are you running the examples?
Can you please post a picture of your soldering

You could try running: ls /dev/i2c-* to see what i2c devices show up. This is normally the error you see when i2c is not enabled.

Installed via the pimoroni-dashboard.
Running the commands /home/pi/Pimoroni/fourletterphat/examples/glow.py
I’ll take photos later.

ls /dev/i2c-*
/dev/i2c-3

The Pi should have /dev/i2c-1.

How did you enable i2c?

If I2C wasn’t enabled during the pimoroni-dashboard setup of the phat, I’d have done it via sudo raspi-config (and rebooted).

I was trying this on a USB-stem pi zero but am going to try again tonight with a “proper” Pi (will rule out the GPIO headers but they are fine with other pHATs). I’ll also do a fresh stretch lite install and start again from scratch.

You should have dtparam=i2c=on in /boot/config.txt.

It looks like you’re running the i2c-gpio dtoverlay.

Ah! I did previously have the HyperPixel running on this install previously. Maybe starting from a fresh install would be best :-)

D’OH! It was the HyperPixel stuff!
Commenting the entries from /boot/config.txt works fine.

The downside of always using the same PiZero to try out new HATs on.

Cheers!

Ooh yes HyperPixel will do that! It likes to use all the pins.

You can modify things like Four Letter pHAT to use the i2c-3 bus and co-exist with HyperPixel but wiring them up is a challenge!

HyperPixel’s i2c-3 is available on pins BCM 10 (data) and BCM 11 (Clock)

As an added bonus, the hyper pixel changes also prevented me asking similar questions about the BM680 breakout board not working. I’d convinced myself I’d damaged it by plugging it in the wrong way round ;-) Nope! It’s fine (once the hyper pixel lines were commented out of the config.txt).

1 Like