Comments on: ESP32 NTP Client-Server: Get Date and Time (Arduino IDE) https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 27 Jan 2025 18:49:10 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Sara Santos https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-1003192 Mon, 27 Jan 2025 18:49:10 +0000 https://randomnerdtutorials.com/?p=95109#comment-1003192 In reply to Dusan Djurisic.

Hi.
Please see the solution for this issue here: https://rntlab.com/question/solvedassert-failed-tcp_alloc-idf-components-lwip-lwip-src-core-tcp-c1851-required-to-lock-tcpip-core-functionality/
Regards,
Sara

]]>
By: Dusan Djurisic https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-991165 Fri, 13 Dec 2024 13:54:02 +0000 https://randomnerdtutorials.com/?p=95109#comment-991165 In reply to Domenico.

I have problem with ESP32 Client NTP
Error:
.
WiFi connected.

assert failed: sntp_setoperatingmode /IDF/components/lwip/lwip/src/apps/sntp/sntp.c:728 (Required to lock TCPIP core functionality!)

Backtrace: 0x40082549:0x3ffb2090 0x4008db75:0x3ffb20b0 0x40093d52:0x3ffb20d0 0x400e835f:0x3ffb2200 0x400d72ce:0x3ffb2220 0x400d27de:0x3ffb2240 0x400d86fa:0x3ffb2270 0x4008e7ee:0x3ffb2290

Help I need this.
Thanks!
Dule

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-987768 Sat, 30 Nov 2024 10:26:59 +0000 https://randomnerdtutorials.com/?p=95109#comment-987768 In reply to Alf Stockton.

Hi.
We have a similar tutorial for ESP8266: https://randomnerdtutorials.com/esp8266-nodemcu-date-time-ntp-client-server-arduino/
Regards,
Sara

]]>
By: Alf Stockton https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-987600 Fri, 29 Nov 2024 17:36:55 +0000 https://randomnerdtutorials.com/?p=95109#comment-987600 I would appreciate being able to run your code on a WeMos D1 that I found in my workshop. What alterations would you suggest?

]]>
By: Bryan Staines https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-978251 Wed, 30 Oct 2024 23:11:14 +0000 https://randomnerdtutorials.com/?p=95109#comment-978251 Hello
I have uploaded, on may occasions, the sketch for your “ESP332_time_date_ntp” project, and have it running now with some mods for ttemp & humidity. However today I tried to verify the code and it gives me the following error:
invalid conversion from ‘const char‘ to ‘char‘ [-fpermissive]

It has also highlighted line 52 “WiFi.begin(ssid,password);.
I have this line in other wifi connection sketches which verify fine, and are identical.
Any ideas please?

Thanks and regards, Bryan

]]>
By: Chaminda https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-961169 Tue, 24 Sep 2024 17:44:37 +0000 https://randomnerdtutorials.com/?p=95109#comment-961169 Is there a way to manually set the date as a backup when not connected to the internet?

]]>
By: Renzo https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-901716 Thu, 28 Mar 2024 16:56:27 +0000 https://randomnerdtutorials.com/?p=95109#comment-901716 Hi Sara,
you say: if you want to save the hour into a variable called timeHour, use this code

char timeWeekDay[10];
strftime(timeWeekDay,10, “%A”, &timeinfo);
Serial.println(timeWeekDay);
Serial.println();

but where put this code because I get only errors i.e redeclaration of ‘char timeWeekDay [10]’,
but there are not any declaration before

Thanks
Renzo

]]>
By: Dave Lowther https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-891497 Thu, 15 Feb 2024 10:48:30 +0000 https://randomnerdtutorials.com/?p=95109#comment-891497 In reply to Andrew.

Hi Andy,
Thanks for the info. I might try it sometime. I’ve not had to touch the code in the devices using NTP for over a year. If I need to modify them for some other reason I may include the suggested change to cater for daylight saving.

]]>
By: Andrew https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-889609 Fri, 09 Feb 2024 18:42:03 +0000 https://randomnerdtutorials.com/?p=95109#comment-889609 In reply to Dave Lowther.

Thanks Dave.
Googling a bit more I found this…
werner.rothschopf.net/microcontroller/202103_arduino_esp32_ntp_en.htm

It shows you how to set a ‘callback’ function which tells you when the ESP has syncd to NTP.

Ref your problem with GMT / BST try replacing your line in setenv(..) following GMT with GMT0BST,M3.5.0/1,M10.5.0.

Look here…. github.com/nayarsystems/posix_tz_db/blob/master/zones.csv

Andy

]]>
By: Dave Lowther https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/#comment-889529 Fri, 09 Feb 2024 13:31:58 +0000 https://randomnerdtutorials.com/?p=95109#comment-889529 In reply to Andrew.

I think it must sync automatically on the ESP32. I have a couple of always on ESP32 controlled devices in the house. I get the time from NTP in setup()

configTime(0, 0, ntpServer); // Can use 0,0 because using TZ below now
setenv(“TZ”,”GMTGMT-1,M3.4.0/01,M10.4.0/02″,1); // London
tzset();

Then they run for ever without any explicit calls from my code to sync with NTP. My code only calls NTP to get the time.

getLocalTime(&timeinfo)

Their time is always within a second if I check them against an atomic clock web page. I still haven’t worked out how to get the time to change when we change from GMT (no daylight saving) to BST (+1 hour). Both devices are permanently +1. That doesn’t bother me enough to spend more time on working out how to get it to work. Even if I had a good idea about how to fix it, I’d have to set up a local NTP server that I could use to switch daylight saving on and off to test it.

]]>