Strange behaviour Date() and setSNTP on esp8266 #6432
Unanswered
espruino-discuss
asked this question in
ESP8266
Replies: 1 comment
-
Posted at 2021-03-09 by @MaBecker
Normal, because there is no real time clock (RTC). Try it this way:
Posted at 2021-03-09 by Svarog Hi MaBe, thank you for your answer. Uncaught Error: Cannot read property 'connect' of undefined Any idea why is this happening? Thanks 😊 Posted at 2021-03-09 by @MaBecker have a look at the first sample on Reference#Wifi Posted at 2021-03-09 by @MaBecker check the EspruinoESP8266 page too |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-03-08 by Svarog
I am trying to sync my esp8266 with NTP server, but I am running into a two problems.
The first one is that if I use setSNTP(sntpServer, timeOffset) method on require("Wifi")
I am getting error msg:
The second problem:
If I ditch the idea of using SNTP and just use Date(), when esp is connected I print time and it sometimes shows my local time, and sometimes UTC time. But, if I press reset button on the board, it set time to 01.01.1970.
What am I missing here?
Here is my code:
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions