Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4515

Raspberry Pi OS • Accessing an i2c bus device

$
0
0
I have a Raspberry Pi Zero 2 w and I have an adafruit SHT4x i2c device.

The sht4x device is connected

3.3 V - pin1 of zero connector
i2c Data - pin3 of zero connector
i2c Clock - pin5 of zero connector
GND - pin9 of zero connector

I am expecting the device to show up on the i2c1 bus.

The sht4x device is supported by the kernel in the device-driver-hwmon location and in menuconfig has the "M" set so I expect a kernel build to have a sht4x kernel module.

I made no kernel configuration changes and followed the steps to cross compile a kernel. I installed the kernel and modules per the steps and was able to reboot. I can also install the kernel module manually and it shows up in lsmod:

$ lsmod
Module Size Used by
sht4x 12288 0
crc8 12288 1 sht4x
rfcomm 53248 4
<bunch of other stuff.

When I use the i2cdetect command to see if it shows up on the bus I get this error:

$ i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

I can run i2cdetect on bus 2 and it shows some stuff:

$ i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- 37 -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- 54 -- -- -- -- 59 -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I certainly do not have anything connected to i2c2. I only have the 4 pins connected above. I assume that the zero doesn't have some i2c devices on the i2c2 bus intergrated into the zero board.

So, I am confused why i2c1 doesn't seem to exist and i2c2 seems to have some devices attached to it.

Any pointers would be appreciated.

Thanks
Chris

Statistics: Posted by chriskot870 — Tue Jun 25, 2024 11:52 pm — Replies 2 — Views 51



Viewing all articles
Browse latest Browse all 4515

Trending Articles