|
Post by SDL on Jan 10, 2019 19:42:35 GMT -8
Peter,
I didn't go the full bore with your new code, but we might in the future. Instead, I fixed the "None" error like this:
try: ToutsideHumidity, ToutsideTemperature, crc_check = am2315.read_humidity_temperature_crc() except: if am2315 is None: am2315 = AM2315.AM2315() print ("am2315 None Error Detected") crc_check = -1 If a "None" is detected, then I repair the am2315 driver by reinitializing it.
That would trap, and hopefully fix the error above.
I have updated this as GroveWeatherPi 2.13
If this doesn't nail the last problem, I'm going to step back and look at new code (your code) to fix this.
What is bothering me about this is that we are fixing the symptoms and not the root cause of this problem.
I'm starting a new 2.13 thread.
Best regards,
BP
|
|
|
Post by triggerfish on Jan 10, 2019 22:41:17 GMT -8
Like I said, my code is far from ideal, but it seemed to do the trick. Any better solution is more than welcome.
I have seen the new thread, but I'd like to add that my solution failed this night after the 48 hour reboot. I've seen it before, but when a failure occurs with the initializing of the program, my solution does not handle that. I hope that is automatically fixed by trapping the "none" error at AM2315 level.
I'll update asap end we will see.
|
|
hvrooyen
New Member
Posts: 32
Raspberry Pi: Yes
Other Device: Arduino
|
Post by hvrooyen on Jan 10, 2019 22:41:35 GMT -8
Temp change of 10 in 60 seconds? Really? ... The way I understand what he said is that if your real (and stable) temperature is 9 degrees, and a once off false value of 0 is returned, then that will not be flagged as false because the change from 9 to 0 (and back to 9 on next read) in 60 seconds is within limits.
|
|
|
Post by lbendlin on Jan 11, 2019 5:24:11 GMT -8
What is bothering me about this is that we are fixing the symptoms and not the root cause of this problem. BP Is there any other weatherproof i2c sensor? preferable with added pressure reading?
|
|
|
Post by triggerfish on Jan 11, 2019 5:57:51 GMT -8
Temp change of 10 in 60 seconds? Really? ... The way I understand what he said is that if your real (and stable) temperature is 9 degrees, and a once off false value of 0 is returned, then that will not be flagged as false because the change from 9 to 0 (and back to 9 on next read) in 60 seconds is within limits. Exactly!
|
|
|
Post by SDL on Jan 13, 2019 11:24:26 GMT -8
Peter,
Yes, I see exactly what you mean now. I am going to look at alternatives in the software.
lbendlin,
Yes, I have started to look for a reasonably priced alternative. Suggestions welcome!
BP
|
|