diff --git a/src/BufferExecute.cpp b/src/BufferExecute.cpp index 30bb9b85..7d1c88ef 100644 --- a/src/BufferExecute.cpp +++ b/src/BufferExecute.cpp @@ -86,7 +86,7 @@ void csvCmdExecute(String& cmdStr) { sCmd.addCommand(order.c_str(), bme280Temp); } else if (order == F("bme280-hum")) { - //sCmd.addCommand(order.c_str(), bme280Hum); + sCmd.addCommand(order.c_str(), bme280Hum); } else if (order == F("bme280-press")) { sCmd.addCommand(order.c_str(), bme280Press); diff --git a/src/items/vSensorDht.cpp b/src/items/vSensorDht.cpp index 2aa10f24..44920100 100644 --- a/src/items/vSensorDht.cpp +++ b/src/items/vSensorDht.cpp @@ -18,6 +18,7 @@ void SensorDht::tmpInit(const tmpParams& tmpSet) { dht = new DHTesp(); } dht->setup(_tmpSet.pin, DHTesp::DHT11); + _tmpSet.interval = dht->getMinimumSamplingPeriod() + _tmpSet.interval; } void SensorDht::humInit(const humParams& humSet) { @@ -26,6 +27,7 @@ void SensorDht::humInit(const humParams& humSet) { dht = new DHTesp(); } dht->setup(_tmpSet.pin, DHTesp::DHT11); + _tmpSet.interval = dht->getMinimumSamplingPeriod() + _tmpSet.interval; } void SensorDht::loopTmp() { @@ -49,10 +51,10 @@ void SensorDht::loopHum() { void SensorDht::readTmp() { float value; static int counter; - if (dht->getStatus() != 0 && counter < 5) { - counter++; - SerialPrint("E", "Sensor", "Disconnected"); - } else { + //if (dht->getStatus() != 0 && counter < 5) { + // counter++; + // SerialPrint("E", "Sensor", "Disconnected " + String(counter) + " " + dht->getStatusString()); + //} else { counter = 0; value = dht->getTemperature(); if (String(value) != "nan") { @@ -65,16 +67,16 @@ void SensorDht::readTmp() { } else { SerialPrint("E", "Sensor", "'" + _tmpSet.key + "' data: " + String(value)); } - } + //} } void SensorDht::readHum() { float value; static int counter; - if (dht->getStatus() != 0 && counter < 5) { - counter++; - SerialPrint("E", "Sensor", "Disconnected"); - } else { + //if (dht->getStatus() != 0 && counter < 5) { + // counter++; + // SerialPrint("E", "Sensor", "Disconnected " + String(counter) + " " + dht->getStatusString()); + //} else { counter = 0; value = dht->getHumidity(); if (String(value) != "nan") { @@ -87,7 +89,7 @@ void SensorDht::readHum() { } else { SerialPrint("E", "Sensor", "'" + _humSet.key + "' data: " + String(value)); } - } + //} } MySensorDhtVector* mySensorDht = nullptr;