ESP32 as WiFi access point crashes on connection

Mike1997
Posts: 14
Joined: Fri May 10, 2019 6:57 am

ESP32 as WiFi access point crashes on connection

Postby Mike1997 » Fri Dec 27, 2019 4:11 pm

I'm programming an ESP32 via ArduinoIDE and stumble upon a strange problem. It operates as WiFi access point, the code is quite simple and straight-forward:

Code: Select all

IPAddress apIP(192,168,1,1);

WiFi.mode(WIFI_AP);
WiFi.softAP("MyESP32");
WiFi.softAPConfig(apIP,apIP,IPAddress(255,255,255,0));
Now when a client connects to this AP, it often prints out these error messages:

Code: Select all

dhcps: send_nak>>udp_sendto result 0
dhcps: send_offer>>udp_sendto result 0
...and sometimes they are followed by a crash:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x00000000  PS      : 0x00060e30  A0      : 0x8011cc29  A1      : 0x3ffb3e00  
A2      : 0x3ffcdbd0  A3      : 0x3ffcde04  A4      : 0x3ffcd844  A5      : 0x3ffcd824  
A6      : 0x0201a8c0  A7      : 0x0c01a8c0  A8      : 0x8011cacc  A9      : 0x3ffb3dc0  
A10     : 0x3ffcdbe0  A11     : 0x3ffcde04  A12     : 0x3ffb3e0c  A13     : 0x00000044  
A14     : 0x00000001  A15     : 0x00000006  SAR     : 0x00000010  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000  

Backtrace: 0x00000000:0x3ffb3e00 0x4011cc26:0x3ffb3e40 0x40129959:0x3ffb3e60 0x4012e961:0x3ffb3ea0 0x40133bfe:0x3ffb3ec0 0x4011d54b:0x3ffb3ee0 0x40089001:0x3ffb3f10
To say that clear: this happens during connection of a Wifi-client, nothing else is done where my own ESP32 code would be involved.

Any idea what the reason could be for this and how to fix it?

Thanks!

martinius96
Posts: 19
Joined: Thu Dec 13, 2018 1:39 am

Re: ESP32 as WiFi access point crashes on connection

Postby martinius96 » Fri Dec 27, 2019 8:18 pm

Show your whole code please.

Mike1997
Posts: 14
Joined: Fri May 10, 2019 6:57 am

Re: ESP32 as WiFi access point crashes on connection

Postby Mike1997 » Sun Dec 29, 2019 2:28 pm

The whole code is way too big. What is shown above is the complete Wifi initialisation. Beside of that there is a webserver bound to this IP:

Code: Select all

   #include <WebServer.h>

   server.on("/",eventIndex);
   server.on("/woff.html",eventWoff);
   server.on("/graph.svg",drawGraph);
   server.on("/graphL.svg",drawGraphL);
   server.onNotFound(handleNotFound);
   delay(500);
   server.begin();
Once the Wifi-client could connect successfully and without a crash, everything (including the webserver) works properly.

marcde
Posts: 1
Joined: Wed Jan 08, 2020 8:08 am

Re: ESP32 as WiFi access point crashes on connection

Postby marcde » Wed Jan 08, 2020 8:11 am

I see the same issue. Is there a solution or workaround for it ?

Return to “ESP32 Arduino”

Who is online

Users browsing this forum: No registered users and 13 guests