mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1371] Example is starting configuration Portal twice #1174
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#1174
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 @ChristophCaina on GitHub (Mar 10, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1371
Hi, I am trying some of your examples provided here and it seems that I run into an issue...
Currently, the following Example Sketch was used: AutoConnectNonBlocking.ino
I am trying to create a configuration portal and a Wifi Network with a specific SSID...
When Running the sketch I can see, that this is working as expected in the Serial Monitor - but then, the code starts to repeate (before the Portal timeout has been reached) and then, it is using a different SSID than given in my code...
Here's the Output from the serial monitor
This is my current code (100% from the examples)
I am using an ESP 8266 based WeMos D1 R2 ... if that may help?!
@tablatronix commented on GitHub (Mar 10, 2022):
`
@ChristophCaina commented on GitHub (Mar 11, 2022):
Hi, just another question so far:
Can you please explain, why this seems to run in a loop?
and after that, it is starting again with:
The code is still the same as given in the Example sketch I've mentioned above... (with the fix provided in your previous comment)
and what does the [x] after wm: mean?
Is this the instance of the wm or is this some kind of log-level?
@tablatronix commented on GitHub (Mar 11, 2022):
Yes, Its the logging level
you are calling
wm.resetSettings();on every boot.@ChristophCaina commented on GitHub (Mar 11, 2022):
ok, thanks.
the "reset" was due to current development - and I want to reset the settings on each "reboot" of the board... but the current behave happens without any reboot (at least, I don't see the board rebooting)...
it's just immediately visible after uploading the code to the board... then it is running throught 1) and immediately the second block happens.
So, is the chip rebooting when it could not connect to an existing network / no network information can be found?
@tablatronix commented on GitHub (Mar 11, 2022):
ohh let me check if this is a bug, you have non blocking false but commented out process ? thats wrong
@ChristophCaina commented on GitHub (Mar 11, 2022):
process was just commented out for a test when I copied the code :)
@tablatronix commented on GitHub (Mar 11, 2022):
There is no other serial output between those? I mean it totally looks like its restarting
add a println starting.... to the setup
where does this come from ?
12:23:08.421 -> Configportal running@ChristophCaina commented on GitHub (Mar 12, 2022):
that's from this code...
I have just used the code given in the example without any further changes...
@ChristophCaina commented on GitHub (Mar 12, 2022):
Maybe, a bit more information:
As you can see in my first post, it was first starting with the SSID I've set in the wm.autoConnect() - but then printing the serial.println from the "else" statement.
Immediately after that, it "restarted" and used the wm.startConfigPortal(); where I haven't used my SSID - and due to that, it took the default ESP..... whatever SSID.
in my tests, I've commented the wm.process() from the loop out, to see, if that might cause this behave - but it didn't change anything
@tablatronix commented on GitHub (Mar 12, 2022):
Oh yeah i ran this and it works fine. So no clue, sounds like your esp has to be rebooting
@ChristophCaina commented on GitHub (Mar 12, 2022):
hm... thanks for your test.
Would you be so kind and share your code & serial output, that I can compare it and run another test?
I would really like to understand what my ESP is doing here - and therefore trying to figure out, how I could extend / debug this on my side...
@tablatronix commented on GitHub (Mar 13, 2022):
Add a println in setup that outputs millis() it should be obvious is it restarts, could be a brownout all these should show startup code in serial though… so its odd i ran your example exactly
@ChristophCaina commented on GitHub (Mar 13, 2022):
hm... sorry... no reboot during the startup:
@tablatronix commented on GitHub (Mar 14, 2022):
Oh thats so odd.. is this an esp32 ?
@tablatronix commented on GitHub (Mar 14, 2022):
Is this with process?
@tablatronix commented on GitHub (Mar 14, 2022):
nm, I have it reproduced here!
@tablatronix commented on GitHub (Mar 14, 2022):
I mean this is technically not a bug, you are just starting the CP twice, which should be ok say you want to change the credentials, but I am going to add a check and fail to avoid confusion.
@ChristophCaina commented on GitHub (Mar 14, 2022):
thanks :) - and sorry for not replying directly... (timezones^^)
it is an WeMos D1 R2 (ESP8266), it was with wm.process() - but the same applies without wm.process();
The main idea (and I think that's what this cp is for was):
To provide the cp to allow a customer to change the "default" WiFi Settings to his own WiFi - therefore, there's no reason to start the CP twice, when it can't find any saved credentials.
So, yes, while it shouldn't be a big issue - it was confusing a bit :)
Thanks for having a look into it again - really appreciated (y)
Now, I need to see how I can setup the CP websites itself... ^^
@tablatronix commented on GitHub (Mar 14, 2022):
Yeah the example is confusing and wrong, ill update it also.
Not sure what was going on there, but yeah autoconnect will do that automatically unless you use the option to disable it.
@ChristophCaina commented on GitHub (Mar 14, 2022):
one more question:
How can I print the SSID of the "configPortal" when it is connected / started?
I read something about WiFi.SSID() ... but not sure, if this is working within the ConfigPortal() too, or only when it could connect to a stored WiFi...
And would this work?
So, I would expect, the manager is trying to do an AutoConnect() to the saved network - and if this should fail, it will start the CP with the specified "autoSSID"...