mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1326] Hundreds of "*wm:[2] [EVENT] WIFI_REASON: 8" logs when I disconnect() #1140
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#1140
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 @robjordan on GitHub (Dec 22, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1326
Basic Infos
Hardware
WiFimanager Branch/Release: Master
2.0.5-beta+sha.8452df7
Esp32:
Hardware: m5stickc+ (ESP32-PICO-D4 based)
Core Version: 3.4.0
Description
On ESP32 Arduino, my app is a BLE scanner. I have read that WiFi activity can interfere with BLE detection, so I keep WiFi disabled most of the time, but re-enable once a minute to log data to a web server. The way I do that is:
After every disconnect(), I see a log message as per the Issue subject, but it is repeated many times, seemingly one additional log message each time I disconnect. Now after running for around 12 hours, there are more than 600 repeated messages.
Settings in IDE
Module: NodeMcu, Wemos D1
Additional libraries:
Sketch
Debug Messages
@tablatronix commented on GitHub (Dec 22, 2021):
Thanks, I may have left some debugging on the wrong level when testing S2
@robjordan commented on GitHub (Dec 24, 2021):
Thanks, I appreciate you paying attention to this. I'm not sure I was clear though: it isn't just there is an unwanted debug output. I fear there might be something wrong in the code path, based on the increasing number of these WIFI_REASON messages, i.e. it appears 1x on the first wifiManager.disconnect();, 2x on the second, 3x on the third, Nx on the Nth. And N can be a very large number as I connect and disconnect once every minute. I had it appear literally 600 times in succession after running for a few hours.
@tablatronix commented on GitHub (Dec 25, 2021):
Interesting let me see if I can reproduce what version on esp lib you on?
@tablatronix commented on GitHub (Dec 25, 2021):
Oh nm I see you added all the info above
@tablatronix commented on GitHub (Dec 25, 2021):
WIFI_REASON_ASSOC_LEAVE = 8,
Are you perhaps creating new objects over and over again accidentally? That would make sense if creating more and more event listeners.
Can you share how you are reconnecting over and over? Or reduce your sketch to a simpler one, where is your wm object?
@robjordan commented on GitHub (Dec 26, 2021):
Hi. Not knowingly creating multiple objects. wifiManager is created in global scope. HTTP clients are created on the stack in local variables each time I do an HTTP post. The main loop is basically:
// ... block for 5 seconds checking for BLE advertisements
// ... check whether 1 minute has elapsed since we last logged, if so ...
if (wifiManager.autoConnect("SSID", "PW")) {
log_json(); // which makes an HTTP POST
wifiManager.disconnect();
}
I'll aim to create a simpler test case to reproduce. Maybe in a couple of days though. Thanks for help.
@robjordan commented on GitHub (Dec 27, 2021):
This test case (based on the WiFiManager basic example) demonstrates.
@robjordan commented on GitHub (Dec 27, 2021):
Debug output:
@tablatronix commented on GitHub (Feb 3, 2022):
Ever figure this out?
@robjordan commented on GitHub (Feb 3, 2022):
To be fair, I haven't updated the library since I reported it. It's not a
critical problem in my application because I reboot the esp32 every 24
hours. But as far as I know the problem still exists. Did you try the small
sample programme I posted?
On Thu, 3 Feb 2022, 02:25 Shawn A, @.***> wrote:
@tablatronix commented on GitHub (Feb 3, 2022):
I have to see which event that is
WIFI_REASON_ASSOC_LEAVE OR
8 SYSTEM_EVENT_STA_LOST_IP < ESP32 station lost IP and the IP is reset to 0
Something with your router I doubt its reproducible elsewhere
i can try it though
@tablatronix commented on GitHub (Feb 3, 2022):
Works fine for me
@robjordan commented on GitHub (Feb 4, 2022):
Ok, if not reproducible, it's not worth pursuing. Thanks for looking.
On Thu, 3 Feb 2022, 22:14 Shawn A, @.***> wrote:
@OekoSolveMG commented on GitHub (May 19, 2022):
I am assuming you use
autoConnect()to reconnect to the wifi while your application is running. Because if you do then this issue is probably because of the same reason as #1383. Hope this helps and is actually causing your problem, because if it does simply integrating the easy fix or using a different way to reconnect fixes that.@robjordan commented on GitHub (May 19, 2022):
Thanks, yes I do call autoconnect() repeatedly. I read the issue you mentioned and it's very useful info.
@tablatronix commented on GitHub (May 19, 2022):
This should be solved now