|
Post by Jason on Apr 22, 2021 4:38:33 GMT -8
My dust sensor has been very interesting since I started using it as part of my SkyWeather2 kit. I noticed early on that there would be large gaps between successful readings of the dust sensor on my kit. As a result, I started counting. Based on the current apscheduler settings in the SkyWeather2.py script, the dust sensor should be sampled and read 120 per day. As it stands right now, I have counted 2,627 attempts at sampling and reading by the dust sensor so I've been counting for almost 22 days. Of those attempts, I have logged 343 successful readings or about a 13% success rate. Is this normal behavior?
Thanks,
Jason
|
|
|
Post by SDL on Apr 22, 2021 15:16:44 GMT -8
Jason,
Do you have the LASER dust sensor connected to your SkyWeather2 or to the WeatherSense remote detector?
What Raspberry Pi are you using?
Does it always show 0 when you don't get a reading?
BP
|
|
|
Post by Jason on Apr 22, 2021 16:08:19 GMT -8
I’m running my SkyWeather2 on a RPi 3B+. I see two exits from my read_AQI call: the most common is a checksum that is not true and a less common error is a index out of range that occurs in the parse_data class function.
Thanks,
Jason
|
|
|
Post by Jason on Apr 23, 2021 5:51:31 GMT -8
More specifically, in DustSensor.py, the line (which is potentially called twice)
myData = hm3301.get_data() generates the IndexError in the parse_data class function at the line
self.PM_1_0_conctrt_std = data[4]<<8 | data[5] As a result, I added a try/except in order to trap the error.
Additionally, in DustSensor.py, the line
if (hm3301.checksum() != True): is where the script exits most frequently.
What I haven't been able to determine yet is whether the first get_data() call or the second get_data() call in DustSensor.py is causing the IndexError mentioned above.
Thanks,
Jason
|
|
|
Post by SDL on Apr 23, 2021 11:34:57 GMT -8
Thanks! I've added this on the bug list to evaluate the dust sensor error detection.
BP
|
|
|
Post by Jason on May 4, 2021 5:43:25 GMT -8
Picked up another error this morning that I've not seen before. The following statement found in the function get_aqi in SDL_Pi_HM3301/SDL_Pi_HM3301.py:
myaqi = aqi.to_aqi([ (aqi.POLLUTANT_PM25, self.PM_2_5_conctrt_std), (aqi.POLLUTANT_PM10, self.PM_10_conctrt_std) ]) produced the following error:
aqi _iaqi = self.iaqi(elem, cc) File "./SDL_Pi_HM3301/aqi/algos/base.py", line 91, in iaqi (aqilo, aqihi) = self.piecewise['aqi'][idx] IndexError: list index out of range Job "read_AQI (trigger: interval[0:12:00], next run at: 2021-05-02 15:55:41 EDT)" raised an exception Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) File "/var/pyapps/SDL_Pi_SkyWeather2/DustSensor.py", line 107, in read_AQI myAQI = hm3301.get_aqi() File "./SDL_Pi_HM3301/SDL_Pi_HM3301.py", line 117, in get_aqi (aqi.POLLUTANT_PM10, self.PM_10_conctrt_std) File "./SDL_Pi_HM3301/aqi/__init__.py", line 45, in to_aqi return _aqi.aqi(ccs) File "./SDL_Pi_HM3301/aqi/algos/base.py", line 36, in aqi _iaqi = self.iaqi(elem, cc) File "./SDL_Pi_HM3301/aqi/algos/base.py", line 91, in iaqi (aqilo, aqihi) = self.piecewise['aqi'][idx] IndexError: list index out of range
Thanks,
Jason
|
|
|
Post by SDL on May 4, 2021 10:53:35 GMT -8
Yepsters! It's a failure of the read of the data. In this bug:
OPEN - 042321-01 - V025 - Evaluate Laser Dust Sensor error exits hm3301
BP
|
|
|
Post by Jason on Jun 21, 2021 6:59:44 GMT -8
What could an increased frequency of checksum errors mean for a wired dust sensor?
Thanks,
Jason
|
|
|
Post by SDL on Jun 21, 2021 10:25:27 GMT -8
I would *guess* it needs to be cleaned. But I'm only guessing.
Does a power off/power on change the frequency of failures?
That could indicate a problem with the onboard computer.
BP
|
|
|
Post by Jason on Jun 21, 2021 10:39:50 GMT -8
I'll blast some air through there and see if that helps. I've power cycled several times and what I've noticed mostly is that the first reading after the power cycle is good and then reading becomes spotty.
Thanks,
Jason
|
|
dow4hurst
Full Member
SkyWeather2 Newbie
Posts: 117
|
Post by dow4hurst on Jun 21, 2021 19:32:21 GMT -8
I remember BP saying something about how it has to warm up. Maybe it only gives the first reading because it is cold. Since it has to measure particulate, it is bound to get dust, bugs, and who knows what in it over time. I've wondered about gusts of wind blowing water into the compartment. I haven't taken one apart, so I just have an opinion right now... Dow
|
|