I appreciate this may be a duplicate question, but I have spent days working through answers to other questions and none work for me. Most similar questions predate the debian buster release, which I know changed slightly how I2C is enabled, so I wonder if all are still relevant.
I am trying and failing to get my Raspberry Pi Zero W to recognise any I2C devices. I've tried across multiple devices and multiple Pi Zero W's, and get the same (lack of) results on each.
What I did:
- I followed this tutorial (and many others). EDIT Actual instructions typed:
sudo reboot
sudo apt-get update
sudo apt-get install python-smbus python3-smbus python-dev python3-dev i2c-tools
sudo i2cdetect -y 1
- I connected a BlinkM ThingM as follows:
- BlinkM:d -> RPi GPIO2/SDA1 I2C
- BlinkM:c -> RPi GPIO3/SCL1 I2C
- BlinkM:+/- to a separate 5V power source
(I also tried a LuMini ring and a Lumenati Stick, and tried two other RPi Zeros with identical results in case it was a hardware problem)
The results I get:
pi@HA-RPZW-0001:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@HA-RPZW-0001:~ $ sudo i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
I have tried:
Ensuring I2C (and SPI) are enabled in raspi-config
Verifying parameters are set correctly in config.txt:
pi@HA-RPZW-0001:~ $ cat /boot/config.txt | grep dtparam
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
dtparam=audio=on
Verifying there is a device in /dev:
pi@HA-RPZW-0001:~ $ ls /dev/ | grep i2c
i2c-1
Checking the modules are loaded:
pi@HA-RPZW-0001:~ $ lsmod | grep i2c
i2c_bcm2835 16384 0
i2c_dev 16384 0
Ensuring all python modules are loaded:
pi@HA-RPZW-0001:~ $ sudo apt-get install python-smbus python3-smbus python-dev python3-dev i2c-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
i2c-tools is already the newest version (4.1-1).
python-dev is already the newest version (2.7.16-1).
python-smbus is already the newest version (4.1-1).
python3-dev is already the newest version (3.7.3-1).
python3-smbus is already the newest version (4.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I am running:
pi@HA-RPZW-0001:~ $ cat /etc/os-release | grep "PRETTY"
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
Can anyone help?
SOLUTION:
Connect ground on power supply to ground on RPi. Never realised that was a thing, but i2c device now detected, thank you all!