Post topics, source code that relate to the Arduino Platform

User avatar
By Sean Kelly
#52717 ...WiFiClientSecure connection

I'm at my wits end. I'm seeing code like the following fail with a Soft WDT reset.

WiFiClientSecure client;
...
yield();
system_soft_wdt_restart();
system_soft_wdt_feed();
delay(0);
client.write(content, contentLength)
yield();
system_soft_wdt_restart();
system_soft_wdt_feed();
delay(0);

USBtoUART OUTPUT

yield
restart
feed
delay
sendBody(1432)
Soft WDT reset

ctx: cont
sp: 3fff4020 end: 3fff4540 offset: 01b0

>>>stack>>>
3fff41d0: 022aaef6 df038f4f 00000000 00000000
3fff41e0: 4024e362 3fff67a4 00000000 4024e338
...

Stack according to Exceptiondecoder

0x4024e362: tcp_write at /Users/igrokhotkov/espressif/arduino/tools/sdk/lwip/src/core/tcp_out.c line 575
0x4024e338: tcp_pbuf_prealloc at /Users/igrokhotkov/espressif/arduino/tools/sdk/lwip/src/core/tcp_out.c line 257
: (inlined by) tcp_write at /Users/igrokhotkov/espressif/arduino/tools/sdk/lwip/src/core/tcp_out.c line 535
0x402148f0: ClientContext::write(char const*, unsigned int) at /Users/seank/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/include/ClientContext.h line 232
: (inlined by) ax_port_write at /Users/seank/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp line 560
0x4023e748: send_raw_packet at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 9860x4023e748: send_raw_packet at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 986
: (inlined by) send_packet at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 1121
0x4023e7cf: ssl_write at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 306
0x4023e7cf: ssl_write at /Users/igrokhotkov/e/axtls/e1/ssl/tls1.c line 306
0x402144d8: WiFiClientSecure::write(unsigned char const*, unsigned int) at /Users/seank/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp line 517
0x4021a55e: HTTPSClient::write(unsigned char const*, unsigned int) at /Users/seank/Documents/Arduino/libraries/AzureIoTHub/src/util/HTTPSClient.cpp line 167
0x40217fc0: HTTPSClient::sendBody(unsigned char const*, int) at /Users/seank/Documents/Arduino/libraries/AzureIoTHub/src/util/HTTPSClient.cpp line 81
...

I also tried calling esp_yield but that appears to hang inifinitely in a way the WDT can't reset.

My hardware is a Adafruit Feather HUZZAH if that matters. I've search the googles and am stumped at this point.