Open taisau opened 5 years ago
The author does not handle exceptions in the proper pythonic way, they have done a catch all for any type of exception, and so that loop just runs the 10 times and fails each time. I had this problem too, the solution for me was correcting my wiring, i had not wired the sensor too the correct SDA and SDC pins. Double check your wiring.
I am not very familiar with python. I get the error below and the best I can figure is that tmp is none, but I don't know how to fix that.
File "AM2315.py", line 88, in _read_data self.humidity = ((tmp[2] << 8) | tmp[3]) / 10.0 TypeError: 'NoneType' object has no attribute '__getitem__'