[P056] Fixed bug when SDS sensor is not reporting

Fixed bug that makes the sensor not reporting values even when everything is well connected.
The problem is that the Sensor is in "Query reporting" mode, and therefore it is not actively sending values.
The fix consist of setting the Sensor in "Active reporting" (command 2,1,0), when setting the working during configuration.
This commit is contained in:
fcauwe
2020-11-15 10:51:22 +01:00
committed by GitHub
parent f7b11edf88
commit 2bcad48eab
+3
View File
@@ -94,6 +94,9 @@ void CjkSDS011::SetWorkingPeriod(int minutes) {
const int currentWorkingPeriod = GetWorkingPeriod();
if (minutes != currentWorkingPeriod)
SendCommand(8, 1, minutes);
// In some cases the Sensor is set to "report query"-mode, this makes sure to set active reporting of values, otherwise the sensor won't work.
Process();
SendCommand(2, 1, 0);
}
int CjkSDS011::GetWorkingPeriod() {