enesbcs / rpieasy

Easy MultiSensor device based on Raspberry PI
GNU General Public License v3.0
159 stars 33 forks source link

Has anyone written a driver for SDS011 #221

Closed BNNorman closed 3 years ago

BNNorman commented 3 years ago

I like this a lot - it follows closely the Arduino ESPEasy structure - which I have running on several devices.

One omission from the particle devices is the SDS011 which is popular amongst the group I work with (check sensors.connectedhumber.org/app).

I have started by trying to modify the PMS7xxx driver - changing the device to P054 (since the ESPEasy uses that ID) and the name from pms to sds. Next step is to marry up the serial data to the SDS011 then test it.

Are there any tutorials for creating new device drivers that I can read first before I get my first migraine?

Thanks.

tonhuisman commented 3 years ago

AFAICS the SDS01x sensors are supported by P053, that supports many of those type of sensors.

Edit: sensortypes = ["PMSx003","PMS3003","PMS5003S","PMS5003ST","PMS5003T","SDS01x","SDS198","HPMA115S0","HPMA115C0","SPS30","MCU680"]

BNNorman commented 3 years ago

Really?

The SDS & PMS sensors serial data frames have different formats. Also, the sensor control commands will be different . If you don't mind the sensor being permanently on - although being attached to a Pi that's not a big issue - but longevity of the sensor can be extended by putting it to sleep until needed. Our sensors transmit data once every 6 minutes to our database so we sleep the sensor till it is time to sample and send data. This was easily done in ESPEasy and the sensors are still working 18 months later.

I installed RPIEasy on a zero but haven't played with it much so maybe I should.

I'll connect an SDS011 to the zero and see how it fares. Will let you know.

Would be handy to know how to create a sensor driver anyway.

Thank you for your response.

BNNorman commented 3 years ago

Just seen your edit - many thanks.

bsimmo commented 3 years ago

Yep, that driver needs a better name or some aliases setting up and the 680 taking out. Not intuitive , especially if you come from ESPeasy.

It also does not know the capability of the device and just lists everything any of the set of devices might read.

There is no on/off/timer feature either.

But it reads PM2. 5 and PM10 when setup OK.

BNNorman commented 3 years ago

Ben, thanks for your extensive investigation , you beat me to it - perhaps the GPS missing data needs reporting as an issue. Did you have the SDS on as well (two serials?) or maybe the zero can't cope.

I'll have to investigate pypms...

BNNorman commented 3 years ago

I can see that the limitations of pypms restrict what can be done in RPIEasy.

So, one last suggestion - change the PMSx003 sensor name to something more generic - my first reaction was that it was for plantower only.

bsimmo commented 3 years ago

It on GPIO pins with my setup, I've not tried USB GPS issue opened.

On Mon, 8 Mar 2021, 3:27 pm Brian, notifications@github.com wrote:

Ben, thanks for your extensive investigation , you beat me to it - perhaps the GPS missing data needs reporting as an issue. Did you have the SDS on as well (two serials?) or maybe the zero can't cope.

I'll have to investigate pypms...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/enesbcs/rpieasy/issues/221#issuecomment-792830867, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN7RFJLCIWPIOMDGYLDTCTUFDANCNFSM4YZHOEBA .