Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop-v3] Core panics after connection to AP #588

Open
EinfachArne opened this issue Mar 20, 2019 · 10 comments
Open

[develop-v3] Core panics after connection to AP #588

EinfachArne opened this issue Mar 20, 2019 · 10 comments

Comments

@EinfachArne
Copy link
Contributor

Hey,

everything works fine until I connect to my ESP32 via WiFi. After that I keep getting the following error message in an endless loop:

✖ /homie/config.json doesn't exist
Configuration invalid. Using CONFIG MODE
💡 Firmware bare-minimum (1.0.0)
🔌 Booting into config mode 🔌
Device ID is 30aea41f1b18
AP started as Homie-30aea41f1b18 with IP 192.168.123.1
Triggering Wi-Fi scan...
dhcps: send_offer>>udp_sendto result 0
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x00000000  PS      : 0x00060030  A0      : 0x8010ba31  A1      : 0x3ffb4e20
A2      : 0x3ffd03a4  A3      : 0x3ffcfde0  A4      : 0x3ffce900  A5      : 0x3ffce654
A6      : 0x027ba8c0  A7      : 0x0c7ba8c0  A8      : 0x8010b8d0  A9      : 0x3ffb4de0
A10     : 0x3ffd03b4  A11     : 0x3ffcfde0  A12     : 0x3ffb4e2c  A13     : 0x00000044
A14     : 0x00000001  A15     : 0x00000006  SAR     : 0x00000010  EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000

ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000

Backtrace: 0x00000000:0x3ffb4e20 0x4010ba2e:0x3ffb4e60 0x40101e21:0x3ffb4e80 0x401057f5:0x3ffb4ec0 0x4010aa72:0x3ffb4ee0 0x400fa53b:0x3ffb4f00 0x4009180d:0x3ffb4f30

Rebooting...

After I disconnect the core stops to panic but that makes it impossible to upload a config.

I used the current development version of Homie-V3 on a Wemos Lolin32 V1.0.0.

Any ideas what the cause could be?

@bertmelis
Copy link
Contributor

Could you decode the backtrace?

@euphi
Copy link
Member

euphi commented Mar 21, 2019

I don't use config mode, so I did not tested it yet.

What happesn, if you upload a homie/config.json to SPIFFS?

@EinfachArne
Copy link
Contributor Author

@euphi Works like a charm and solves at least my problem for now. But of course not the problem in general.

@bertmelis I am not that skilled. Is there a simple way to do it? I am working with PlatformIO on Windows. A quick research brought nothing up.

@stritti
Copy link
Collaborator

stritti commented Mar 23, 2019

@EinfachArne Yes this is a big gap in PlatformIO. There is still missing decoding of back traces.
My current workaround:

  • Start Arduino IDE with installed https://github.com/me-no-dev/EspExceptionDecoder
  • open decoder from menu (with no selected/compiled) project)
  • the decoder asks for the firmware.elf. You should select the version PlatformIO has built within project sub-direcory .pioevs/
  • now you could paste the back trace to the opened window

Hope this helps.

@bertmelis
Copy link
Contributor

You could also do it manually (or create a Windows batch file):

%homedrive%%homepath%/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-addr2line.exe -fp -e ./.pioenvs/esp8266/firmware.elf ...

if you run xtensa-lx106-elf-addr2line.exe -h you can see the how it's used.

@EinfachArne
Copy link
Contributor Author

Thank you guys! I think I got it. :)

Ok, for the record:

Tested on Wemos Lolin32 V1.0.0 and ESP32 DevModule - both show the same result. This is based on the DevModule:

Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x00000000  PS      : 0x00060030  A0      : 0x8010ba31  A1      : 0x3ffb4e20
A2      : 0x3ffcf58c  A3      : 0x3ffcfd84  A4      : 0x3ffcc214  A5      : 0x3ffcc158
A6      : 0x027ba8c0  A7      : 0x0c7ba8c0  A8      : 0x8010b8d0  A9      : 0x3ffb4de0
A10     : 0x3ffcf59c  A11     : 0x3ffcfd84  A12     : 0x3ffb4e2c  A13     : 0x00000044
A14     : 0x00000001  A15     : 0x00000006  SAR     : 0x00000010  EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000

ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000

Backtrace: 0x00000000:0x3ffb4e20 0x4010ba2e:0x3ffb4e60 0x40101e21:0x3ffb4e80 0x401057f5:0x3ffb4ec0 0x4010aa72:0x3ffb4ee0 0x400fa53b:0x3ffb4f00 0x4009180d:0x3ffb4f30

Decoded:

PC: 0x00000000
EXCVADDR: 0x00000000

Decoding stack results
0x4010ba2e: handle_dhcp at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/apps/dhcpserver/dhcpserver.c line 1031
0x40101e21: udp_input at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/udp.c line 401
0x401057f5: ip4_input at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/ipv4/ip4.c line 740
0x4010aa72: ethernet_input at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/netif/ethernet.c line 184
0x400fa53b: tcpip_thread at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/api/tcpip.c line 135
0x4009180d: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 143

@euphi
Copy link
Member

euphi commented Mar 24, 2019

Oh.. doesn't look good. Maybe a heap corruption?

@stritti stritti added this to the v3.0.0 milestone Apr 4, 2019
@stritti stritti added this to To do in Homie v3.0.0 Apr 4, 2019
@nemiliani
Copy link

Hi all, I am experiencing the same thing using an espduino-32, platformio and ubuntu 18.04.

Device ID is 3c71bf15651c
AP started as Homie-3c71bf15651c with IP 192.168.123.1
[E][WiFiSTA.cpp:124] begin(): SSID too long or missing!
Triggering Wi-Fi scan...
✔ Wi-Fi scan completed
dhcps: send_offer>>udp_sendto result 0
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x00000000  PS      : 0x00060430  A0      : 0x801017a1  A1      : 0x3ffb57f0  
A2      : 0x3ffd0948  A3      : 0x3ffd0b94  A4      : 0x3ffd0b7c  A5      : 0x3ffd0164  
A6      : 0x027ba8c0  A7      : 0x0c7ba8c0  A8      : 0x80101640  A9      : 0x3ffb57b0  
A10     : 0x3ffd0958  A11     : 0x3ffd0b94  A12     : 0x3ffb57fc  A13     : 0x00000044  
A14     : 0x00000001  A15     : 0x00000006  SAR     : 0x00000010  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000  

Backtrace: 0x00000000:0x3ffb57f0 0x4010179e:0x3ffb5830 0x4010d2b1:0x3ffb5850 0x40111ab9:0x3ffb5890 0x40116d36:0x3ffb58b0 0x40104703:0x3ffb58d0 0x40088fcd:0x3ffb5900

Demangled :

$ /home/nemi/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-addr2line --exe=.pioenvs/espduino32/firmware.elf -C 0x00000000:0x3ffb57f0 0x4010179e:0x3ffb5830 0x4010d2b1:0x3ffb5850 0x40111ab9:0x3ffb5890 0x40116d36:0x3ffb58b0 0x40104703:0x3ffb58d0 0x40088fcd:0x3ffb5900
??:0
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/apps/dhcpserver/dhcpserver.c:1031
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/udp.c:401
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/core/ipv4/ip4.c:740
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/netif/ethernet.c:184
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/lwip/lwip/src/api/tcpip.c:483
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c:355 (discriminator 1)

I did go to

[E][WiFiSTA.cpp:124] begin(): SSID too long or missing!

and verified the ssid string at that point is empty, not sure if that is causing the later crash. I will try to debug it and see if I can get to the bottom. If you have any suggestions on what to look for please let me know.

Thanks.

@reapzor
Copy link

reapzor commented Aug 4, 2019

I reproduced this in the Arduino IDE with just the WiFi library. This is not a Homie bug, it is some bug with the WiFi library and esp32, and setting up a STA_AP.

Whenever you re-upload a sketch with the same AP SSID string, it will crash. The only work around I have found so far is to provide a new AP name prior to uploading the sketch.

espressif/arduino-esp32#2025

@mkfrey
Copy link
Contributor

mkfrey commented Aug 22, 2019

I created a pull request for a workaround of this issue. Disabling WiFi persistence will get rid of this problem, but may slightly increase the WiFi connection time.

The memory (or at least the part where the WiFi persistence data is stored) needs to be wiped beforehand if a firmware with WiFi persistence enabled has already been used prior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Homie v3.0.0
  
To do
Development

No branches or pull requests

7 participants