So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Mysterarts
#83298 Hello,

I was programming my Adafruit HUZZAH Board (connected to Arduino to exchange with a MQTT server) and everything was working fine during several days until after a code uploaded on the HUZZAH, I didn't receive anything. I connected the FTDI cable to see the serial display and saw :

Code: Select allets Jan  8 2013,rst cause:4, boot mode:(1,6)
wdt reset


Since then all my tests have given me very inconsistent results, full of different exceptions and resets for various reasons.

I uploaded a old version of the code that was working before, with no success.
I tried several things with the sketch upload like tweaking Flash Mode, Flash size, Erase Flash, with no success.
I tried to flash the firmware like explained in this post (the terminal said everything went well), with no success.
I tried my codes with a new HUZZAH, with a new FTDI cable, with powered USB hub, with no success.

Then I tried to upload basic sketches like ESP8266 blink which seems to work (seems because one time not, but after a reupload it worked).
I tried the code given by Adafruit to connect the ESP to internet and I got various results:

Code: Select all/*
 *  Simple HTTP get webclient test
 */

#include <ESP8266WiFi.h>

const char* ssid     = "***";
const char* password = "***";

const char* host = "wifitest.adafruit.com";

void setup() {
  Serial.begin(115200);
  delay(100);

  // We start by connecting to a WiFi network

  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected"); 
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.print("Netmask: ");
  Serial.println(WiFi.subnetMask());
  Serial.print("Gateway: ");
  Serial.println(WiFi.gatewayIP());
}

int value = 0;

void loop() {
  delay(5000);
  ++value;

  Serial.print("connecting to ");
  Serial.println(host);
 
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 80;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
 
  // We now create a URI for the request
  String url = "/testwifi/index.html";
  Serial.print("Requesting URL: ");
  Serial.println(url);
 
  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "Connection: close\r\n\r\n");
  delay(500);
 
  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }
 
  Serial.println();
  Serial.println("closing connection");
}


Here is an extract of the tests to give you an idea (I used Exception Decoder to translate the stack in the log):

Test 1
    Upload code
    Get an exception during first connection
    Manual reset
    Get the same exception
    Works fine endlessly
    Disconnect / Reconnect, works fine endlessly even after manual resets

Code: Select allConnecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html

Exception (0):
epc1=0x40229120 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3ffffb60 end: 3fffffd0 offset: 01a0

>>>stack>>>
Decoding stack results
0x4020a621: glue2esp_linkoutput at glue-esp/lwip-esp.c line 299
0x4020a976: new_linkoutput at glue-lwip/lwip-git.c line 259
0x4020ad0b: ethernet_output at netif/ethernet.c line 305
0x4020e89f: tcp_write at core/tcp_out.c line 563
0x40210b20: etharp_output_to_arp_index at core/ipv4/etharp.c line 768
0x4020e89f: tcp_write at core/tcp_out.c line 563
0x40211e83: ip_chksum_pseudo at core/inet_chksum.c line 395
0x40203312: ClientContext::_write_some() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 448
0x40201edc: uart_write at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 333
0x40203788: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/HardwareSerial.h line 159
0x4020377c: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/HardwareSerial.h line 158
0x40211e83: ip_chksum_pseudo at core/inet_chksum.c line 395
0x4020eec6: tcp_output at core/tcp_out.c line 1123
0x4020bb20: sys_timeout_LWIP2 at core/timeouts.c line 217
0x4010020c: _umm_free at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1295
0x401006ac: realloc at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1645
0x40203d53: String::changeBuffer(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40203312: ClientContext::_write_some() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 448
0x401064ca: millis at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 183
0x40203f48: operator new(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/abi.cpp line 34
0x402033b4: ClientContext::_write_from_source(DataSource*) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 404
0x40203465: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 330
0x402043cd: Print::print(String const&) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 118
0x402026ad: loop() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.h line 263
0x40203984: Print::println() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 178
0x402040f8: loop_wrapper() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 125
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(1,7)


 ets Jan  8 2013,rst cause:4, boot mode:(1,7)

wdt reset

// Manual Reset

Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html

Exception (0):
epc1=0x40216a64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3ffffb20 end: 3fffffd0 offset: 01a0

>>>stack>>>
Same Stack that above
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:39:20 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:39:31 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:39:41 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

// Working endlessly from there


Test 2
    Upload code
    Get a WDT reset
    Manual reset
    Get an exception with a new stack
    Gets stuck
    Manual reset
    Works fine endlessly

Code: Select all ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

Exception (0):
epc1=0x40229120 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys
sp: 3fffeaa0 end: 3fffffb0 offset: 01a0

>>>stack>>>
Decoding stack results
0x40203788: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/HardwareSerial.h line 159
0x40203959: Print::write(char const*) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.h line 60
0x40201fa5: uart_flush at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 376
0x40202102: uart_init at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 438
0x401004e8: malloc at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1668
0x40202274: uart_init at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 276
0x402021d2: uart_init at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 489
0x4020406c: esp_yield() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 91
0x4020150f: delay at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 51
0x4020251c: setup() at /Users/Arthur/Documents/Arduino/HuzzahWifiTest/HuzzahWifiTest.ino line 18
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


Connecting to Livebox-90B4

//Stuck, manual reset

Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:51:56 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:52:07 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection

// Working endlessly


Test 3
    Upload code
    Works perfectly
    Disconnect / reconnect : get a new exception during the first connexion
    Disconnect / reconnect 3 times : works fine

Code: Select all ....
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html

Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
PC: 0x40208428: _Bfree at ../../../.././newlib/libc/stdlib/mprec.c line 141
EXCVADDR: 0x20d0003d

ctx: cont
sp: 3ffffcf0 end: 3fffffd0 offset: 01a0

>>>stack>>>
Decoding stack results
0x4020eec6: tcp_output at core/tcp_out.c line 1123
0x4020bb20: sys_timeout_LWIP2 at core/timeouts.c line 217
0x4010020c: _umm_free at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1295
0x401006ac: realloc at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1645
0x40203d53: String::changeBuffer(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40207949: _dtoa_r at ../../../.././newlib/libc/stdlib/dtoa.c line 858
0x401064ca: millis at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 183
0x40203f48: operator new(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/abi.cpp line 34
0x402033b4: ClientContext::_write_from_source(DataSource*) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 404
0x40203465: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/ClientContext.h line 330
0x402043cd: Print::print(String const&) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 118
0x40203984: Print::println() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 178
0x402040f8: loop_wrapper() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 125
<<<stack<<<

 ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:56:13 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html

Exception (0):
epc1=0x40229120 epc2=0x00000000 epc3=0x00000000 excvaddr=0x20d0003d depc=0x00000000

ctx: cont
sp: 3ffffaa0 end: 3fffffd0 offset: 01a0

>>>stack>>>
Decoding stack results
0x40211d94: mem_malloc at core/mem.c line 136
0x4020a976: new_linkoutput at glue-lwip/lwip-git.c line 259
0x4020ad0b: ethernet_output at netif/ethernet.c line 305
0x4020ad14: ethernet_output at netif/ethernet.c line 305
0x40203441: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClient.cpp line 177
0x4020a976: new_linkoutput at glue-lwip/lwip-git.c line 259
0x4020ad0b: ethernet_output at netif/ethernet.c line 305
0x4020ad14: ethernet_output at netif/ethernet.c line 305
0x40210b20: etharp_output_to_arp_index at core/ipv4/etharp.c line 768
0x40203441: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClient.cpp line 177
0x40203441: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClient.cpp line 177
0x402043cd: Print::print(String const&) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 118
0x40203428: WiFiClient::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClient.cpp line 176
0x4020eec6: tcp_output at core/tcp_out.c line 1123
0x4020bb20: sys_timeout_LWIP2 at core/timeouts.c line 217
0x4010020c: _umm_free at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1295
0x401006ac: realloc at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1645
0x40203d53: String::changeBuffer(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40203d53: String::changeBuffer(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40203d53: String::changeBuffer(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40203d9f: String::reserve(unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 146
0x40203e97: String::concat(char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 288
0x402043cd: Print::print(String const&) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 118
0x402026ad: loop() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.h line 263
0x4020408d: esp_schedule() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 95
0x402040f8: loop_wrapper() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 125
<<<stack<<<

 ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1

Exception (0):
epc1=0x4020bd20 epc2=0x00000000 epc3=0x00000000 excvaddr=0x20d0003d depc=0x00000000

ctx: sys
sp: 3fffed10 end: 3fffffb0 offset: 01a0

>>>stack>>>
Decoding stack results
0x401064ca: millis at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 183
0x4020ada4: memp_malloc at core/memp.c line 404
0x4020bc5c: cyclic_timer at core/timeouts.c line 165
0x4020bb20: sys_timeout_LWIP2 at core/timeouts.c line 217
0x401064ca: millis at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 183
0x4020bc5c: cyclic_timer at core/timeouts.c line 165
0x4020bc74: cyclic_timer at core/timeouts.c line 172
0x4020bd20: sys_check_timeouts at core/timeouts.c line 351
0x40202a1c: ESP8266WiFiSTAClass::status() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 498
0x40202b99: ESP8266WiFiSTAClass::begin(char const*, char const*, int, unsigned char const*, bool) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 178
0x40202b75: ESP8266WiFiSTAClass::begin(char const*, char const*, int, unsigned char const*, bool) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 168
0x40203788: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/HardwareSerial.h line 159
0x40203959: Print::write(char const*) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.h line 60
0x40202102: uart_init at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/uart.c line 438
0x40203a6d: Print::printNumber(unsigned long, unsigned char) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 260
0x40203788: HardwareSerial::write(unsigned char const*, unsigned int) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/HardwareSerial.h line 159
0x4020406c: esp_yield() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 91
0x4020150f: delay at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 51
0x40202615: loop() at /Users/Arthur/Documents/Arduino/HuzzahWifiTest/HuzzahWifiTest.ino line 44
0x40203984: Print::println() at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 178
0x402039f8: Print::println(Printable const&) at /Users/Arthur/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 238
0x402025bc: setup() at /Users/Arthur/Documents/Arduino/HuzzahWifiTest/HuzzahWifiTest.ino line 38
<<<stack<<<

 ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld


Connecting to Livebox-90B4
.
WiFi connected
IP address:
192.168.1.39
Netmask: 255.255.255.0
Gateway: 192.168.1.1
connecting to wifitest.adafruit.com
Requesting URL: /testwifi/index.html
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 31 Jul 2019 13:56:35 GMT
Content-Type: text/html
Content-Length: 70
Last-Modified: Thu, 16 May 2019 18:21:16 GMT
Connection: close
ETag: "5cddaa1c-46"
Accept-Ranges: bytes

This is a test of Adafruit WiFi!
If you can read this, its working :)

closing connection

// Working endlessly


Test 4
    Upload code
    Works perfectly

What really puzzles me is the inconsistence between the tests and the variety of exceptions I get ^^'

And when it comes to the my code, the results are worse. Most of the time I get a connexion with the MQTT server after 1 or 2 exceptions after the upload. And most of the time, disconnect / reconnect gives me endless stacks of errors and I'm forced to reupload the code. During my last test, even the reupload couldn't stop the endless stacks (try several times), I had to reupload another code then mine to make it works (for a short time)... So weird!

I don't know what to do anymore ^^'
Thanks for your time :)
Last edited by Mysterarts on Sat Aug 03, 2019 8:49 am, edited 1 time in total.
User avatar
By schufti
#83306 as you don't write which version of esp8266 arduino core you are using, it is just an educated guess:
try going back to 2.4.2 or 2.3.0
there are massive problems with 2.5.x and recent github versions regarding wifi and wdt exceptions.

code given by Adafruit to connect the ESP to internet

not even the core developers can give you a definitive answer on "how to best connect to the internet" for a given version, so don't expect more wisdom from non involved company.
User avatar
By Mysterarts
#83322 Thank you for your answer and sorry for this omission!
In fact I already tried 2 versions of the esp8266 arduino core: 2.4.2 and 2.5.2, with similar issues.

So I tried 2.3.0 and sadly it doesn't work any better. It's even worse, I can't connect to my router anymore, even with the example codes that come with the core :|