Skip to content

Commit

Permalink
Fix handling of short intervals with SDS011 (Fixes opendata-stuttgart…
Browse files Browse the repository at this point in the history
…#426)

Just never stop the sensor if the interval is too short.
This is better than what it did so far, always stop it and
never start it (leading to no measurements)
  • Loading branch information
dirkmueller committed Jan 4, 2020
1 parent 41d75d6 commit 10b3208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airrohr-firmware/airrohr-firmware.ino
Expand Up @@ -2798,7 +2798,8 @@ static void fetchSensorSDS(String& s) {

debug_outln_verbose(FPSTR(DBG_TXT_START_READING), FPSTR(SENSORS_SDS011));

if (msSince(starttime) < (cfg::sending_intervall_ms - (WARMUPTIME_SDS_MS + READINGTIME_SDS_MS))) {
if (cfg::sending_intervall_ms > (WARMUPTIME_SDS_MS + READINGTIME_SDS_MS) &&
msSince(starttime) < (cfg::sending_intervall_ms - (WARMUPTIME_SDS_MS + READINGTIME_SDS_MS))) {
if (is_SDS_running) {
is_SDS_running = SDS_cmd(PmSensorCmd::Stop);
}
Expand Down

0 comments on commit 10b3208

Please sign in to comment.