|
Post by luchacz on Nov 2, 2021 13:01:07 GMT -8
I have GrovePi_Plus Hat connected to raspberry pi 4B and i'm trying to use hm3301 sensor by this tutorial raspberry-pi-with-the-hm3301. I connect sensor to i2c-2 port and when i'm trying run script testSDL_Pi_HM3301.py I getting this error( null from read data returned): /home/pi/SDL_Pi_HM3301# python3 testSDL_Pi_HM3301.py
(-82, '')
[]
closing hm3301
Traceback (most recent call last):
File "testSDL_Pi_HM3301.py", line 21, in <module>
myData = hm3301.get_data()
File "/home/pi/SDL_Pi_HM3301/SDL_Pi_HM3301.py", line 85, in get_data
self.parse_data(data)
File "/home/pi/SDL_Pi_HM3301/SDL_Pi_HM3301.py", line 73, in parse_data
self.PM_1_0_conctrt_std = data[4]<<8 | data[5]
IndexError: list index out of range Maybe I need to change SDA and SCL numbers but i don't know where to find this information. Can someone help me with this problem?
|
|
|
Post by SDL on Nov 3, 2021 14:51:22 GMT -8
It will probably never work with the GrovePi_Plus. You don't know what they have in line with the ports. Note. It won't work using I2C ports. Only I/O ports.
It does work with our pi2Grover board.
BP
|
|