Automation hat examples do not work

I have a RPi 4b and I installed the latest Debian Bullseye (released 2022-09-22) and the automation hat software.
Everything installed ok but when I try and run the example code I get this:

jeremy@raspberrypi:~/Pimoroni/automationhat/examples/hat $ python3
Traceback (most recent call last):
File “/home/jeremy/Pimoroni/automationhat/examples/hat/”, line 8, in
if automationhat.is_automation_hat():
File “/usr/local/lib/python3.9/dist-packages/automationhat/”, line 317, in is_automation_hat
File “/usr/local/lib/python3.9/dist-packages/automationhat/”, line 360, in setup
_ads1015 = ads1015.ADS1015()
File “/usr/local/lib/python3.9/dist-packages/ads1015/”, line 91, in init
self._ads1115 = Device(I2C_ADDRESSES, i2c_dev=self._i2c_dev, bit_width=8, registers=(
File “/usr/local/lib/python3.9/dist-packages/i2cdevice/”, line 166, in init
self._i2c = smbus.SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory

can anyone suggest what might be wrong here?
Perhaps of note is that the latest RPi O/S no longer has the default ‘pi’ user. I’m wondering if this has something to do with a file not being found…?

Check I2C is enabled in sudo raspi_config !

(I think it’s under ‘interfacing options’).

Ok…that did the trick! Thanks!!

1 Like