mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #786] Intermitent error only on PlatformIO (connects, portal -> loop) #659
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#659
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 @martinberlin on GitHub (Dec 16, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/786
Basic Infos
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
ESP Core Version: 2.4.0, staging
Description
I'm struggling to find out why compiling WifiManager in platformIO gives me this strange bug. It's simply that one time it connects, next time does not, and so on.
I thought that it was the connectTimeout that was too short but of course, it's not that.
NOTE: This happens only compiling stuff with platformIO (Does not matter what ESP32 board)
In other projects, I compiled this with Arduino and I didn't have this problem at all. So what I would like to know without making you lose your precious time is how can I help to debug this to the bone and find out what is causing this.
NOTE: I'm trying this with the camera project but I completely stripped it out, leaving only:
wm.autoConnect(configModeAP);
Not any other thing that may interfere just left it like this to test what may be happening.
Question: wm.setConnectTimeout(10); // what are there millis ?
*WM: [1] AutoConnect
*WM: [2] ESP32 event handler enabled
*WM: [2] Connecting as wifi client...
*WM: [2] setSTAConfig static ip not set
*WM: [3] WIFI station disconnect
*WM: [1] Connecting to saved AP: KabelBox-A210
*WM: [3] WiFi station enable
*WM: [2] 10000 ms connectTimeout set
*WM: [2] 10000 ms timeout, waiting for connect...
*WM: [2] .
*WM: [2] . many of this
*WM: [2] Connection result: WL_CONNECT_FAILED
*WM: [3] lastconxresulttmp: WL_IDLE_STATUS
*WM: [3] lastconxresult: WL_CONNECT_FAILED
*WM: [1] AutoConnect: FAILED
*WM: [3] WIFI station disconnect
*WM: [3] WiFi station enable
*WM: [2] Disabling STA
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: CAM-autoconnect
*WM: [2] AP has anonymous access!
*WM: [1] AP IP address: 192.168.4.1
And when it connects:
*WM: [1] AutoConnect
*WM: [2] ESP32 event handler enabled
*WM: [2] Connecting as wifi client...
*WM: [2] setSTAConfig static ip not set
*WM: [3] WIFI station disconnect
*WM: [1] Connecting to saved AP: KabelBox-A210
*WM: [3] WiFi station enable
*WM: [2] 10000000 ms connectTimeout set
*WM: [2] 38528 ms timeout, waiting for connect...
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] .
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] AutoConnect: SUCCESS
*WM: [1] STA IP Address: 192.168.0.36
@tablatronix commented on GitHub (Dec 16, 2018):
I would assume you are using a different esp32 verison, Check info page and compare the 2, I cannot think of anythink else that would cause difference with pio, unless you have debug on or some other change
@tablatronix commented on GitHub (Dec 16, 2018):
Same router?
@tablatronix commented on GitHub (Dec 16, 2018):
I would compare the info pages and see if there are any differences listed. Memory size? Speed, version etc
@martinberlin commented on GitHub (Dec 17, 2018):
Will do it. It does not matter if it's at home or with my mobile hotspot. Same behaviour. One time connects, next time opens Portal, and so on.
So I will just capture a snapshot of the info page on PlataformIO and then compile the same with Arduino and do the same. There has to be something fishy, maybe low Heap memory ?
The only difference is that on PlataformIO I configured the FS different and I'm leaving about 5MB for SPIFFs.
https://github.com/martinberlin/FS32/blob/master/fs_partition.csv -> Maybe it's a different FS partition configuration the root of all problems here
Can be? Because on Arduino I just leave all those to default and I have no idea what FS configuration applies, I just see that this problem does not come. WiFi library connects 99% of the time like it should do!
@tablatronix commented on GitHub (Dec 17, 2018):
Very strange, what if you do not call autoconnect and just begin() and connected loop
@tablatronix commented on GitHub (Dec 17, 2018):
I just remembered someone else posted a similar issue and it also made no sense. Ill see if I can find it, maybe look around or search for similar words if you have time. It was every other restart it would not connect, or only if unplugged it would connect. Some weird issue like that.
But I thought it was esp8266 not 32
Maybe it has something todo with router still thinks you are connected and refuses connection
Try adding a good delay before autoconnect
@martinberlin commented on GitHub (Dec 18, 2018):
YES! Got it.
It's like this: On a quick restart, I get always this intermitent YES / NO (Open portal) situation.
If I wait at least 15 seconds, leaving it off, and then starting it again it always connect. Between 12/14 seconds it's the least I can wait. I can live with it is not a problem!
But I would like to know why. And specially why it does not happen when I compile this with Arduino !
@tablatronix commented on GitHub (Dec 18, 2018):
Did you ever check to make sure you are using the same verison, maybe you have arduino set to use a different lwip version ? or have debugging on or off, ESP debugging can reveal or hide bugs sometimes
@martinberlin commented on GitHub (Dec 18, 2018):
Didn't find time to test more but I just checked, WiFi Manager is same version exactly (development)
but ESP32 core is not.
https://github.com/platformio/platform-espressif32.git#feature/stage -> PlataformIO
Arduino -> Default esp32 v. 1.0.0
That can be the thing! Anyways I will debug it more. You can close this one if it bothers to have many things open. It's actually not a bug in your library but an issue compiling it in different platforms (If I'm thinking right)
@tablatronix commented on GitHub (Dec 19, 2018):
there is a problem with esp reporting 00000 as version in platformio, so you have to manually check
are you using
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage@martinberlin commented on GitHub (Dec 19, 2018):
Yes, feature/stage but for Espressif32 core. Thanks for the info!
@tablatronix commented on GitHub (Dec 19, 2018):
oops yeah thats what I meant.
I will try to reproduce, and reread what I think the problem was in that other issue. What happens if you reboot the eso not reset, same thing ?
@tablatronix commented on GitHub (Dec 20, 2018):
have you tried with basic example ?
Is your wm object global?
@tablatronix commented on GitHub (Dec 20, 2018):
can you save the 2 bin files and put them somewhere?
@tablatronix commented on GitHub (Dec 20, 2018):
@tablatronix commented on GitHub (Dec 20, 2018):
Cannot reproduce, I can hit reset button and connect everytime. Using ondemandcp example
@martinberlin commented on GitHub (Dec 20, 2018):
No, but I will try with a new ESP32 that Heltec people sent me, also without the camera project. I'm suspecting that some of my stuff may be interferencing with WM.
Yes, it's actually in a clon of the Camera project but using the esp32 version
Sure, I still don't know how to do this with plataformIO but I will google it ;)
@tablatronix commented on GitHub (Dec 20, 2018):
yeah it will be saved in your build folder after compile
@martinberlin commented on GitHub (Jan 6, 2019):
Hello, long time no talk, I'm already recovered and ready to start a new year of fun.
https://storage.luckycloud.de/f/704030ca95374d399663/
Uploaded whole .pioenvs/lolin_d32 folder. Using a Wemos ESP32 since I do not need any fancy display since I'm using my own TFT. I really like this version with double SPI. It works really fast and uploads a 150 Kb picture in about 4 seconds with good WiFi.
By the way is still like I described before, just waiting about 20/30 seconds between disconnects it works fine, leaving this intermittent error only when you want to restart fast (Is annoying anyways but I can live with it)
ONE important thing since you mentioned: platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
I'm using ESP32 in this thing for now :)
@tablatronix commented on GitHub (Jan 6, 2019):
Thanks I will have a look
@martinberlin commented on GitHub (Jan 9, 2019):
An ESP32-WROOM-32D is coming my way so I will try to debug this with PlataformIO, keeping you updated
@martinberlin commented on GitHub (Jan 11, 2019):
I figured out something interesting with this one.
I was using for this test a Heltec ESP32 Wifi but compiling because I got some SPI erros it using board:
[env:lolin_d32]
platform = espressif32
board = lolin_d32
Now I changed this to the right board:
And the problem seems to have disappeared. So it was a configuration error on my side, I guess different boards have slight different settings for the WiFi, can it be ?
Anyways not an error from WiFi Manager itself so closing this one.
@tablatronix commented on GitHub (Jan 11, 2019):
I would not think so, unless the memory is wrong. you can check boards file for difference, or verbose output and check the build command
@tablatronix commented on GitHub (Jan 11, 2019):
I use the esp32 dev or the doit board definition, most designs follow these pinouts
@1technophile commented on GitHub (Apr 8, 2020):
I had also this issue with ESP32, here is more info about it:
https://github.com/espressif/arduino-esp32/issues/2501
@tablatronix commented on GitHub (Apr 8, 2020):
This issue is so sporadic its hard to determine if its an actual bug, I still am going with a race condition, I experienced it once and it immediately resolved itself.
@1technophile commented on GitHub (Apr 8, 2020):
In my side I was able to reproduce it one time out of 2, in all the case it is not a WifiManager issue, it is more related to ESP32 Arduino Framework or the ESP32