sntp library

Gilbert
Posts: 41
Joined: Wed Sep 16, 2020 2:58 pm

sntp library

Postby Gilbert » Fri Nov 08, 2024 4:24 pm

There are 2 versions of the sntp library in Arduino. I just re-installed the Arduino IDE (v 2.3.3) and the ESP libraries for Arduino.
I had the same problem using the previous version of the IDE.
The problem is the the sntp.h files have contradicing declarations for the function sntp_getoperatingmode(void). According to the ESP documentation I expect that esp_sntp_operatingmode_t sntp_getoperatingmode(void) in file "C:\Users\<username>\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-33fbade6\esp32\include\lwip\include\apps\esp_sntp.h"
is the correct version.
How can I fix this, i.e. make Arduino ignore the incorrect version located at "C:\Users\<username>\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-33fbade6\esp32\include\lwip\include\apps\esp_sntp.h"?
Or should I just delete the entire path?

aliarifat794
Posts: 196
Joined: Sun Jun 23, 2024 6:18 pm

Re: sntp library

Postby aliarifat794 » Sat Nov 09, 2024 11:09 am

If you're confident that the path "C:\Users\<username>\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-33fbade6\esp32\include\lwip\include\apps\esp_sntp.h" contains the incorrect sntp.h, you can rename or remove this file temporarily:
Rename it to something like sntp.h.bak.
This will make the IDE skip this path when looking for sntp.h files.

Gilbert
Posts: 41
Joined: Wed Sep 16, 2020 2:58 pm

Re: sntp library

Postby Gilbert » Sat Nov 09, 2024 3:55 pm

My bad. I made 2 mistakes:
1 - I selected the wrong board (Teensy iso ESP32)
2 - In my old code I inluded "lwip/apps/sntp.h". Found out that this lib is deprecated. Replacement is "esp_sntp.h".
Now my sketch compiles without errors.

Thanks for looking into this.

Who is online

Users browsing this forum: No registered users and 53 guests