ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
344
stars
93
forks
source link
WDT Reset when multiple setTimeZone() calls time out #142
Thanks for the awesome module. It's been working great, until I added the ability for the user to change the timezone. It doesn't seem to change timezones, debug is showing "ERROR: Timeout" even though the calls are 10-30s apart.
Below is the log of my WDT Reset happening. The stack trace is a little complex for me to follow, so I'm not entirely sure it's with this module, but I have to start somewhere. :)
I have the timezone hard coded, so that's why it says "setting new timezone..." to something that doesn't match the "Timezone lookup for:..."
Code snippet:
Serial.print(F("Setting new time zone to: "));Serial.println( someTherm->timeZone[ someTherm->timeZone_get() ].c_str() );
myTZ.setLocation( F("America/Chicago") );waitForSync();Serial.println(F("Setting new time zone DONE"));Serial.println( myTZ.dateTime() );
--- Miniterm on COM3 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
WebSocket client #1 disconnected
WebSocket client #2 connected from 192.168.86.27
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":3}}
trying it as JSON
json value: 3
Setting new time zone to: America/New_York
Timezone lookup for: America/Chicago ... ERROR: Timeout
Setting new time zone DONE
Sunday, 13-Feb-2022 18:29:14 PST
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":2}}
trying it as JSON
json value: 2
Setting new time zone to: America/Chicago
Timezone lookup for: America/Chicago ... ERROR: Timeout
Setting new time zone DONE
Sunday, 13-Feb-2022 18:29:24 PST
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":0}}
trying it as JSON
json value: 0
Setting new time zone to: America/Los_Angeles
Timezone lookup for: America/Chicago ... ERROR: Timeout
Setting new time zone DONE
Sunday, 13-Feb-2022 18:29:41 PST
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":1}}
trying it as JSON
json value: 1
Setting new time zone to: America/Denver
Timezone lookup for: America/Chicago ... ERROR: Timeout
Setting new time zone DONE
Sunday, 13-Feb-2022 18:30:04 PST
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":1}}
trying it as JSON
json value: 1
Setting new time zone to: America/Denver
Timezone lookup for: America/Chicago ... ERROR: Timeout
Setting new time zone DONE
Sunday, 13-Feb-2022 18:30:11 PST
WebSocket client #2 disconnected
WebSocket client #3 connected from 192.168.86.27
Got Data from WebSocket
sendSettings
Got Data from WebSocket
{"settings":{"fanDelay":"120","compressorMaxRuntime":"18000","compressorOffDelay":"300","timeZone":2}}
trying it as JSON
json value: 2
Setting new time zone to: America/Chicago
Timezone lookup for: America/Chicago ...
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
0x4021c4e9 in delay at ??:?
0x4020c482 in WiFiUDP::parsePacket() at ??:?
0x4020759a in Timezone::setLocation(String) at ??:?
0x402213bc in SPIClass::endTransaction() at ??:?
0x40208ed6 in _ZN18ArduinoJson6185_9116JsonDeserializerINS_6ReaderIPhvEENS_11StringMoverEE12parseVariantINS_14AllowAllFilterEEEbRNS_11VariantDataET_NS_12NestingLimitE$isra$0 at main.cpp:?
0x402681c4 in etharp_output at ??:?
0x402681c4 in etharp_output at ??:?
0x4021a638 in String::copy(FlashStringHelper const, unsigned int) at ??:?
0x4021a800 in String::operator=(__FlashStringHelper const) at ??:?
0x40209e84 in handleWebSocketMessage(void, unsigned char, unsigned int) at ??:?
0x40214c20 in esp8266::MDNSImplementation::MDNSResponder::_parseQuery(esp8266::MDNSImplementation::MDNSResponder::stcMDNS_MsgHeader const&) at ??:?
0x401048fa in lmacRecycleMPDU at ??:?
0x4022a4e1 in glue2esp_linkoutput at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c:301
0x40104bb9 in lmacRecycleMPDU at ??:?
0x4022a70f in new_linkoutput at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-lwip/lwip-git.c:268
0x40209f62 in onEvent(AsyncWebSocket, AsyncWebSocketClient, AwsEventType, void, unsigned char, unsigned int) at ??:?
0x4022c74d in pbuf_alloc_LWIP2 at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/pbuf.c:225
0x4020c1dc in UdpContext::_s_recv(void, udp_pcb, pbuf, ip4_addr const, unsigned short) at ??:?
0x4021fe82 in std::_Function_handler<void (AsyncWebSocket, AsyncWebSocketClient, AwsEventType, void, unsigned char, unsigned int), void ()(AsyncWebSocket, AsyncWebSocketClient, AwsEventType, void, unsigned char, unsigned int)>::_M_invoke(std::_Any_data const&, AsyncWebSocket&&, AsyncWebSocketClient&&, AwsEventType&&, void&&, unsigned char&&, unsigned int&&) at ??:?
0x40220418 in AsyncWebSocket::_handleEvent(AsyncWebSocketClient, AwsEventType, void, unsigned char, unsigned int) at ??:?
0x40100841 in millis at ??:?
0x4020d9ac in AsyncWebSocketClient::_onData(void, unsigned int) at ??:?
0x40100841 in millis at ??:?
0x4020d9d8 in std::_Function_handler<void (void, AsyncClient, void, unsigned int), AsyncWebSocketClient::AsyncWebSocketClient(AsyncWebServerRequest, AsyncWebSocket)::{lambda(void, AsyncClient, void, unsigned int)#7}>::_M_invoke(std::_Any_data const&, void&&, AsyncClient&&, std::_Any_data const&, unsigned int&&) at AsyncWebSocket.cpp:?
0x4021e23c in AsyncClient::_recv(std::shared_ptr&, tcp_pcb, pbuf, long) at ??:?
0x4022c6ba in pbuf_free_LWIP2 at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/pbuf.c:786
(inlined by) pbuf_free_LWIP2 at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/pbuf.c:725
0x40100000 in _stext at ??:?
0x4021e29c in AsyncClient::_s_recv(void, tcp_pcb, pbuf, long) at ??:?
0x402347c9 in tcp_input at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/tcp_in.c:501 (discriminator 1)
0x4010091c in pvPortMalloc at ??:?
0x40231f5d in ip4_input at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/ip4.c:1467
0x40100db7 in umm_free_core at umm_malloc.cpp:?
0x4022aadd in ethernet_input_LWIP2 at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/netif/ethernet.c:188
0x4022a8dc in git2glue_err at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-lwip/lwip-git.c:116
(inlined by) esp2glue_ethernet_input at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-lwip/lwip-git.c:477
0x40258b49 in ethernet_input at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c:365
0x40258b5b in ethernet_input at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c:373
0x4024fe07 in ppPeocessRxPktHdr at ??:?
0x40254373 in ets_snprintf at ??:?
0x40105839 in call_user_start_local at ??:?
0x4010583f in call_user_start_local at ??:?
0x40100f70 in umm_init at ??:?
0x4010000d in call_user_start at ??:?
0x401000ac in app_entry_redefinable at ??:?
0x40244d84 in cont_ret at cont.S.o:?
0x40244d35 in cont_continue at cont.S.o:?
0x401004cc in ets_post at ??:?
0x40105fd1 in ets_timer_disarm at ??:?
0x4023967f in ieee80211_output_pbuf at ??:?
0x40239665 in ieee80211_output_pbuf at ??:?
0x40250f5f in pp_attach at ??:?
0x40250fae in pp_attach at ??:?
0x401004cc in ets_post at ??:?
0x40250f5f in pp_attach at ??:?
0x401004cc in ets_post at ??:?
0x40250fae in pp_attach at ??:?
0x4024ec33 in pm_post at ??:?
0x40251092 in pp_attach at ??:?
0x401025df in ppCalFrameTimes at ??:?
0x40250020 in ppTxPkt at ??:?
0x4023968b in ieee80211_output_pbuf at ??:?
0x40105d7b in wdt_feed at ??:?
0x4022a4e1 in glue2esp_linkoutput at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-esp/lwip-esp.c:301
0x40223874 in _printf_i at /workdir/repo/newlib/newlib/libc/stdio/nano-vfprintf_i.c:246
0x4022a70f in new_linkoutput at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/glue-lwip/lwip-git.c:268
0x4022ab6a in ethernet_output at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/netif/ethernet.c:312
0x40230778 in etharp_output_to_arp_index at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/etharp.c:770
0x4023084c in etharp_output_LWIP2 at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/etharp.c:885
0x4010091c in pvPortMalloc at ??:?
0x4023217c in ip4_output_if_opt_src at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/ip4.c:1765
0x4022abb8 in do_memp_malloc_pool at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/memp.c:255
0x4022d67f in tcp_create_segment at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/tcp_out.c:190
0x402321e4 in ip4_output_if_opt at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/ip4.c:1577
0x4022d97a in tcp_write at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/tcp_out.c:666
0x4023220a in ip4_output_if at /home/earle/src/esp-quick-toolchain/arduino/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/ip4.c:1550
0x4010453d in lmacIsIdle at ??:?
0x40105685 in lmacTxFrame at ??:?
0x401004cc in ets_post at ??:?
0x401024a0 in pp_post at ??:?
0x401004cc in ets_post at ??:?
0x4010302b in rcReachRetryLimit at ??:?
0x401024a0 in pp_post at ??:?
0x40105737 in lmacRxDone at ??:?
0x40103208 in rcReachRetryLimit at ??:?
0x401004cc in ets_post at ??:?
0x401024a0 in pp_post at ??:?
0x401004cc in ets_post at ??:?
0x401024a0 in pp_post at ??:?
0x40105737 in lmacRxDone at ??:?
0x401024a0 in pp_post at ??:?
0x4010302b in rcReachRetryLimit at ??:?
0x40105fd1 in ets_timer_disarm at ??:?
0x40103208 in rcReachRetryLimit at ??:?
0x40103208 in rcReachRetryLimit at ??:?
0x401036c2 in wDev_ProcessFiq at ??:?
0x401004cc in ets_post at ??:?
0x401033e4 in wDev_ProcessFiq at ??:?
0x40100841 in millis at ??:?
0x401004cc in ets_post at ??:?
0x4021b76f in yield at ??:?
0x4020738f in ezt::events() at ??:?
0x40100841 in millis at ??:?
0x402153d0 in esp8266::MDNSImplementation::MDNSResponder::_process(bool) at ??:?
0x402099f6 in loop at ??:?
0x4021b7fc in loop_wrapper() at core_esp8266_main.cpp:?
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
-- Configuring GPIO --
isMode: 2
Connecting to WiFi
.
.
.
.
192.168.86.71
MDNS started
ezTime debug level set to INFO
Syncing with NTP
Waiting for time sync
Querying time.google.com ... success (round trip 57 ms)
Received time: Monday, 14-Feb-22 02:30:41.852 UTC
Time is in sync
our Timezone: America/Los_Angeles
Timezone lookup for: America/Los_Angeles ... (round-trip 342 ms) success.
Olson: America/Los_Angeles
Posix: PST8PDT,M3.2.0,M11.1.0
Central Time: Sunday, 13-Feb-2022 18:30:42 PST
WebSocket client #1 connected from 192.168.86.27
Thanks for the awesome module. It's been working great, until I added the ability for the user to change the timezone. It doesn't seem to change timezones, debug is showing "ERROR: Timeout" even though the calls are 10-30s apart.
Below is the log of my WDT Reset happening. The stack trace is a little complex for me to follow, so I'm not entirely sure it's with this module, but I have to start somewhere. :) I have the timezone hard coded, so that's why it says "setting new timezone..." to something that doesn't match the "Timezone lookup for:..."
Code snippet:
Serial.print(F("Setting new time zone to: "));
Serial.println( someTherm->timeZone[ someTherm->timeZone_get() ].c_str() );
myTZ.setLocation( F("America/Chicago") );
waitForSync();
Serial.println(F("Setting new time zone DONE"));
Serial.println( myTZ.dateTime() );