Upper Limit of imp.wakeup() Timer

I hit a problem a few minutes ago while testing imp.wakeup.

I passed imp.wakeup an integer, representing roughly one month in seconds.

Setting up a timer to trigger at one month or greater seems to end up triggering immediately.

This resulted in my code generating thousands of posted messages in the space of a few minutes (before being throttled by your services). I realise that there must be an upper limit, but it’s not clear from the documentation. An integer value in the low millions can still be represented by a 32bit float as far as I can see.

Internally it’s converted 32-bit signed centisecond value which is an offset referenced to the centisecond timer that starts when the imp is powered up; by my calculations, that should be ~248 days, though.

Peter probably has a more exact comment :slight_smile:

Right, imp.wakeup should be fine up to about 2^31 centiseconds or 248 days. The “deep sleep” calls such as imp.deepsleepfor are capped at 28 days, but in a way that should saturate, not wrap around. What specific largeish integer were you using?

Peter