openenergymonitor / EmonESP

ESP8266 WIFI serial to emoncms link
160 stars 78 forks source link

Time is wrong... #90

Closed FredM67 closed 2 years ago

FredM67 commented 2 years ago

I've added a line to print the current time on serial, line 141 of src.ino (just before Free memory output). On the first call, I get allways a time around 18:12... on subsequent call, I get something else which is totally wrong !!! Here's the log: WiFi dissconnected: WIFI_DISCONNECT_REASON_ASSOC_FAIL Connected to Freebox-VFA Time now: 18:12:40 Free memory 31160 - diff 672 672 Connected, IP: 192.168.1.163 Time now: 09:25:43 Free memory 29288 - diff 1872 2544 Time now: 09:25:45 Free memory 29952 - diff -664 1880

When trying the esp-built-in time (see https://github.com/esp8266/Arduino/blob/61cd8d83859524db0066a647de3de3f6a0039bb2/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino), I get the right time using the time() function.

FredM67 commented 2 years ago

I cannot reproduce the problem anymore !