DEV Community

Raspberry Pi PM2.5/10 Air Quality Monitor

jeikabu on March 25, 2019

I live and work in Shanghai. We talk about the Air Quality Index (AQI) like people in other places talk about the weather (incidentally, we talk ab...
Collapse
 
halfshavedyaks profile image
halfshavedyaks

doing this as suggested:

Remove console=serial0,115200

seems to break my ssh connection to the pi - it becomes unreliable and gives me broken pipe errors when the SDS011 is active.

does the ssh need that setting? can the SDS011 be connected to the pi on the pins and still allow ssh in some way?

Collapse
 
jeikabu profile image
jeikabu

I don’t recall it breaking ssh.

The official pi docs still have that in “manual” instructions. You can see if the GUI tool does something else:

sudo raspi-config

Select option 5, Interfacing options, then option P6, Serial, and select No. Exit raspi-config.

Collapse
 
halfshavedyaks profile image
halfshavedyaks

I am using a pi zero W headless and ssh over wifi on the lan - could the ssh setup therefore be different from yours?

I can't use the gui tool as I set up the pi without a desktop.

it is hard to tell since the broken pipe events seem to be slightly random, and they don't show an error straight away. but I think the problem arises when I try to do something over ssh while the pi is communicating with the sensor.

can you share a link to the manual instructions you mention?

I confess I didn't know what a uart is until yesterday- but in this doc here:

raspberrypi.org/documentation/conf...

it says "The primary UART is the one assigned to the Linux console, which depends on the Raspberry Pi model as described above. There are also symlinks: /dev/serial0, which always refers to the primary UART"

is the linux console referred to in that quote the same as the terminal in which I am connecting over ssh? If so it suggests a conflict.

Thread Thread
 
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.