Javascript Timing Events

  • Module Developer


    I don’t know if anyone else has been experiencing the same weird things that seem to be happening to a couple of my modules.
    In 2 modules, that used to work with no issue, they stopped updating. I checked them and one used setTimeout() while the other used setInterval() to refresh the data. These modules have been working for some time and all of a sudden they stopped. I reset my pi to see if that’d help, no luck. I apt-get update and rpi-update to see if that’d help. Didn’t help my issue. I’m running the latest non-develop build of MM.
    I tried some troubleshooting by using setInterval() with a 5 minute delay.
    I just had one of the faulty modules in my config.js so nothing else would mess with it.
    I had a counter that updated every time the function was supposed to run. It ran the first time, and never again. So I switched to setTimeout() with the same delay and counter. It runs 5-270 times randomly(random to me at least).
    I have a bunch of console.log()'s in my code to see if any part fails. Those never get triggered.

    So in summary, 2 of my 10 or so modules have started acting erratically with their timing events. SetInterval() stopped working for me all together, and setTimeout() stops updating at random times. The other modules I use all update fine with setTimeout().

    If anyone has seen this before and knows how to fix it, I’d be greatly appreciative. Thanks!

    P.S. I see the same freezes using MagicMirror’s built in browser as well as Chrome and Firefox from a separate computer.

  • @mochman I haven’t experienced something like this sorry

  • Moderator

    @mochman That sounds very strange. In which modules is this happening? In the default modules or in some of your own? E.g. does the clock still update every second?

  • Module Developer

    @Jopyth 1 is MMM-forecast-io and the other is one I made. Other modules I’ve made still update correctly as well as other default modules.

    If it becomes a pain to keep reloading the mirror, I’ll probably just wipe the drive and start over fresh.

  • Moderator

    @mochman Well, good luck, and let us know if you find anything.

  • Module Developer


    I added a “last updated at: XXXX” to the modules and now they both have updated correctly the past few days. Guess it was gremlins.

Log in to reply

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.