setInterval not working on Raspberry Pi.
A number of people are observing that setInterval is not working for large intervals on the Raspberry Pi.
The following code:
setInterval (function () {
console.log("Tick: ");
}, 1000 * 60 * 30);
Never produces any output for example. (It does work for a 1 minute interval, changing the 30 to a 1 say)
This issue does seem to come and go, some report never seeing it. It's under discussion here: https://www.raspberrypi.org/forums/viewtopic.php?f=34&t=128624
Node version v5.2.0
Operating system: Raspbian Jessie.
This is still an issue in Node 6.9.3 on RPi. Will also try the patch.
Oh yeah, forgot about this. Took my Raspberry Pi 3 days to build Node from source and eventually threw some errors when I tried to run my app, so couldn't test this. Should try to run the test script, but currently no time. Works with the keep-alive interval that triggers console output every ±10 minutes which is ok enough for me at the moment.
Facing the same issue on Raspberry PI 3. Yes, the only work-around so far is having keep-alive interval.
setInterval(fn, 30 * 60 * 1000); // your actual interval
setInterval(() => {}, 10 * 60 * 1000) // keep-alive interval
Can someone with access to a Raspberry Pi confirm this is still a problem with Node.js 8.x?
Cannot reproduce on RPi3, latest Arch Linux ARM, Kernel 4.9.36, node v8.2.1:
$ node -e 'setInterval (function () { console.log("Tick: "); }, 1000 * 60 * 30);'
Tick:
Tick:
@silverwind can you confirm it fails with v5.2.0 (i.e. negative control)? If it does IMHO we can close this.
Although the code @bnoordhuis is pointing to hasn't changed since v2.30 https://github.com/nodejs/node/pull/1889/files#diff-c2053e03dec17e31a49b19d166265122
Yep, fails with 5.2.0. I think we can safely assume this is fixed.
To confirm. This bug is certainly fixed for node v8.1.2 running on Raspbian GNU/Linux 8 on Raspbery Pi 3.