Stereopi I2C connection

StereoPi hardware discussion
Post Reply
bensailor
Posts: 17
Joined: Thu Mar 05, 2020 9:46 pm

Stereopi I2C connection

Post by bensailor »

Hello

I have brought a seeed grove MLX90640 thermal camera to add to my project.

i am having issues with a bus error. I am not sure where the error comes from and whether it would be hardware related to gpioheader connection or software. I have used the correct GPIO pins, scl & sda and run out of ideas to trouble shoot. I know this is a bit unrelated to StereoPI but I thought since I have a raspbian image I could use the GPIO pins like a normal raspberry pi.

I have followed this setup guide https://github.com/Seeed-Studio/Seeed_Python_MLX9064x

My i2C is enabled and seems to be working:

pi@raspberrypi:~ $ ls /dev/i2c*
/dev/i2c-1
pi@raspberrypi:~ $ i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – 33 – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

However when I try to run the BasicReadings.py I get the following error.
pi@raspberrypi:~/Seeed_Python_MLX9064x/examples $ python BasicReadings.py
Traceback (most recent call last):
File “BasicReadings.py”, line 22, in
main()
File “BasicReadings.py”, line 9, in main
mlx = seeed_mlx9064x.grove_mxl90640()
File “/home/pi/.local/lib/python3.7/site-packages/seeed_mlx9064x.py”, line 86, in init
super(grove_mxl90640, self).init(address)
File “/home/pi/.local/lib/python3.7/site-packages/seeed_mlx9064x.py”, line 27, in init
self.bus = Bus()
File “/home/pi/.local/lib/python3.7/site-packages/grove/i2c.py”, line 59, in init
bus = rev_to_bus[rev]
KeyError: 0


It would be helpful just to rule out if this could be caused by using a stereopi instead of raspberry pi.

User avatar
Realizator
Site Admin
Posts: 900
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Stereopi I2C connection

Post by Realizator »

This issue is similar to this one: https://github.com/Seeed-Studio/Seeed_P ... x/issues/7
As we have a few I2C buses initialized on the StereoPi, you might try to select the one you are planning to use in "self.bus = Bus()"
Eugene a.k.a. Realizator

bensailor
Posts: 17
Joined: Thu Mar 05, 2020 9:46 pm

Re: Stereopi I2C connection

Post by bensailor »

Thanks Realizator. I found the solution as I had to manually adjust the Bus address since we are using a compute module.

Post Reply