You are reading a single comment by @Sacha and its replies. Click here to read the full conversation.
  • Hi Gordon

    I still have some problems with my pico farm, connected over an xbee mesh.
    Problem: setInterval is not called anymore.

    I first had the impression that it was the psu. That's not the case.
    I broadcast the time every 5 minutes from my Linux server over xbee and set the time on the picos using setTime();

    In fact, my setInterval is called often before the first setTime() was executed.

    I commented the setTime() function out on my test pico. The problem is gone.
    I tried to isolate it to reproduce the problem. At the moment i was not able to reproduce a stop of calling the setInterval function. But this code shows that setInterval and maybe setTimeout is not setTime proof/aware.

    Try this code: It should be called every 30 Seconds

    console.log('Hello Espruinos');
    console.log(getTime());
    console.log('Setting up setInterval');
    setInterval(function() { console.log('Called:'+getTime()); }, 30000);

    setTime(467835036);

    The setInterval function is called rapidly as fast as possible.

    I need a way to use setInterval in parallel of using setTime. A work around could be to clear the intervals before calling setTime and start it again. But this is not so handy. Because my code is very object oriented. It not easy to handle that. Is there another work around ?

    Thanks for your help.

    Sacha

    Greatings

    Sacha

About

Avatar for Sacha @Sacha started