Captive portal example esp32 error

Hello everyone. I copied the code from the example (esp32 Dns Server / captive portal) and get an error when I try to connect to the point.

Guru Meditation Error: Core 0 panic’ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x00000000 PS : 0x00060030 A0 : 0x80111511 A1 : 0x3ffb4d30
A2 : 0x3ffcdc84 A3 : 0x3ffce8c4 A4 : 0x3ffbaadc A5 : 0x3ffcdeb8
A6 : 0x0201a8c0 A7 : 0x0c01a8c0 A8 : 0x801113b4 A9 : 0x3ffb4cf0
A10 : 0x3ffcdc94 A11 : 0x3ffce8c4 A12 : 0x3ffb4d3c A13 : 0x00000044
A14 : 0x00000001 A15 : 0x00000006 SAR : 0x00000010 EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0x00000000

Backtrace: 0x00000000:0x3ffb4d30 0x4011150e:0x3ffb4d70 0x4011e395:0x3ffb4d90 0x4012339d:0x3ffb4dd0 0x4012863a:0x3ffb4df0 0x40111f17:0x3ffb4e10 0x40088b7d:0x3ffb4e40

Platformio: Home 2.3.3 Core 4.0.3

It works fine for me. Can you execute the below command and post the output:

/Users/USERNAME/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-addr2line -pfiaC -e .pio/build/BOARDNAME/firmware.elf 0x00000000:0x3ffb4d30 0x4011150e:0x3ffb4d70 0x4011e395:0x3ffb4d90 0x4012339d:0x3ffb4dd0 0x4012863a:0x3ffb4df0 0x40111f17:0x3ffb4e10 0x40088b7d:0x3ffb4e40

You have to replace USERNAME and BOARDNAME and - if you’re on Windows - use backslashes instead of forward slashed.

It would also be helpful to see the platformio.ini file and the build output.

1 Like
C:\Users\georg\.platformio\packages\toolchain-xtensa32\bin\xtensa-esp32-elf-addr2line.exe -pfiaC -e E:\work\esp32\morda\.pio\build\lolin_d32\firmware.elf 0x00000000:0x3ffb4d30 0x4011150e:0x3ffb4d70 0x4011e395:0x3ffb4d90 0x4012339d:0x3ffb4dd0 0x4012863a:0x3ffb4df0 0x40111f17:0x3ffb4e10 0x40088b7d:0x3ffb4e40
0x00000000: ?? ??:0
0x4011150e: err_tcp at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/api_msg.c:519 (discriminator 1)
0x4011e395: tcp_output_segment at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/tcp_out.c:1228
0x4012339d: ip6_reass at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/ipv6/ip6_frag.c:509     
0x4012863a: md5_process at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/netif/ppp/polarssl/md5.c:94
0x40111f17: poll_tcp at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/api_msg.c:373
0x40088b7d: vPortCPUAcquireMutexIntsDisabledExtram at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.inc.h:107
 (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.h:95
 (inlined by) vPortCPUAcquireMutex at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:394
[env:lolin_d32]
platform = espressif32
board = lolin_d32
framework = arduino

Unfortunately, the backtrace is incomplete. It doesn’t go to the top, i.e. to a line in setup() or loop(). So some work will be needed to locate the bug.

Just to make sure:

To locate the bug:

  • Initialize Serial and put Serial.print statement between statements in setup() and loop()

You can also try to add a delay between softAP() and softAPConfig():

WiFi.softAP(ssid, password);
delay(2000);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));

Or create a sketch to reset all persistent WiFi paramters. It consists of an empty loop() function and a single statement in setup():

WiFi.persistent(false);