I have a project in which I have 2 battery powered ESP32s. I want them to sleep most of the time, so their wifi modems will be powered off during these periods. I need a good strategy to determine when to send the ESP NOW messages so that the receiver's modem will be ON. (either can send messages at anytime).
Since both have an RTC, I was thinking about setting a rendez-vous time every 1 or 2 minutes to power the modems at the same time and exchange data. I am not sure if this will work, and I wanted to know if anyone had a better strategy?
Yeah, I thought about being almost always asleep and checking if something changed before sleeping again. Your method means I would need to sustain wake up for at least a few tens of milliseconds? then I guess it wouldn't be too bad for the battery actually.
I do have onboard RTCs, I am just scared they would somehow be a little off, or drift. I guess if I do a 2 sec timeframe every minute, chances are this effect wouldnt affect functionality?
Now, I still feel like the RTC sync strategy may be better actually.. Maybe every time seconds hit 0 or something, an interrupt is triggered from the RTC of both devices, and they start communicating if need be. Then they'd go back to sleep a few seconds later.
Since you don't want the time it takes to log on to WiFi every time you wake, have you considered a third unit that is always on? It could act as the switchboard between the sleeping units.