Read the statement by Michael Teeuw here.
Javascript Timing Events
-
Gals/Guys,
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 usedsetTimeout()
while the other usedsetInterval()
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. Iapt-get update
andrpi-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 usingsetInterval()
with a 5 minute delay.
I just had one of the faulty modules in myconfig.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 tosetTimeout()
with the same delay and counter. It runs 5-270 times randomly(random to me at least).
I have a bunch ofconsole.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, andsetTimeout()
stops updating at random times. The other modules I use all update fine withsetTimeout()
.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
-
@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?
-
@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.
-
@mochman Well, good luck, and let us know if you find anything.
-
Thanks.
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.