News How to make a Raspberry Pi Home Air Quality Monitor

Jul 18, 2021
3
2
15
0
Hi!

Thanks so much for this guide! I am a complete newbie and found this very easy to follow.

I have followed the instructions as posted but can't make it run well.

When opening the browser to view the page, this is what appears:

This site can’t be reached
192.168.10.165 refused to connect.

then I get this from the Windows command prompt:

web_1 | Traceback (most recent call last):
web_1 | File "app.py", line 15, in <module>
web_1 | aqm = AirQualityMonitor()
web_1 | File "/code/AirQualityMonitor.py", line 13, in init
web_1 | self.sds = SDS011(port='/dev/ttyUSB0')
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 132, in init
web_1 | self.probe()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 139, in probe
web_1 | firmware_version_data = self.get_firmware_version()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 226, in get_firmware_version
web_1 | return self.request(cmd)
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 234, in request
web_1 | resp = self.rx_cmd_resp_queue.get(timeout=10)
web_1 | File "/usr/local/lib/python3.8/queue.py", line 178, in get
web_1 | raise Empty
web_1 | _queue.Empty

I am using an old Raspberry Pi (2011.12) and have installed the latest Raspbian OS.

I am hoping that you can help me out.
 
Reactions: NJAir
Jul 21, 2021
3
2
10
0
I'm having the same issue - currently running Raspberry Pi 3 (B+) - not headless. Can't navigate to IP address as per the last instruction in the tutorial. Sorry, I'm a noob! Any help would be appreciated. Would love to see the air quality readings!

Hi!

Thanks so much for this guide! I am a complete newbie and found this very easy to follow.

I have followed the instructions as posted but can't make it run well.

When opening the browser to view the page, this is what appears:

This site can’t be reached
192.168.10.165 refused to connect.

then I get this from the Windows command prompt:

web_1 | Traceback (most recent call last):
web_1 | File "app.py", line 15, in <module>
web_1 | aqm = AirQualityMonitor()
web_1 | File "/code/AirQualityMonitor.py", line 13, in init
web_1 | self.sds = SDS011(port='/dev/ttyUSB0')
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 132, in init
web_1 | self.probe()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 139, in probe
web_1 | firmware_version_data = self.get_firmware_version()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 226, in get_firmware_version
web_1 | return self.request(cmd)
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 234, in request
web_1 | resp = self.rx_cmd_resp_queue.get(timeout=10)
web_1 | File "/usr/local/lib/python3.8/queue.py", line 178, in get
web_1 | raise Empty
web_1 | _queue.Empty

I am using an old Raspberry Pi (2011.12) and have installed the latest Raspbian OS.

I am hoping that you can help me out.
 
Jul 21, 2021
3
2
10
0
Hi!

Thanks so much for this guide! I am a complete newbie and found this very easy to follow.

I have followed the instructions as posted but can't make it run well.

When opening the browser to view the page, this is what appears:

This site can’t be reached
192.168.10.165 refused to connect.

then I get this from the Windows command prompt:

web_1 | Traceback (most recent call last):
web_1 | File "app.py", line 15, in <module>
web_1 | aqm = AirQualityMonitor()
web_1 | File "/code/AirQualityMonitor.py", line 13, in init
web_1 | self.sds = SDS011(port='/dev/ttyUSB0')
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 132, in init
web_1 | self.probe()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 139, in probe
web_1 | firmware_version_data = self.get_firmware_version()
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 226, in get_firmware_version
web_1 | return self.request(cmd)
web_1 | File "/usr/local/lib/python3.8/site-packages/sds011/sds011.py", line 234, in request
web_1 | resp = self.rx_cmd_resp_queue.get(timeout=10)
web_1 | File "/usr/local/lib/python3.8/queue.py", line 178, in get
web_1 | raise Empty
web_1 | _queue.Empty

I am using an old Raspberry Pi (2011.12) and have installed the latest Raspbian OS.

I am hoping that you can help me out.

I figured it out - this is an issue that was discussed on Github: https://github.com/rydercalmdown/pi_air_quality_monitor/issues

You have to change the code in a file called "index" to point to your pi's IP address (or removed the IP address entirely and use /api/ instead - that worked for me).

Also, you have to close and restart the script ("make run") a couple of times before it runs correctly.

Eventually this will all work, and you'll be able to navigate to your pi's IP address (port 8000) to see the data.
 
Reactions: Psyrick
Jul 18, 2021
3
2
15
0
I figured it out - this is an issue that was discussed on Github: https://github.com/rydercalmdown/pi_air_quality_monitor/issues

You have to change the code in a file called "index" to point to your pi's IP address (or removed the IP address entirely and use /api/ instead - that worked for me).

Also, you have to close and restart the script ("make run") a couple of times before it runs correctly.

Eventually this will all work, and you'll be able to navigate to your pi's IP address (port 8000) to see the data.
Glad that worked out for you. I have done those indicated at the link but I am still having the same errors as before... Decided to just try running different code instead - apparently plenty available in other sites.

I hope that the people who decided to post this tried to run the code first though 🤷‍♂️
 
Reactions: NJAir
Jul 21, 2021
3
2
10
0
Glad that worked out for you. I have done those indicated at the link but I am still having the same errors as before... Decided to just try running different code instead - apparently plenty available in other sites.

I hope that the people who decided to post this tried to run the code first though 🤷‍♂️
Yes - plenty available elsewhere. Just finished one version using Adafruit IO and it was relatively trouble free. Enjoying putting these things together!
 
Reactions: Psyrick
Jul 18, 2021
3
2
15
0
Are you talking about the one from the Raspberry Pi Blog? Yeah, that does look good. Would you mind sharing where I can learn how use Adafruit? I am a total beginner at this and have no idea how to setup Adafruit...
 

ASK THE COMMUNITY