Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By beic
#95510 Hi there,

While I trying to compile the mentioned example code from the link, I'm getting this error message:
'gmtime' was not declared in this scope

https://randomnerdtutorials.com/esp8266-nodemcu-date-time-ntp-client-server-arduino/

I'm using Arduino IDE v1.8.2 with ESP8266 Core v2.3.0

Is there any workaround or maybe a standalone function for gmtime?

Thank you for your time and support,

Kind regards,
Viktor
Last edited by beic on Fri Nov 11, 2022 10:50 am, edited 1 time in total.
User avatar
By beic
#95516
rooppoorali wrote:Please check the comment section of your shared tutorial. One person solved this error and explained the method. You can check that. Or have you already tried that options?


Unfortunately, no, if you meant for this line/comment:
#include “time.h” at beginning of the code. Than compilation is OK.

It wont compile, but I used a fork of the NTPClient library and added some additional code to it.
From this page: https://randomnerdtutorials.com/esp32-ntp-client-date-time-arduino-ide/

So, combined two different source and extended the code, and it's solved my issue.

Thanks for the suggestions! ;)