-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Proper way of restarting WiFi after WiFi.mode(WIFI_OFF); #3794
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
Comments
There seems to be a bug on the WifiGeneric class |
[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_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Dear i am having facing the issue of esp32 Nod mcu going offline i have tried many but , it was suitable your code #define BLYNK_PRINT Serial #include <WiFi.h> // You should get Auth Token in the Blynk App. // Your WiFi credentials. void setup() Blynk.begin(auth, ssid, pass); void loop() |
this is the error Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "WeMos WiFi&Bluetooth Battery, 80MHz, 921600, None" BlynkESP32googleamazone26-03-2021-1:40:1: error: expected initializer before 'WiFi' WiFi.mode(WIFI_MODE_STA); // calls esp_wifi_set_mode(WIFI_MODE_STA); and esp_wifi_start(); ^ BlynkESP32googleamazone26-03-2021-1:41:1: error: 'WiFi' does not name a type WiFi.enableSTA(true); ^ BlynkESP32googleamazone26-03-2021-1:42:1: error: 'scanResult' does not name a type scanResult = WiFi.scanNetworks(); // doing scan ^ BlynkESP32googleamazone26-03-2021-1:43:1: error: expected unqualified-id before 'if' if(scanResult > 0){ ^ Multiple libraries were found for "WiFi.h" Used: C:\Users\noush\OneDrive\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.5\libraries\WiFi Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\WiFi exit status 1 expected initializer before 'WiFi' This report would have more information with |
found this inside the WiFiGeneric.cpp .. (line 148) so.. the deinit is not going to do anything... |
I am running an Upload Task connecting to a WiFiAP (doing a scan and select the best Network) and uploading stuff. If finished uploading, wifi is turned off and the task is deleted.
If I want to upload again, the task ist created again, but I get:
E (345591) wifi: esp_wifi_scan_start 1245 wifi not start
So what is the proper way of turning WiFi off completly (reduce power consumption) and enabeling it again? I already tried different things but can't get it working.
Currently I am doing this:
Start WiFi (only relevant code):
End WiFi:
Debug results for wifi start (only on first call, nothing if recreating the task):
Wifi end gives
When ending wifi task again because of timeout, I get:
E (505690) wifi: esp_wifi_disconnect 1153 wifi not start
Any Idea what is happening here and how to restart wifi again?
The text was updated successfully, but these errors were encountered: