Skip to content

Error when reinitializing WiFi after deinitialization with WiFi.mode( WIFI_MODE_NULL ) #4421

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

Closed
GiovanniCmpaner opened this issue Oct 17, 2020 · 4 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@GiovanniCmpaner
Copy link

GiovanniCmpaner commented Oct 17, 2020

Using branch esp32s2 with PlataformIO and build_flags = -DCORE_DEBUG_LEVEL=5

Minimal sketch:

#include <Arduino.h>
#include <WiFi.h>

void setup()
{
    Serial.begin( 115200 );
    Serial.setDebugOutput( true );

    WiFi.mode( WIFI_MODE_STA );
    WiFi.mode( WIFI_MODE_NULL );
    WiFi.mode( WIFI_MODE_STA );
}

void loop(){ }

Output:

[   942][V][WiFiGeneric.cpp:314] _arduino_event_cb(): STA Started
[   943][D][WiFiGeneric.cpp:967] _eventCallback(): Arduino Event: 2 - STA_START
[   946][V][WiFiGeneric.cpp:319] _arduino_event_cb(): STA Stopped
[   950][D][WiFiGeneric.cpp:967] _eventCallback(): Arduino Event: 3 - STA_STOP
[   960][W][WiFiGeneric.cpp:1268] getMode(): WiFi not started
[   963][E][WiFiGeneric.cpp:1224] mode(): Could not set mode! 12289

With error code 12289 = ESP_ERR_WIFI_NOT_INIT

This assignment:

lowLevelInitDone = esp_wifi_deinit() == ESP_OK;

Should be
lowLevelInitDone = !(esp_wifi_deinit() == ESP_OK);

@lbernstone
Copy link
Contributor

Fix 80e9e42 has not been merged into the branch yet, but will be.

@GiovanniCmpaner
Copy link
Author

Thats good to know, thanks!

@stale
Copy link

stale bot commented Dec 18, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Dec 18, 2020
@stale
Copy link

stale bot commented Jan 2, 2021

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

2 participants