Closed Stubbs closed 5 years ago
Doing a similar project inspired to https://github.com/ClemRz/GCalendar-Irrigation, getting same error: Wemos D1 Mini restarts.
Exception (29): epc1=0x40217ccb epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000006 depc=0x00000000
Stack decoding below.
0x40217cc7: send_client_hello at ssl/tls1_clnt.c line 202 : (inlined by) do_client_connect at ssl/tls1_clnt.c line 167 0x401004d8: malloc at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266\umm_malloc/umm_malloc.c line 1668 0x40217f0a: ssl_client_new at ssl/tls1_clnt.c line 89 0x40208d7e: strdup at /Users/igrokhotkov/e/newlib-xtensa/xtensa-lx106-elf/newlib/libc/string/../../../.././newlib/libc/string/strdup.c line 11 0x4010500c: ets_timer_arm_new at ?? line ? 0x40204a63: shared_ptr at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) : (inlined by) SSLContext::connect(ClientContext, char const, unsigned int) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 138 (discriminator 1) 0x402061a4: esp_yield at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x402060b4: operator new(unsigned int) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/abi.cpp line 57 0x40204af4: std::__shared_ptr ::operator=(std::__shared_ptr &&) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x40204d03: WiFiClientSecure::_connectSSL(char const) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x40204da9: WiFiClientSecure::connect(char const, unsigned short) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x401072e8: sntp_get_current_timestamp at ?? line ? 0x401072e8: sntp_get_current_timestamp at ?? line ? 0x40202279: httpsGet() at C:\Users\gabri\Documents\Arduino\ESP8266_gcalendar_irrigation/client.ino line 29 0x402057b1: Print::write(char const) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Print.cpp line 87 0x402057b1: Print::write(char const) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Print.cpp line 87 0x402058a0: Print::println() at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Print.cpp line 87 0x4020326d: loop at C:\Users\gabri\Documents\Arduino\ESP8266_gcalendar_irrigation/ESP8266_gcalendar_irrigation.ino line 81 0x402061c5: esp_schedule at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x402061f0: loop_wrapper at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x40100710: cont_norm at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/cont.S line 109
Will look into it. In the meantime, could you change the value of the delay at the end of the loop in GoogleDocs.ino and try again? Try increasing or decreasing (but not below 1500) and see.
Done the test with GoogleDocs.ino in your libraries and I have obtained a crash with 4s delay after a long series of GET and POST requests: Decoding 32 results 0x4021a6b2: more_comps at crypto/bigint.c line 672 0x4021a8ac: alloc at crypto/bigint.c line 672 0x40100670: _umm_realloc at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266\umm_malloc/umm_malloc.c line 1641 : (inlined by) realloc at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266\umm_malloc/umm_malloc.c line 1715 0x4021abc5: regular_multiply at crypto/bigint.c line 672 0x40205b9c: optimistic_yield at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x4021b6ff: bi_barrett at crypto/bigint.c line 1289 0x4021b954: bi_mod_power at crypto/bigint.c line 1414 0x4021a758: trim at crypto/bigint.c line 672 0x4021cadd: RSA_public at crypto/rsa.c line 254 : (inlined by) RSA_encrypt at crypto/rsa.c line 288 0x402177d8: send_client_key_xchg at ssl/tls1_clnt.c line 409 0x40217c6d: do_clnt_handshake at ssl/tls1_clnt.c line 123 0x40210895: pbuf_free_LWIP2 at /local/users/gauchard/arduino/arduino_esp8266/origin/tools/sdk/lwip2/builder/lwip2-src/src/core/pbuf.c line 1306 0x40205b5c: __yield at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x402175e0: do_handshake at ssl/tls1.c line 2007 : (inlined by) basic_read at ssl/tls1.c line 1483 0x402179bc: do_client_connect at ssl/tls1_clnt.c line 168 0x401004d8: malloc at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266\umm_malloc/umm_malloc.c line 1668 0x4020379c: SSLContext::_delete_sharedSSL(SSL) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x40217748: ssl_read at ssl/tls1.c line 2007 0x40204185: SSLContext::connect(ClientContext, char const, unsigned int) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x40205ae4: esp_yield at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x4020136f: delay at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 51 0x402043d3: WiFiClientSecure::_connectSSL(char const) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x40204479: WiFiClientSecure::connect(char const, unsigned short) at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClientSecure.cpp line 310 (discriminator 1) 0x401071b0: sntp_get_current_timestamp at ?? line ? 0x401071b0: sntp_get_current_timestamp at ?? line ? 0x40204be4: HTTPSRedirect::printRedir() at C:\Users\gabri\Documents\Arduino\libraries\HTTPSRedirect/HTTPSRedirect.cpp line 431 0x40204c9c: HTTPSRedirect::GET(String const&, char const, bool const&) at C:\Users\gabri\Documents\Arduino\libraries\HTTPSRedirect/HTTPSRedirect.cpp line 431 0x402050b0: Print::println() at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Print.cpp line 99 0x40204cbe: HTTPSRedirect::GET(String const&, char const*) at C:\Users\gabri\Documents\Arduino\libraries\HTTPSRedirect/HTTPSRedirect.cpp line 431 0x40202646: loop at C:\Users\gabri\Documents\Arduino\libraries\HTTPSRedirect\GoogleDocs/GoogleDocs.ino line 192 0x40205b30: loop_wrapper at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 57 0x40100710: cont_norm at C:\Users\gabri\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/cont.S line 109
Hi guys, I have the same problem with Exception (29). I have 4 temp sensors (DS18B20), I read sensors every second, showing values on lcd and sending to spreadsheet every 15 minutes. Most of crashes are after 20 writes to sheet. Could be a problem not on my side, but on google side? I found some limitation, but are not very clear for me https://developers.google.com/apps-script/guides/services/quotas
There is limit of triggers=20, what does it mean?
@electronicsguy Is your example working in your environment, please? Without reset more than 20 loops?
@jozper, @ercoleg and @Stubbs esp8266 sdk for arduino ver. 2.4.2 was just released which fixes memory leaks in HTTPClient https://github.com/esp8266/Arduino/releases/tag/2.4.2 Could you please update to this within Arduino IDE/board manager and try again? Please report any differences.
Update did not help, but it seems, I solved my problem with resetting after 20 loops. I had MAX_CONNECT=10 and after first rebuilding it still worked, but after second rebuilding, it means after 20 loops it crashed.
I removed the "client = nullptr;" from the script and no reset anymore :)
if (connect_count > MAX_CONNECT) { Serial.println("Connects > MAX_CONNECT... rebuild"); connect_count = 0; flagclient = false; delete client; //client = nullptr; }
I have some code that reads a Google calendar and it works great except every so often I get this & the Arduino (D1 Mini) restarts & carries on.
I'm quite new to Arduino's & the last C++ I did was at college, 20+ years ago, so it doesn't make much sense, but it looks like it's trying to allocate some memory when it's decrypting the payload maybe?
The full code, minus sensitive stuff, is here https://github.com/Stubbs/bin_days