mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1220] (Question) Sometimes AP randomly comes back on #1040
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1040
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bwjohns4 on GitHub (Mar 2, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1220
I've made a lot of customizations to Wifimanager and everything appears stable, however I see that sometimes the AP randomly starts broadcasting it's SSID well after WiFimanager has gone out of scope? Is this a known issue that sometimes happens, or am I doing something wrong. Is there a way to prevent that, or delete the AP configuration from the ESP8266 after Wifimanager runs? On the devices I've observed this on, it had a previous sketch on it from months ago, then I OTA updated it to newer firmware. Could this be an ESP bug that would go away with erase_flash? Any insight would be appreciated. Is there a way to load a new sketch and check if AP mode is already active or something like that?
@tablatronix commented on GitHub (Mar 2, 2021):
Set
WiFi.mode(WIFI_STA)in your sketch, the esp automatically starts aps (EDITED)If you want only sta mode set it, or else esp will default to sta+ap
@bwjohns4 commented on GitHub (Mar 2, 2021):
Wifimanager usually closes that right? And sets things back to STA mode before returning? Does that sometimes fail and get stuck? I call these two functions, below, in setup() and in general the SSID goes away after wifimanager.autoConnect is complete. It just sometimes comes back randomly after days though. Why is it sporadic and not always that I see the SSID being broadcasted after startup?
wifiManager.setTimeout(600);
wifiManager.autoConnect("MySSID");
I can just add WiFi.mode(WiFi_STA); after autoConnect() if that won't mess anything up. Just curious why this only sometimes happens...
@tablatronix commented on GitHub (Mar 2, 2021):
Add it before anything, it gets saved to flash
WM no longer clobbers persistent settings.
@bwjohns4 commented on GitHub (Mar 2, 2021):
I still want WiFiManager to go into it's normal config portal mode when needed and broadcast it's SSID when needed. Will adding this before calling WM not prevent that from happening?
@tablatronix commented on GitHub (Mar 2, 2021):
Nope, thats just ESP default stuff
@tablatronix commented on GitHub (Mar 2, 2021):
I tried adding a way to force this for consistency with old versions, I guess its not working though
@bwjohns4 commented on GitHub (Mar 2, 2021):
How does that work? ESP saves the mode in flash and WM starts up an AP without changing the mode and somehow doesn't tamper with the persistent settings in flash? Also, your way of forcing for consistency may still work, I have made lots of tweaks to my copy of WM although I intended to leave everything alone related to the WIFI management portion since I'm not too savvy on the underlying details of that.
@tablatronix commented on GitHub (Mar 2, 2021):
Are you using esp8266 or esp32 ?
@bwjohns4 commented on GitHub (Mar 2, 2021):
esp8266
@tablatronix commented on GitHub (Mar 2, 2021):
Remind me what version you are using again?
@bwjohns4 commented on GitHub (Mar 2, 2021):
It's off the master branch but I forked it about a month ago and started putting my own tweaks into it. May even be 6 weeks behind the current master
@tablatronix commented on GitHub (Mar 2, 2021):
Oh ok so before dev was merged into master?
hmm, that should not exist in the 0.x versions
What customizations are you making to source code, you should really be using the new version as it lets you do more without modifying code
@bwjohns4 commented on GitHub (Mar 3, 2021):
It was after ESP32 portion was merged into master (my application compiles either ESP8266 or ESP32, but I've only noticed this issue so far with ESP8266), so I'm thinking that is what you mean about dev being merged into master. I made these modifications:
@tablatronix commented on GitHub (Mar 3, 2021):
Ok I was looking into defining out some stuff, help strings, ota, info page stuff also , let me know how you managed those, I am looking into making html inputs better and some stuff you mentioned as discussed in other issues and I have some stashed branches I am playing with
@bwjohns4 commented on GitHub (Mar 3, 2021):
Why did you recommend calling WiFi.mode(WiFi_STA) before WM.autoConnect()? Is there any reason not to call it after? I'd prefer the call after WM, just a way of ensuring and future proofing that after WM we always go back to WIFI_STA. Would it hurt to call it before AND after?
@tablatronix commented on GitHub (Mar 3, 2021):
you could also check if mode is not what you want and then change it also.
Technically you are only doing it once, once its saved it never changes, subsequent calls should be ignored by esp lib, but make sure its not causing you disconnects or anything.
Here is the source code, you can see it just returns true
@hebertreis commented on GitHub (Mar 14, 2021):
Using the version 2.x this did happen with me, after connected show a open network with SSID starting with
ESP-plus 6 last digits from the mac address.Adding
WiFi.mode(WiFi_STA)didn't work, Arduino IDE says thatWiFi_STAvariable is not declared. Try to look other ways to fix on STA mode but didn't work anyway.Doing the downgrade to 0.16 version this behavior stop and solved for me.
@tablatronix commented on GitHub (Mar 14, 2021):
Sorry its all caps
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP