Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By OliverNZ
#30072 Hi,

So, trying my 1st go at the Ticker. Basically want to read temp sensor every 180 seconds and send it to a website. Works like a charm for about 2hrs and then just stops. Other functions on the module are fine. Haven't looked at the variable value (tickerTriggered) at that point yet. Will do that tonight. But maybe there's some limitations of the Ticker that I am missing here. If all else fails I can still do something with millisecs() in the loop but Ticker should be the thing to use I guess.

Cheers!
Oliver

Code looks like this:
Code: Select allTicker tickerClick;
boolen tickerTriggered = false;


....

void tickerTrigger() {
   tickerTriggered = true;
}

void callTemp() {
  ...
  tickerTriggered = false;
}

void setup() {
  ...
  tickerSetHigh.attach(180, tickerTrigger);
  ...
}
...
void loop() {
  if (triggerTriggered == true) { callTemp(); }
  ...
}


User avatar
By OliverNZ
#30691 Ok, reprogrammed this and it's defo not the ESP/Ticker. It is some weirdness with the Dallas DS18B20. It works for a few calls and then starts reporting the same temp over and over and after 2hrs it just goes on the blink completely. The odd thing is I have the SAME routine as an interactive HTTP call to the module now and that works like a charm. So far no issues. So WTH is going on???? Anyone ever seen that?
User avatar
By xtal
#30710 Is this a DS18B20P or DS18B20+
The P means parasitic and requires a minimum of 750 millisec after recieving the convert command
x44 which is probably imbedded in the function.

You get strange stuff if you do not wait long enough [ the parasitic voltage must recover]
+ means power externally supplied, hence 3 wires....
You can run the + as a P [ tie gnd to vcc ] if I remember correctly :mrgreen: