aqi
aqi copied to clipboard
Not sure which version
I'm not sure what sort of an issue this is, but, I'm trying to implement your AQI code on an SDS011 and have run into a problem.
Using the version of aqi.py that your command pulls from github, the script seems to start with no problem but, after about 15 readings, says it will sleep for one minute. The problem is that it never re-starts.
I see that this version, which is pulled using the command wget -O /home/pi/aqi.py https://raw.githubusercontent.com/zefanja/aqi/master/python/aqi.py
is somewhat different than the version that you show at your website: https://openschoolsolutions.org/measure-particulate-matter-with-a-raspberry-pi/
I can't tell whether the differences are significant or not, as my python experience is limited. However, if I comment out the last three lines of the github version, print("Going to sleep for 1 min...") cmd_set_sleep(1) time.sleep(60) then the device will continue to make measurements indefinitely.
One of the notable differences from the code that's at your web page above, is that in that code, the sleep time is 300 second, and, there is a command "cmd_set_mode(0)" that is not above.
print("Going to sleep for 5min...") cmd_set_mode(0); cmd_set_sleep() time.sleep(300) I've also tried that code and got an error indicating that there is a missing argument for the "cmd_set_sleep()" statement.
Note that this is completely fresh installation of raspian-lite on a new micro-sd card using a Rpi 3B+. All the instructions in your 2/28/18 writeup were followed.
HIya.
I deleted the entire section: print("Going to sleep for 1 min...") cmd_set_mode(0); cmd_set_sleep() time.sleep(60)
And now it runs constantly. I'm not sure if this is bad for the sensor or not, but I wouldn't have thought so.
Yes, deleting those lines makes it run constantly. However, the specs state that the lifetime is around 8000 hours. That's only about 1 year, so it may indeed shorten the life.