|
Post by SDL on Jan 13, 2019 11:19:58 GMT -8
This is just a minor update of 3.13. We had a test escape (we were testing 3.12 and not 3.13). Fixed now. Sorry about that. All my fault. No beer for BP. Version 3.14 www.switchdoc.com/January 12, 2018 - Version 3.14 Fixed am2315 not assigned error BP
|
|
|
Post by triggerfish on Jan 14, 2019 0:59:50 GMT -8
Running 3.14 now. Removed the "%" from the V56 value in the updateBlynk.py, added my own code to forwards sunlight data to wunderground again. And Now We Wait...
|
|
|
Post by triggerfish on Jan 14, 2019 3:38:39 GMT -8
Get several -1443 temp values in Blynk... Work needs to be done still
|
|
|
Post by SDL on Jan 15, 2019 5:52:14 GMT -8
-1443? Boy, I really need to see the printouts from the log (with AM2315DEBUG turned on in the AM2315.py file under SDL_Pi_AM2315) around one of those fails. That is a strange, strange number. And was it caught by the CRC or not?
BP
|
|
|
Post by triggerfish on Jan 15, 2019 7:58:12 GMT -8
I looked, but with pulling the 3.14 version, may changes have been overwritten and the debug was set to False
|
|
|
Post by SDL on Jan 15, 2019 17:28:53 GMT -8
We will have to wait! But I am really looking forward to the data. I, for the first time, saw a bad piece of data on mine. It went from about 19C to about 9C. Picture below. It is much rarer than yours but here was a spike of less than about 10 degrees C so it got through. I'm going through the logs tomorrow to see what I can find. BP
|
|
|
Post by triggerfish on Jan 15, 2019 23:58:07 GMT -8
-1443? Boy, I really need to see the printouts from the log (with AM2315DEBUG turned on in the AM2315.py file under SDL_Pi_AM2315) around one of those fails. That is a strange, strange number. And was it caught by the CRC or not? BP I just realized it was not caught by the crc check, because line 1112 code:
if (crc_check != -1):
Let is pass and after my modification to:
if (crc_check != -1) and (ToutsideHumidity >= 0 and ToutsideHumidity <= 100):
I don't get the spikes anymore...
|
|
|
Post by SDL on Jan 16, 2019 12:37:56 GMT -8
How does that code fix your temperature spikes you are seeing? I'm confused.
BP
|
|
|
Post by triggerfish on Jan 16, 2019 13:23:46 GMT -8
How does that code fix your temperature spikes you are seeing? I'm confused. BP Apparently the error handling in the AM2315 driver is not full proof. I often still see errors in the logfile. I don't just trust the crc, but also check the humidity. So if a failure slips through, I just double check if the humidity is bigger than zero and smaller than 100 assuming this would also be an invalid value. It works, not exactly sure why. Tailing the log file for a couple of minutes:
pi@IBADHOEV14:~/SDL_Pi_GroveWeatherPi $ tail -f log/IBADHOEV14_2019-01-16_20.08.03.log | grep AM2315 File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) AM2315readCount = 0 File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) AM2315readCount = 1 Bad AM2315 Temperature = 2892.8 AM2315temperature= 5.6 AM2315humdity= 93.4 AM2315crc= 23824 AM2315c= 23824 AM2315temperature= 5.6 AM2315humdity= 93.4 AM2315crc= 23824 AM2315c= 23824 File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) AM2315readCount = 0 File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) AM2315readCount = 1 AM2315temperature= 5.6 AM2315humdity= 93.4 AM2315crc= 23824 AM2315c= 23824 AM2315temperature= 5.6 AM2315humdity= 93.4 AM2315crc= 23824 AM2315c= 23824 AM2315temperature= 5.6 AM2315humdity= 93.4 AM2315crc= 23824 AM2315c= 23824
No strange temperatures, but still errors and no -1 on the crc. So I guess ridiculous values slip through as well.
|
|
|
Post by SDL on Jan 16, 2019 17:46:42 GMT -8
You are filtering out error information about what line those errors are on by using the grep.
This still very useful, but I need to see the other lines around the error to figure out what is going on.
If you could, post the lines around each area too please..
BP
|
|
|
Post by triggerfish on Jan 16, 2019 22:11:16 GMT -8
Here are a couple:
------Patting The Dog------- ----------------- Weather Sampling ----------------- ----------------- An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList results = self._bus.read_i2c_block_data(self._address, register, length) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data ioctl(self._device.fileno(), I2C_RDWR, request) IOError: [Errno 121] Remote I/O error
AM2315readCount = 0 AM2315temperature= 5.7 AM2315humdity= 93.4 AM2315crc= 40401 AM2315c= 40401 --Sending Data to WeatherUnderground--
------Patting The Dog------- ----------------- Weather Sampling ----------------- ----------------- An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList results = self._bus.read_i2c_block_data(self._address, register, length) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data ioctl(self._device.fileno(), I2C_RDWR, request) IOError: [Errno 121] Remote I/O error
AM2315readCount = 0 AM2315temperature= 5.7 AM2315humdity= 93.4 AM2315crc= 40401 AM2315c= 40401 --Sending Data to WeatherUnderground-- cws=| 28.158294546
------Patting The Dog------- ----------------- Weather Sampling ----------------- ----------------- An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 129, in writeList self._bus.write_i2c_block_data(self._address, register, data) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data self._device.write(data) IOError: [Errno 121] Remote I/O error
AM2315readCount = 0 An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 129, in writeList self._bus.write_i2c_block_data(self._address, register, data) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data self._device.write(data) IOError: [Errno 121] Remote I/O error
AM2315readCount = 1 AM2315temperature= 5.7 AM2315humdity= 93.4 AM2315crc= 40401 AM2315c= 40401 --Sending Data to WeatherUnderground-- cws=| 28.8781152217
------Patting The Dog------- ----------------- Weather Sampling ----------------- ----------------- An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 129, in writeList self._bus.write_i2c_block_data(self._address, register, data) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data self._device.write(data) IOError: [Errno 121] Remote I/O error
AM2315readCount = 0 An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 63, in _read_data self._device.writeList(AM2315_READREG,[0x00, 0x04]) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 129, in writeList self._bus.write_i2c_block_data(self._address, register, data) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data self._device.write(data) IOError: [Errno 121] Remote I/O error
AM2315readCount = 1 An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList results = self._bus.read_i2c_block_data(self._address, register, length) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data ioctl(self._device.fileno(), I2C_RDWR, request) IOError: [Errno 121] Remote I/O error
AM2315readCount = 2 >>>>>>>>>>>>> Bad AM2315 Temperature = 2892.8 >>>>>>>>>>>>> --Sending Data to WeatherUnderground-- cws=| 26.7981160924
----------------- Weather Sampling ----------------- ----------------- An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList results = self._bus.read_i2c_block_data(self._address, register, length) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data ioctl(self._device.fileno(), I2C_RDWR, request) IOError: [Errno 121] Remote I/O error
AM2315readCount = 0 An exception of type IOError occurred. Arguments: (121, 'Remote I/O error') Traceback (most recent call last): File "./SDL_Pi_AM2315/AM2315.py", line 65, in _read_data tmp = self._device.readList(AM2315_READREG,8) File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 136, in readList results = self._bus.read_i2c_block_data(self._address, register, length) File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 215, in read_i2c_block_data ioctl(self._device.fileno(), I2C_RDWR, request) IOError: [Errno 121] Remote I/O error
AM2315readCount = 1 AM2315temperature= 5.7 AM2315humdity= 93.4 AM2315crc= 40401 AM2315c= 40401 --Sending Data to WeatherUnderground-- cws=| 30.9576977792
|
|
|
Post by SDL on Jan 18, 2019 9:05:50 GMT -8
Peter,
Very interesting. Let's see if I have this right. First of all, I should be trapping these exceptions. However, that is a symptom and not the cause.
Secondly, It looks like the system is working for most of these problems, in that it reads again and gets the device and the correct data. It looks like it gave up once. This is an interesting data point. Could it be that we aren't waking up the AM2315 from sleep mode properly in all cases? Hmmm.
BP
|
|
|
Post by triggerfish on Jan 21, 2019 2:35:49 GMT -8
Peter, Very interesting. Let's see if I have this right. First of all, I should be trapping these exceptions. However, that is a symptom and not the cause. I fully agree with that being a symptom, but in my humble opinion, a module like the AM2315 "driver" should either give an "ok" crc with valid values, or an "not-ok" crc with whatever values, giving you the choice in your calling program to act on the crc. Thus in the AM2315, I would cope with anything that the sensor would throw at me, no matter what the cause is. Retry an acceptable number of times and than returning you values. BUT: if a valid crc is returned, valid values should be returned also. With the current state apparently it's possible to get a valid crc with and invalid temperature. Secondly, It looks like the system is working for most of these problems, in that it reads again and gets the device and the correct data. It looks like it gave up once. This is an interesting data point. Could it be that we aren't waking up the AM2315 from sleep mode properly in all cases? Hmmm. BP My gut is telling me, there is an unique situation where the last read is invalid, but not checked correctly. Might be as simple as a "<=" in stead of a "<". One unique situation slips through. I still do not have enough python experience to put my finger on it. Working on that
|
|
|
Post by SDL on Jan 23, 2019 16:20:42 GMT -8
I agree that if you have a good CRC you should have a good reading. However, it looks like a bit is getting flipped on a very rare business.
Keep me up to date!
BP
|
|
|
Post by triggerfish on Jan 23, 2019 23:51:07 GMT -8
I agree that if you have a good CRC you should have a good reading. However, it looks like a bit is getting flipped on a very rare business. Keep me up to date! BP
Again, I would suggest on checking the humidity to see if the sensor produced valid data or not. I did some googling and apparently hum=0 is not possible on earth. Even the driest of the driest situations still have something like 0.1% hum. Equally impossible would be 100% There are several reference to this. So ín stead of trying to watch the temp change more than 10 degrees (which fails with me anyway) just check if humidity >0 and <100 for a valid read.
I check for that in my main loop, after the AM2315 read. On the crc-check line, I added the hum check and since then I get nice values. I have no insight in when that check is triggered so far. Maybe print a message if it does, but before I got the spikes, and after the change, no more spikes.
|
|