Imp not waking up properly

Since last night one of my imps has had erratic wakeup behaviour. It doesn’t wake up at the programmed interval, but randomly much later. Everything else seems to work ok. Anyone else seen behaviour like this? When I get time I will swap it with another imp that is on all the time to see if that fixes the problem.

Can you provide your code?

One thing to note is that your signal is borderline too strong, and you may be deafening your router. This could cause a failed join - if you’re running with the default connection semantics, it’ll try for 60s to get online but if it fails it’ll sleep for 9 minutes then try again. You may find things are more reliable with a bit more separation from the AP.

Thanks for replying Hugo. I moved my router about a month ago and it was very close, but I have had perfect operation until last night. I’ve now moved the imp about 12’ from the router so will see if things improve.

Can’t share my code right now but it is very basic- the wake up part is taken straight from the examples in the support docs.

Well, it’s been working perfectly since 18:00 UTC (now 22:30), which is odd because that’s before I moved it…

The idle function is:

imp.onidle(function() {
server.sleepfor(1 + WAKEINTERVAL_MIN * 60 - (time() % (WAKEINTERVAL_MIN * 60)));
});

where WAKEINTERVAL_MIN = 10.

-30dBm is pretty strong RSSI - did that go down when it was working ok? (as you log it on every wake)

The code looks right; may be worth using the connection manager class so you can do some offline logging and see what result codes intermediate connect attempts were reporting?

I’m getting about -45dBm now. Will check out the connection manager class- I don’t get much time to work on this project so hadn’t seen that before.