Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure which version #9

Open
dwkisker opened this issue Sep 16, 2019 · 2 comments
Open

Not sure which version #9

dwkisker opened this issue Sep 16, 2019 · 2 comments

Comments

@dwkisker
Copy link

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.

@thaipirate
Copy link

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.

@dwkisker
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants