[GH-ISSUE #542] ESP32 Testing doesn't get past WiFi.enableSTA(true) #455

Closed
opened 2026-02-28 01:25:23 +03:00 by kerem · 14 comments
Owner

Originally created by @renegadeandy on GitHub (Mar 1, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/542

I can't seem to get very far using the development branch.

Basic Infos

Using ESP32 dev board oooouuuu board.

Hardware

WiFimanager Branch/Release: Development

Hardware: ESP32

Core Version: 2.4.0, staging

Description

When I try to incorporate the dev WiFiManager into an old project which ran fine on esp8266, It seems to hang and crash directly after WiFi.enableSTA(true);

My call from main sketch is as follows:


 //Start WiFi Setup
  Serial.println("Setting up WiFi...");
  WiFiManager wifiManager;
  wifiManager.autoConnect("AP Setup", NULL);

The added Debug to autoconnect is as follows:


boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) {
  DEBUG_WM(F("AutoConnect"));
 //digitalWrite(apLED,HIGH);
  // attempt to connect using saved settings, on fail fallback to AP config portal
    DEBUG_WM(F("2"));
  WiFi.enableSTA(true);
    DEBUG_WM(F("22"));
  _usermode = WIFI_STA;
  DEBUG_WM(F("222"));

Note my debug output is:

Setting up WiFi...
*WM: AutoConnect 
*WM: 2 

As we can see, we never hit the *WM: 22 message, The sketch appears to simply hang. Is there some kind of setup I need to do? Do I need to declare I am on an ESP32 to the library somehow?

Settings in IDE

Module: ESP32 DEV BOARD

Originally created by @renegadeandy on GitHub (Mar 1, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/542 I can't seem to get very far using the development branch. ### Basic Infos Using ESP32 dev board oooouuuu board. #### Hardware WiFimanager Branch/Release: Development Hardware: ESP32 Core Version: 2.4.0, staging ### Description When I try to incorporate the dev WiFiManager into an old project which ran fine on esp8266, It seems to hang and crash directly after WiFi.enableSTA(true); My call from main sketch is as follows: ``` //Start WiFi Setup Serial.println("Setting up WiFi..."); WiFiManager wifiManager; wifiManager.autoConnect("AP Setup", NULL); ``` The added Debug to autoconnect is as follows: ``` boolean WiFiManager::autoConnect(char const *apName, char const *apPassword) { DEBUG_WM(F("AutoConnect")); //digitalWrite(apLED,HIGH); // attempt to connect using saved settings, on fail fallback to AP config portal DEBUG_WM(F("2")); WiFi.enableSTA(true); DEBUG_WM(F("22")); _usermode = WIFI_STA; DEBUG_WM(F("222")); ``` Note my debug output is: ``` Setting up WiFi... *WM: AutoConnect *WM: 2 ``` As we can see, we never hit the *WM: 22 message, The sketch appears to simply hang. Is there some kind of setup I need to do? Do I need to declare I am on an ESP32 to the library somehow? ### Settings in IDE Module: ESP32 DEV BOARD
kerem 2026-02-28 01:25:23 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

Whats the debug from wifimanager???

<!-- gh-comment-id:369681726 --> @tablatronix commented on GitHub (Mar 1, 2018): Whats the debug from wifimanager???
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

How do I turn that on? Not sure what you mean?

<!-- gh-comment-id:369682874 --> @renegadeandy commented on GitHub (Mar 1, 2018): How do I turn that on? Not sure what you mean?
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

It should be on, unless you are setting it to off in your code.
It outputs lots of info

<!-- gh-comment-id:369683703 --> @tablatronix commented on GitHub (Mar 1, 2018): It should be on, unless you are setting it to off in your code. It outputs lots of info
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

I see no debug output at all in my code, apart from what i've shown to you above?

<!-- gh-comment-id:369687589 --> @renegadeandy commented on GitHub (Mar 1, 2018): I see no debug output at all in my code, apart from what i've shown to you above?
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

hmmm

<!-- gh-comment-id:369688854 --> @tablatronix commented on GitHub (Mar 1, 2018): hmmm
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

works for me

*WM: AutoConnect 
*WM: ESP32 event handler enabled 
*WM: Connecting as wifi client... 
*WM: wifi station disconnect 
*WM: Connecting to saved AP 
*WM: connectTimeout not set, ESP waitForConnectResult... 
WM: EVENT: WIFI_REASON: 201
*WM: Event: SYSTEM_EVENT_STA_DISCONNECTED, reconnecting
*WM: Connection result: WL_NO_SSID_AVAIL
*WM: lastconxresult: WL_NO_SSID_AVAIL
*WM: wifi station disconnect 
*WM: Disabling STA 
*WM: Enabling AP 
*WM: StartAP with SSID:  AutoConnectAP
*WM: AP has anonymous access! 
*WM: SoftAP Configuration 
*WM: -------------------- 
*WM: ssid:             AutoConnectAP
*WM: password:         
*WM: ssid_len:         13
*WM: channel:          1
*WM: authmode:        
*WM: ssid_hidden:     
*WM: max_connection:   4
*WM: beacon_interval:  100(ms)
*WM: -------------------- 
*WM: AP IP address: 192.168.4.1
*WM: setupConfigPortal 
*WM: Starting Web Portal 
*WM: HTTP server started 
*WM: Scan done 
*WM: Config Portal Running, blocking, waiting for clients... 
<!-- gh-comment-id:369689983 --> @tablatronix commented on GitHub (Mar 1, 2018): works for me ``` *WM: AutoConnect *WM: ESP32 event handler enabled *WM: Connecting as wifi client... *WM: wifi station disconnect *WM: Connecting to saved AP *WM: connectTimeout not set, ESP waitForConnectResult... WM: EVENT: WIFI_REASON: 201 *WM: Event: SYSTEM_EVENT_STA_DISCONNECTED, reconnecting *WM: Connection result: WL_NO_SSID_AVAIL *WM: lastconxresult: WL_NO_SSID_AVAIL *WM: wifi station disconnect *WM: Disabling STA *WM: Enabling AP *WM: StartAP with SSID: AutoConnectAP *WM: AP has anonymous access! *WM: SoftAP Configuration *WM: -------------------- *WM: ssid: AutoConnectAP *WM: password: *WM: ssid_len: 13 *WM: channel: 1 *WM: authmode: *WM: ssid_hidden: *WM: max_connection: 4 *WM: beacon_interval: 100(ms) *WM: -------------------- *WM: AP IP address: 192.168.4.1 *WM: setupConfigPortal *WM: Starting Web Portal *WM: HTTP server started *WM: Scan done *WM: Config Portal Running, blocking, waiting for clients... ```
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

Ahh, well you see you never get past WiFi.enableSTA(true); so the rest of the debug output never gets executed!

<!-- gh-comment-id:369690328 --> @renegadeandy commented on GitHub (Mar 1, 2018): Ahh, well you see you never get past WiFi.enableSTA(true); so the rest of the debug output never gets executed!
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

ohh, well that is not wifimanager then, there is nothing in that function to get stuck, is your module crashing?

you should have an exception or something

<!-- gh-comment-id:369693214 --> @tablatronix commented on GitHub (Mar 1, 2018): ohh, well that is not wifimanager then, there is nothing in that function to get stuck, is your module crashing? you should have an exception or something
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

enable esp debugging also maybe?

<!-- gh-comment-id:369694533 --> @tablatronix commented on GitHub (Mar 1, 2018): enable esp debugging also maybe?
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

No, although I have made a couple of alterations, and now I see

Brownout detector was triggered....

Wondering if this is a USB power problem...

<!-- gh-comment-id:369699002 --> @renegadeandy commented on GitHub (Mar 1, 2018): No, although I have made a couple of alterations, and now I see Brownout detector was triggered.... Wondering if this is a USB power problem...
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

Yes! This was the problem, a really rubbish USB Hub, time to put that one back into the garage, sorry tablatronix!

<!-- gh-comment-id:369699571 --> @renegadeandy commented on GitHub (Mar 1, 2018): Yes! This was the problem, a really rubbish USB Hub, time to put that one back into the garage, sorry tablatronix!
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

Yeah power issue, below 300 ma or so, the wifi radio cannot turn on

<!-- gh-comment-id:369699576 --> @tablatronix commented on GitHub (Mar 1, 2018): Yeah power issue, below 300 ma or so, the wifi radio cannot turn on
Author
Owner

@tablatronix commented on GitHub (Mar 1, 2018):

added a catch for this

<!-- gh-comment-id:369700564 --> @tablatronix commented on GitHub (Mar 1, 2018): added a catch for this
Author
Owner

@renegadeandy commented on GitHub (Mar 1, 2018):

Fantastic - thanks mate!

<!-- gh-comment-id:369701265 --> @renegadeandy commented on GitHub (Mar 1, 2018): Fantastic - thanks mate!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#455
No description provided.