|
Post by pagerman on May 1, 2021 5:40:36 GMT -8
I commented out the line for the auto-reboot (was giving me issues) and did a reboot - NOT a power off/on. And, the dust sensor is now not detected. Seems like a program bug somewhere......
./SkyWeather2.JSON File exists
########################################################## SkyWeather2 Weather Station Version 025 - SwitchDoc Labs
Program Started at:2021-05-01 08:20:17 ##########################################################
b'' ---------------------- BMP280: Present SkyCam: Present OLED: Not Present SunAirPlus/SunControl: Not Present SolarMAX: Not Present DustSensor: Not Present
UseBlynk: Disabled UseWSLIGHTNING: Enabled UseWSAQI: Disabled UseWSSKYCAM: Disabled UseMySQL: Enabled UseMQTT: Disabled Check WLAN: Not Present WeatherUnderground: Present UseWeatherStem: Present ---------------------- ----------------- Scheduled Jobs -----------------
###### Jobstore default: patTheDog (trigger: interval[0:00:20], next run at: 2021-05-01 08:20:43 CDT) readWiredSensors (trigger: interval[0:00:30], next run at: 2021-05-01 08:20:53 CDT) tick (trigger: interval[0:01:00], next run at: 2021-05-01 08:21:23 CDT) takeSkyPicture (trigger: interval[0:01:00], next run at: 2021-05-01 08:21:23 CDT) barometricTrend (trigger: interval[0:15:00], next run at: 2021-05-01 08:35:23 CDT) writeWeatherRecord (trigger: interval[0:15:00], next run at: 2021-05-01 08:35:23 CDT) writeITWeatherRecord (trigger: interval[0:15:00], next run at: 2021-05-01 08:35:23 CDT) ----------------- starting 433MHz scanning ###### Indoor Weather Sensors Found Main Weather Sensors Found Tick! The time is: 2021-05-01 08:22:23.234004 mySkyCameraText= SkyWeather2 V025 01-May-2021 08:22:26 Wind Speed: 4.7MPH Wind Gust: 6.7MPH Temp: 52.2 F ------->Sea Level 1017.0769
|
|
|
Post by SDL on May 1, 2021 15:46:32 GMT -8
Can you show me where the dust sensor is plugged into your Hat? The Laser AQ sensor won't work on the Pi I2C bus and we have to use the pgio bit banging fix.
This is one reason why we have moved to the WeatherSense AQI solution. Much more reliable.
Did you reboot on the last post?
Did you halt and power cycle on the last post?
My gut feel this is not related to your other problems.
BP
|
|
|
Post by pagerman on May 2, 2021 17:07:52 GMT -8
Can you show me where the dust sensor is plugged into your Hat? The Laser AQ sensor won't work on the Pi I2C bus and we have to use the pgio bit banging fix. This is one reason why we have moved to the WeatherSense AQI solution. Much more reliable. Did you reboot on the last post? Did you halt and power cycle on the last post? My gut feel this is not related to your other problems. BP In the D20/21 Dust Sensor socket as shown in the assembly manual. And, right. I think this is a separate issue. The AQI comes back to life for a bit after a power cycle but not after just a reboot.
|
|
|
Post by SDL on May 3, 2021 11:33:10 GMT -8
Send me a picture for me to check your wiring. Thanks!
BP
|
|
|
Post by pagerman on May 3, 2021 12:59:18 GMT -8
Send me a picture for me to check your wiring. Thanks! BP When I can get to it. Now it's mounted outdoors and also has an Ethernet cable for testing. The ethernet end has to be cut off to take it down.
|
|
|
Post by SDL on May 3, 2021 17:22:03 GMT -8
Hmmmm. I am somewhat of a loss here. Could you summarize your findings and testing? Maybe something is going to jump out at me.
BP
|
|
|
Post by pagerman on May 4, 2021 3:42:36 GMT -8
Summary: The AQI will start showing data after a power off/on. There is no set time that it will keep working. At some point it gets "stuck". The readings never change. Right now its "stuck" at 59. If you do a reboot, it usually comes back "stuck" at 0. If I do a power off/on it will then work again for a bit and then stop again.
|
|
|
Post by pagerman on May 4, 2021 5:03:08 GMT -8
Last few days. Attachments:
|
|
|
Post by Jason on May 4, 2021 5:03:49 GMT -8
I know this is going to sound ridiculous, however, I have the numbers to support what follows. My AQI behavior was very similar to what is described above. In a separate post, I shared some numbers that showed ~13% of the opportunity for readings of my dust sensor were successful over more than a month of observation. As a result, I decided to beef up the error handling within the scripts DustSensor.py and SDL_Pi_HM3301/SDL_Pi_HM3301.py in order to try and get a better understanding of why I was seeing so many checksum misses. My code changes were deployed to my RPi on 4/25 at 9:22PM. In the ~8.5 days since the code changes have been deployed, I estimate that ~1,020 opportunities for readings occurred. So far, my dust sensor has captured 1,005 successful readings for a success rate of ~98.5%.
Thanks,
Jason
|
|
|
Post by SDL on May 4, 2021 10:52:42 GMT -8
Jason,
Yes, that is what I think is happening. We have this under:
OPEN - 042321-01 - V025 - Evaluate Laser Dust Sensor error exits hm3301
Could you share your changes?
BP
|
|
|
Post by Jason on May 4, 2021 12:32:38 GMT -8
In DustSensor.py, the initial attempt to get data from the driver
myData = hm3301.get_data() is now wrapped in a try/except block
try: myData = hm3301.get_data() except Exception as e: print('=================================') print(datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')) print(e) print('=================================') return 0
After the new error this morning, I'm thinking I may add a try/except to the second attempt to get data from the driver.
In SDL_Pi_HM3301/SDL_Pi_HM3301.py, I added additional debugging to the function read_HM3301_data():
def read_HM3301_data(self):
(count, data) = self.pi.bb_i2c_zip( self.SDA, [4,self.I2C_Address,2,7,1,0x81,3, 2,6,DATA_CNT,3,0 ])
return list(data) is now
def read_HM3301_data(self):
(count, data) = self.pi.bb_i2c_zip( self.SDA, [4, self.I2C_Address, 2, 7, 1, 0x81, 3, 2, 6, DATA_CNT, 3, 0])
print('===============') print('HM3301 reading') print(list(data)) print('===============') return list(data)
As I mentioned in the previous post, I did not expect such a radical change in the success rate and was really just expecting to see better logging of errors as the checksums were failing. I'm certainly not suggesting this will fix the problem but I have no other explanation for such a radical improvement.
Jason
|
|
|
Post by pagerman on May 6, 2021 5:14:06 GMT -8
AQI hasn't worked since right after the last power off/on.
|
|
|
Post by SDL on May 8, 2021 8:33:00 GMT -8
Pagerman,
Have you installed Jason's fixes?
BP
|
|
|
Post by pagerman on May 8, 2021 16:33:14 GMT -8
Pagerman, Have you installed Jason's fixes? BP I have not. At this point I'm waiting for the new version of your software. I assume it'll be in that?
|
|
dow4hurst
Full Member
SkyWeather2 Newbie
Posts: 117
|
Post by dow4hurst on May 8, 2021 20:12:09 GMT -8
BP and Jason, I tried to put the changes into v25 and couldn't get the DustSensor code to work. The SkyWeather2.py kept dying on start. I don't think I have the try/except block edited in correctly. I restored that file back to the original code. The SDL_Pi_HM3301.py code change works fine with the modification, even though DustSensors.py is the original version.
I get this output in my SkyWeather2 log periodically:
HM3301 reading [69, 77, 0, 28, 0, 3, 0, 4, 0, 4, 0, 3, 0, 4, 0, 4, 3, 117, 0, 248, 0, 39, 0, 3, 0, 0, 0, 0, 0] Dow
|
|