You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Judging from the i2ctransfer command you had, I suspect you want to send three bytes and subsequently read 6 bytes? Without knowing what how your source code looks, but from the error you included seems to indicate that you use the write_i2c_block_data...? I wouldn't use that for that scenario, though. You see, the *_i2c_block_data function require that your device has the concept of offset addresses, and I don't believe that is the case here. Hence, the wrong command.
What I would ask you to try is to use Example 6 in the readme as your base. You know, something like:
fromsmbus2importSMBus, i2c_msg# Single transaction writing three bytes then read sixwrite=i2c_msg.write(0x38, [0xac, 0x33, 0x00])
read=i2c_msg.read(0x38, 6)
withSMBus(1) asbus: # Don't know the i2c bus you use, so you may have to change this?bus.i2c_rdwr(write, read)
data=list(read)
print(data)
Very, very untested, but I would appreciate if you could try that :)
Hi !
I try to write some python code for reading the AHT25 sensor.
The sensor is nothing special - only a humidity / temp sensor.
It´s connected to the Pi 4 directly with 15cm of wire cable to the I2C port of the Pi (Pin 3, 5).
If I use i2cdetect I can see the sensor:
Using i2ctransfer works also with no problems:
And if I decode the resulting bytes I get plausible readings. I even can see that the temp rises when I touch the sensor.
Now I tried to read the sensor with your python lib but without any luck ...
I always got errors like this:
Sometime I see Error 5, too (Input Output error)
I tried pullups with 2k2, 4k7 and 10k. But nothing seems to help.
Do you have any idea what can cause this errors? It´s frustrating ... All other sensors I try work like a charm. But this sensor drives me crazy :-)
Hope on any hint.
Dominik
The text was updated successfully, but these errors were encountered: