Bus error with MLX90640

I have purchased the MLX90640 camera and used direct GPIO header connection.

I followed the 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

I have tried a lot of research and updated the baudrate but cant seem to find a solution. Any help would be greatly appreciated!

Is your MLX90640 Seeed’s Grove . We don’t have that problem with our products.

Yes my MlX9064 is seeed’s grove. Can you explain what this error is?

solved. I am using a compute module, which with rev = GPIO.RPI_REVISION gives 0 which isnt a key in your function rev_to_bus[rev]
. I had to manually change bus to 1 in i2c.py file
/home/pi/.local/lib/python3.7/site-packages/grove/i2c.py

1 Like