Giter Site home page Giter Site logo

Comments (9)

Hieromon avatar Hieromon commented on August 18, 2024 1

Thank you report. I have not tested it at 1.0.1-rc yet. It seems that problems with soft AP+STA connection occur on the core side, so I will investigate there. Even if though AutoConnect needs some measures, I'll fix until the release of AutoConnect v0.9.7 probably.

from autoconnect.

Hieromon avatar Hieromon commented on August 18, 2024 1

I posted an issue report espressif/arduino-esp32#2334

from autoconnect.

Hieromon avatar Hieromon commented on August 18, 2024

Which version of arduino core-esp32 are you using?

Also, the Simple example uses an autoReconnect option. This option loads credential data from EEPROM when the first WiFI.begin() fails. A crash sometimes occurs if some debris remains in the EEPROM or the NVS position is changed. Because it is not Autoconnect's credential data.
Refer: https://hieromon.github.io/AutoConnect/advancedusage/index.html#move-the-saving-area-of-eeprom-for-the-credentials

from autoconnect.

valki2 avatar valki2 commented on August 18, 2024

Hi Hieromon, sorry for omitting this information: core 1.0.1 (812d131) using esptool v2.6-beta1 and now just fetched the latest 1.0.1rc4 with the same effect (the crash occurs when authenticating on autoconnects accesspoint)

Havent played with the eeprom remains but will have a look into it! Keep up the great work! :)

from autoconnect.

valki2 avatar valki2 commented on August 18, 2024

Update: I just plugged in a brand new Anpro ESP32 NodeMCU with the same crash using the latest arduino core (HEAD).

It crashes exactly the moment where one tries to connect to the acces point (even before password submission)

kind regards

Decoding stack results
0x400ee8f5: _svfprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 1529
0x400f5e26: _vsnprintf_r at ../../../.././newlib/libc/stdio/vsnprintf.c line 72
0x400f5e5e: vsnprintf at ../../../.././newlib/libc/stdio/vsnprintf.c line 41
0x400de9ea: log_printf at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\cores\esp32\esp32-hal-uart.c line 473
0x400d30ba: WiFiGenericClass::_eventCallback(void*, system_event_t*) at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi\src\WiFiGeneric.cpp line 342
0x400d3415: _network_event_task(void*) at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi\src\WiFiGeneric.cpp line 67
0x4008e94d: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 143

`:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4

D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [E][WiFiSTA.cpp:211] begin(): connect failed!
[AC] WiFi.begin()
[AC] Connecting.....................................................................................................[AC] time out IP:0.0.0.0
[AC] http server started
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] SoftAP esp32ap/12345678 CH(1) H(0) IP:192.168.244.1
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
tE (44403) event: mismatch or invalid event, id=63
E (44404) event: default event handler failed!
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400014dc PS : 0x00060c30 A0 : 0x800ee8f8 A1 : 0x3ffb8fb0
A2 : 0x070518ff A3 : 0x070518fb A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3ffb91b2 A12 : 0x00000000 A13 : 0x00000000
A14 : 0x60000000 A15 : 0x00000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x070518ff LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc

Backtrace: 0x400014dc:0x3ffb8fb0 0x400ee8f5:0x3ffb8fc0 0x400f5e26:0x3ffb92d0 0x400f5e5e:0x3ffb9360 0x400de9ea:0x3ffb93a0 0x400d30ba:0x3ffb9400 0x400d3415:0x3ffb9520 0x4008e94d:0x3ffb9550

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4

[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [E][WiFiSTA.cpp:211] begin(): connect failed!
[AC] WiFi.begin()
[AC] Connecting.....................................................................................................[AC] time out IP:0.0.0.0
[AC] http server started
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] SoftAP esp32ap/12345678 CH(1) H(0) IP:192.168.244.1
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] DNS server started
E (188802) event: mismatch or invalid event, id=63
E (188803) event: default event handler failed!
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400014dc PS : 0x00060230 A0 : 0x800ee8f8 A1 : 0x3ffb8fb0
A2 : 0x070518ff A3 : 0x070518fb A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3ffb91b2 A12 : 0x00000000 A13 : 0x00000000
A14 : 0x60000000 A15 : 0x00000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x070518ff LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc

Backtrace: 0x400014dc:0x3ffb8fb0 0x400ee8f5:0x3ffb8fc0 0x400f5e26:0x3ffb92d0 0x400f5e5e:0x3ffb9360 0x400de9ea:0x3ffb93a0 0x400d30ba:0x3ffb9400 0x400d3415:0x3ffb9520 0x4008e94d:0x3ffb9550

Rebooting...
`

from autoconnect.

Hieromon avatar Hieromon commented on August 18, 2024

I have reproduced this issue with arduino-esp32 core 1.0.1 stable release. But it does not seem to be an issue on the AutoConnect side.
Here is the code that extracted only the interface part with arduino-esp32 core. The code will be crash at vsnprintf in log_printf() of esp32-hal-uart.c with Core Debug Level : Debug or higher.
There is a similar topic of the arduino-esp32 Repo. The solution is to swap the sequence of softAP and softAPConfig, but the problem will still be reproduced.
espressif/arduino-esp32#2283

The cause lurks in either SDK or arduino-esp32 core. It may be degrade. Since the crash point is log_print, it naturally does not occur with the core debug level goes down to INFO.
So I will post this issue to arduino-esp32 and continue investigation further, but until it resolved I may postpone the release for v0.9.7.

#include <WiFi.h>
#include <WebServer.h>
#include <DNSServer.h>

WebServer WebServer;
DNSServer DNSServer;
bool DNSActive = false;

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

  WiFi.softAPdisconnect(false);
  WiFi.enableAP(false);
  delay(100);
  WiFi.mode(WIFI_STA);
  delay(100);

  WiFi.begin();

  bool cs = waitForConnect(30000) == WL_CONNECTED;
  WebServer.begin();
  if (!cs) {
    WiFi.setAutoConnect(false);
    WiFi.disconnect(true, true);
    WiFi.mode(WIFI_AP_STA);
    delay(100);
    if (WiFi.softAPConfig(IPAddress(192, 168, 244, 1), IPAddress(192, 168, 244, 1), IPAddress(255, 255, 255, 0))) {
      WiFi.softAP("esp32ap", "12345678", 1, 0);
      while (WiFi.softAPIP() == IPAddress(0, 0, 0, 0))
        delay(100);
      Serial.printf("SoftAP %s\n", WiFi.softAPIP().toString().c_str());
      DNSServer.setErrorReplyCode(DNSReplyCode::NoError);
      DNSServer.start(53, "*", WiFi.softAPIP());
      Serial.println("DNS server started");
      DNSActive = true;
    }
    else
      Serial.println("WiFi.softAPConfig failed");
  }
}

void loop() {
  if (DNSActive) {
    DNSServer.processNextRequest();
  }
  WebServer.handleClient();
}

wl_status_t waitForConnect(unsigned long timeout) {
  wl_status_t wifiStatus;

  Serial.print("Connecting");
  unsigned long st = millis();
  while ((wifiStatus = WiFi.status()) != WL_CONNECTED) {
    if (timeout) {
      if (millis() - st > timeout)
        break;
    }
    Serial.print('.');
    delay(300);
  }
  Serial.printf("%s IP:%s\n", wifiStatus == WL_CONNECTED ? "established" : "time out", WiFi.localIP().toString().c_str());
  return wifiStatus;
}

Here is part of the code that had swap softAP and softAPConfig, the problem still reproduces.

    WiFi.softAP("esp32ap", "12345678", 1, 0);
    while (WiFi.softAPIP() == IPAddress(0, 0, 0, 0))
      delay(100);
    if (WiFi.softAPConfig(IPAddress(192, 168, 244, 1), IPAddress(192, 168, 244, 1), IPAddress(255, 255, 255, 0))) {
      Serial.printf("SoftAP %s\n", WiFi.softAPIP().toString().c_str());
      DNSServer.setErrorReplyCode(DNSReplyCode::NoError);
      DNSServer.start(53, "*", WiFi.softAPIP());
      Serial.println("DNS server started");
      DNSActive = true;
    }
    else
      Serial.println("WiFi.softAPConfig failed");

from autoconnect.

valki2 avatar valki2 commented on August 18, 2024

Great - thank you :)

from autoconnect.

chinswain avatar chinswain commented on August 18, 2024

Fix confirmed working

from autoconnect.

Hieromon avatar Hieromon commented on August 18, 2024

Fixed, arduino-esp32 espressif/arduino-esp32@45fa0f8

from autoconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.