mysensors / NodeManager

Plugin for a rapid development of battery-powered sensors
130 stars 82 forks source link

fix some compile errors. #524

Closed arcayi closed 4 years ago

arcayi commented 4 years ago

fix some compile errors.

user2684 commented 4 years ago

Thanks for the contribution! Just a question on the renamed nm_timer_mode. Is it because is conflicting with a timer_mode defined by some specific board right?

arcayi commented 4 years ago

Yes. It happened when I setup stm32f103c8t6 bluepill borad using board definition as the link http://dan.drown.org/stm32duino/package_STM32duino_index.json. That board definition may be based on maple platform definition, where timer_mode had been defined.

user2684 commented 4 years ago

Thanks, just merged

pdalak commented 3 years ago

Hello,

I think this edit of SensorDHT.h is not correct.

You commented out line this line: //_dht->readSensor(true); in onLoop() routine. Without this command sleeping node will not read values correctly, because millis() doesn't increase during sleeping, so the condition in DHT library (DHT.cpp)

unsigned long startTime = millis();
if ( !force && (unsigned long)(startTime - lastReadTime) < (model == DHT11 ? 999L : 1999L) ) {
    return;
  }
lastReadTime = startTime;

will not be met a lot of times! For example, if node is sleeping 5minutes, and execution of code is 500ms, only every 4th measuremenet will be valid (4x500ms > 2000L for DHT22)

I had to uncomment this line, to make my sensor work correctly.

Peter.

user2684 commented 3 years ago

Thanks! Just opened #527 for this