|
Post by SDL on Jan 24, 2019 8:04:48 GMT -8
I will do a little more science on the issue, but empirically you have convinced me Peter. I'll do a release tomorrow with a humidity check implemented instead of the temperature fix, which is clearly flawed.
BP
|
|
|
Post by triggerfish on Jan 29, 2019 5:18:49 GMT -8
Not sure why (I'm not at home), but since this morning the AM2315 can not be found anymore. Will try to power the unit down and up again tonight to see what happens. There is still a long way to go to cope with the sensor problems Restarting the program does not solve it, rebooting the pi also does not solve it.
|
|
|
Post by SDL on Jan 29, 2019 10:01:09 GMT -8
Peter,
I am thinking that the other thread here referencing this problem might be it.
forums.adafruit.com/viewtopic.php?f=19&t=41193&hilit=AM2315
BP
|
|
|
Post by triggerfish on Jan 29, 2019 12:31:22 GMT -8
Mmm, interesting... So the 0.01 sleep basically can cause an overload on the AM2315... If I understand... I defined an AM2315COOLDOWN=0.11 in the module and I just put a time.sleep(AM2315COOLDOWN) before each AM2315 device access... That way the sensor gets a rest before it's accessed... Or am I barking up the wrong tree???
|
|
|
Post by SDL on Jan 31, 2019 11:30:35 GMT -8
Post your code and let me look at it.
BP
|
|
|
Post by triggerfish on Feb 2, 2019 0:10:28 GMT -8
Post your code and let me look at it. BP Sorry, just saw this. The code is far from spectacular. I just introduced a variable cooldown and sleep that before every actual AM2315 access. # GLOBAL VARIABLES AM2315_I2CADDR = 0x5C AM2315_READREG = 0x03 MAXREADATTEMPT = 3
AM2315COOLDOWN = 0.11
AM2315DEBUG = True And then for instance: ... # TELL THE DEVICE WE WANT 4 BYTES OF DATA time.sleep(AM2315COOLDOWN) self._device.writeList(AM2315_READREG,[0x00, 0x04]) time.sleep(AM2315COOLDOWN) tmp = self._device.readList(AM2315_READREG,8) self.temperature = (((tmp[4] & 0x7F) << 8) | tmp[5]) / 10.0 # check for > 10.0 degrees higher ...
|
|
|
Post by triggerfish on Feb 2, 2019 0:11:00 GMT -8
I will do a little more science on the issue, but empirically you have convinced me Peter. I'll do a release tomorrow with a humidity check implemented instead of the temperature fix, which is clearly flawed. BP Any news on the release yet?
|
|
|
Post by SDL on Feb 3, 2019 13:33:56 GMT -8
Starting on it late next week.
BP
|
|