Problems of the four letter variety


#1

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


#2

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


#3

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.


#4

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


#5

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


#6


#7

The Pi should have /dev/i2c-1.

How did you enable i2c?


#8

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.


#9

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

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


#10

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


#11

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!


#12

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)


#13

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).