From 4a2f245d85b8a015a3c553bd8dddda0baa2dcd4b Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Mon, 18 Jun 2018 23:36:03 +0200 Subject: [PATCH] SDS011 query mode --- platformio.ini | 5 +++-- src/main.cpp | 4 ++-- src/main.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 8939ae8..e0e79cf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,7 +17,7 @@ board_build.f_cpu = 80000000L board_build.f_flash = 40000000L build_flags = - -DUSERDEBUG +; -DUSERDEBUG ; -DDEBUG_ESP_PORT=Serial ; -DDEBUG ; -DDEBUG_ESP_SSL @@ -30,7 +30,8 @@ lib_deps = Adafruit BMP085 Library DHT sensor library ; SDS011 sensor Library - https://github.com/Zanop/SDS011.git#more-sensor-modes +; https://github.com/Zanop/SDS011.git#more-sensor-modes + https://github.com/h3ndrik/SDS011.git#more-sensor-modes EspSoftwareSerial RunningAverage MQTT diff --git a/src/main.cpp b/src/main.cpp index dad92b0..0362310 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,13 +155,12 @@ void ICACHE_FLASH_ATTR sendValues() { sd.voltage = analogRead(A0)*0.04285078 -0.05942125; // by linear regression for my(!) voltage divider. else: sd.voltage = analogRead(A0)*3.3*(R1+R2)/(R2*1024) #endif - int sds_error = sds.read(&(sd.p25), &(sd.p10)); + int sds_error = sds.query(&(sd.p25), &(sd.p10)); if(!sds_error) { // DEBUG_MSG("SDS011 updated.\n"); } else { // DEBUG_MSG("SDS011 no new values.\n"); } - // sds.sleep(); if (rtcMillis() - geiger_previousMillis > 10000) { @@ -387,6 +386,7 @@ void setup() { sds.begin(SDS_TX, SDS_RX); sds.mode_mon_300(); + sds.mode_query(); Wire.begin(BMP_SDA, BMP_SCL); if (!bmp.begin(BMP085_MODE_STANDARD)) { diff --git a/src/main.h b/src/main.h index 8981df7..4a1da98 100644 --- a/src/main.h +++ b/src/main.h @@ -7,6 +7,6 @@ #define DEBUG_MSG(...) #endif -#define FW_VERSION 15 +#define FW_VERSION 17 #endif /* _MAIN_H */