what's the best way to achieve a periodic timer, with deep sleep in between

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

what's the best way to achieve a periodic timer, with deep sleep in between

Postby trustmiao » Fri Jul 07, 2023 9:16 am

In the project, we plan to build a periodic timer to send a lora message, and sleep between the timer. For now our solution is record the time sending last message, start a timer after wakeup based on calculation of time difference. but there will couple us difference every time(4-10us), therefore the timer won't work accurately for long duration. What's the best way to achieve this ? Thank in advance.

trustmiao
Posts: 43
Joined: Mon Aug 06, 2018 5:16 am

Re: what's the best way to achieve a periodic timer, with deep sleep in between

Postby trustmiao » Fri Jul 07, 2023 9:26 am

one interesting finding is, every time eps32 deep sleeps, the "gettimeofday" though continuous to give time, but it will miss around 50ms , make two device time not synced.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], Majestic-12 [Bot] and 137 guests