Hi,
I am trying to get the Hyperpixel i2c interface to work. I have a brand new Raspberry Pi 4, running 64bit raspbian. I have been following the guide here https://learn.pimoroni.com/article/getting-started-with-hyperpixel-4.
I get the display to work. I get touch to work. However, I am unable to run the command:
sudo ln -s /dev/i2c-3 /dev/i2c-1
I get the error:
ln: failed to create symbolic link '/dev/i2c-1': File exists
ls /dev | grep i2c
gives me:
i2c-1
i2c-20
i2c-21
i2c-22
I can run i2cdetect -l
, which gives me:
i2c-20 i2c Broadcom STB : I2C adapter
i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter
i2c-21 i2c Broadcom STB : I2C adapter
i2c-22 i2c i2c@0 I2C adapter
If I run my script using example code from here, I get the following error:
File "/myscript.py", line 81, in main
ioe = io.IOE(i2c_addr=0x18)
File "/usr/local/lib/python3.9/dist-packages/ioexpander/__init__.py", line 345, in __init__
chip_id = (self.i2c_read8(REG_CHIP_ID_H) << 8) | self.i2c_read8(REG_CHIP_ID_L)
File "/usr/local/lib/python3.9/dist-packages/ioexpander/__init__.py", line 353, in i2c_read8
self._i2c_dev.i2c_rdwr(msg_w, msg_r)
File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 121] Remote I/O error
My /boot/config.txt
has these (I believe) relevant lines:
dtparam=i2c_arm=on
(...)
dtoverlay=vc4-kms-dpi-hyperpixel4
dtparam=rotate=270,touchscreen-swapped-x-y,touchscreen-inverted-x
For further debugging, this is what i2cdetect -y X
gives me:
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: -- -- -- -- -- -- -- --
i2cdetect -y 20
and i2cdetect -y 21
(their outputs are identical):
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
i2cdetect -y 22
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- UU -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I have never worked with i2c before, and must admit I am fumbling a bit, not really understanding the i2cdetect command. Any help would be greatly appreciated!