DEV Community

Discussion on: Raspberry Pi PM2.5/10 Air Quality Monitor

 
jeikabu profile image
jeikabu

It's the same as the link in the post:
raspberrypi.org/documentation/conf...

raspi-config is probably TUI and can be used in a terminal.

Thread Thread
 
halfshavedyaks profile image
halfshavedyaks

OK thanks, now I understand what you are suggesting. I will try using raspi-config

can you tell me anything about the seeming conflict with the sensor and the console both apparently using the primary uart? how does that work?

Thread Thread
 
halfshavedyaks profile image
halfshavedyaks

I tried using raspi-config with the same results - it will read the sensor and it will communicate over ssh in the terminal, but not both at once - if any communication with the pi (including reading web page from lightpd) happens while the sensor is being read then communications break and I get a broken pipe.

Thread Thread
 
halfshavedyaks profile image
halfshavedyaks

maybe it is unrelated - hard for me to tell. but when I connect to the SD011 over usb I have no problems with the ssh connection, or at least far less often.

Thread Thread
 
jeikabu profile image
jeikabu

I don't recall having issues with SSH, but I don't remember if I was using wifi or ethernet.
Perhaps it's related to using a Pi0, I was using a Pi3.

Thread Thread
 
randyrue profile image
Randy Rue

I'm also trying to do this with an SDS011 and a pi xero w but can't get the sensor to detect via USB when I plug it in. I thought the pi might not have enough power for the sensor board as when I unplug and replug the sensor USB adapter the pi reboots, but have the same problem when I plug the sensor in via a powered USB hub with a 3A supply.

In either case I don't get any device at /dev/tty/USB0 and there's nothing in dmesg about it.

When I plug the sensor board into a linux laptop I see it in dmesg and at /dev/tty/USB0 so I'm thinking there's nothing wrong with the sensor.

Will hope to hear from you if you have any guidance and will look into connecting the UART directly in the meantime.

Thanks,

Randy in Seattle

Thread Thread
 
jeikabu profile image
jeikabu

I didn't personally try a Pi0, but I'd expect it to work. Did you follow the latest uart instructions?
Try it with another device, although unlikely it's possible your Pi0 is defective.

Thread Thread
 
randyrue profile image
Randy Rue • Edited

I have it working.

I connected directly via the serial GPIO header and disabled console output to S0 and it now works if I set the code to look to /dev/tty/S0

But it still rebooted the pi if I put the SDS011 to sleep and then woke it up, even if I connected the pi to a benchtop 5V power supply.

Finally I separated the power/ground traces of the UART ribbon cable and hacked my micro USB cable so it powers both the pi and also directly powers the SDS011. Now it detects, returns data, and the pi survives a sleep/wake cycle without rebooting.

Next I'm adding a DHT22 temp/humidity sensor and a BMP180 barometric pressure sensor so i can have a more complete "weather" station. I've installed grafana and will create a simple dashboard with the metrics available in a web interface.

Then comes four wheel drive, heated seats and a popcorn machine :)