Trigger sntp request manually
Posted: Thu Jan 02, 2020 10:10 pm
Basically, I want to create a clock that, at startup, tries to get the time over NTP, and if it fails it asks the user for the time. But I want it to periodically retry to get the time over NTP, every 15 minutes or so. In the beginning, I can call getLocalTime to get the time via NTP, but, if that fails, after setting the time supplied by the user with settimeofday, I can no longer trigger a NTP request, because getLocalTime() and esp-idf functions like time() get the time supplied by the user. After digging around in the esp-idf, i found the function sntp_request which I think would do what I want, but I can't call it because I can't find the sntp.c file that contains it in the arduino framework.