axel
New Member
Posts: 23
|
Post by axel on Jul 6, 2017 12:06:32 GMT -8
I am getting for the outside temp/humidity lots of zero values. First I thought its because of the upload to Wunderground, I stopped this and it seemed to be better. But only for a while, I am also not getting the log files to work either. See zero values in db here: Thanks .axel
|
|
texag
New Member
Posts: 21
|
Post by texag on Jul 6, 2017 13:20:47 GMT -8
Axel,
I had similar problems with my AM2315 temperature sensor. At times it would report values of zero (usually the result of a CRC error) or very large negative values. I re-wrote the standard AM2315 read code in GroveWeatherPi.py to execute a re-try on the sensor read until it returned a reasonable value. I don't know if the erratic values are common with this sensor but your description sounds similar to my problem.
The old code is :
outsideTemperature, outsideHumidity, crc_check = am2315.sense() My replacement code is:
iii = 0
outsideTemperature, outsideHumidity, crc_check = am2315.sense()
#print "crc: %i" % crc_check
while ((crc_check == -1) or (outsideTemperature < -100.0) and (iii < 10)):
time.sleep(0.2)
tca9545.write_control_register(TCA9545_CONFIG_BUS0)
outsideTemperature, outsideHumidity, crc_check = am2315.sense()
iii = iii + 1
#print "outsideTemperature: %0.1f C" % outsideTemperature
#print "crc: %i" % crc_check
#print "iii: %i" % iii
Replace the old code with my code block to see if that fixes your problem.
Also, I'm not sure how familiar you are with python so be aware of the code indentation level where you insert the replacement code. In Python, source code with the same indentation is grouped together in a code block. Make sure my replacement code is indented to the same level as the old code.
Kevin
|
|
|
Post by SDL on Jul 6, 2017 14:40:01 GMT -8
Kevin,
You solution is a good one at this point. When we released our ESP8266 based OurWeather Product, we had a reliability problem on the AM2315 which we eventually fixed by working with the driver code. We went over 200,000 reads with no errors. It's not the sensor, it's the I2C libraries we concluded.
I'll bet that the issue is the SMBUS I2C drivers on the Raspberry Pi and we should look at that. Start a big test and look at statistics.
Axel, you are getting a huge error rate from your database. A couple of questions:
1) What Raspberry Pi are you running this on?
2) Have you update/upgraded the Operating Systems
3) How is your AM2315 connected to the Raspberry Pi? The standard way or are you doing something different. Please let us know.
4) AM2315 on 5V I2C or 3.3V I2C?
BP
What
|
|
axel
New Member
Posts: 23
|
Post by axel on Jul 7, 2017 18:48:26 GMT -8
Kevin, thanks the changes in the code makes a difference, no zero values at all for over 24h.
1) Running on the RasperryPi III 2) last update done some 3 weeks ago 3) standard 4) I am not sure right now ... how can I check.
Anyways it seems to be OK now. Thanks
|
|
|
Post by SDL on Jul 7, 2017 19:13:14 GMT -8
Axe and Kevin,
Thanks for the suggestion. It is a kludge and we will fix the underlying problem in the next couple of weeks. First thing we have to do is duplicate the problem.
Axel, what do you mean by "standard way"? can you take a picture or how do you have it wired?
BP
|
|
axel
New Member
Posts: 23
|
Post by axel on Jul 8, 2017 8:27:55 GMT -8
Attching pic of the Temp/Humidity Sensor, its connected to the weather board, next to the wind direction and wind speed. I think the export to WeatherUnderground is also effected by zero values, I will paste Kevins Code also into this section of GroveWeatherPi.py and will then hopefully get no zero values anywhere. Attachments:
|
|
|
Post by SDL on Jul 9, 2017 18:34:23 GMT -8
Thanks! We will set up a test and start looking at it.
BP
|
|