mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #849] ESP8266 WifiManager Reconnection and Intermittent connections failure #712
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#712
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 @LeoCharpentier on GitHub (Mar 15, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/849
Hello,
I have been using esp8266 for several months now, and I still have some problems that persist. It is exclusively related to wifi communication, and I can not find real solutions.
This problem is important because my code is used exclusively for the management of actuators (water pump, ventilation, heating, etc.), to control the cultivation above ground of my strawberries.
Sensor measurements sent and stored on server, and management commands retrieved from the server at regular intervals.
- FIRST PROBLEM (Reconnection) :
I am using the "WifiManager" library to automate my connections to the internet router, so that my esp8266 can easily manage a router if it were to be modified. However, I can not make reconnections that work when I lose communication ...
My WifiManager.autoConnect function (XXX, XXX) works fine in the setup (), but when the connection disappears in the loop (), I can not hang it correctly.
For that I tested different things ...
The re-connection with the function "WifiManager.autoconnect ()" directly in the loop () after having recreated and reset my object "WifiManager wifiManager" as seen on this forum:
Reconnect after setup #738
I have voluntarily added detection conditions to identify a sure way a disconnection with the wifi router, thanks to the response of this forum:
ESP8266 - WiFi status not changing
My test code is then:
But no concrete results, impossible to reconnect. No problem in detecting the disconnection between the ESP8266 and the router, but the WifiManager present in the loop (), can not "hang up" the router when it is turned on and operational.
Here is the result of the serial monitor:
Considering the lack of solution concerning the reconnection of the router, I apply a rather aggressive patch to my system so as not to lose the connection forever: ESP.restart ();
This temporary solution is now reaching its limits because my actuators are constantly restarting and do not manage my culture correctly ... ..
Do you have a solution ?
Is there a way to reset the wifi settings, between the detection and the first reconnection of the WifiManager in the loop ()?
I'm desperate …
When I am connected, I use a "WiFiClientSecure" in HTTPS on my secure server, to make an HTTP GET on port 443.
Everything works fine, but intempessively, I observe several "Connection failed" as below:
What parameters can have a relationship with these connection failures?
What is the good radio signal range to avoid this?
Is there timeout to adjust at the ESP, server or mysql level?
I do not understand why suddenly connections can fail without too much reason ...
Good day, thank you.
@LeoCharpentier commented on GitHub (Mar 15, 2019):
@tzapu ?
@tzapu commented on GitHub (Mar 15, 2019):
WiFiManager is not really meant to be used that way. It can't control loosing connections, that s what the esp sdk and firmware are doing.
I would say you configure WiFiManager to connect only when you press a button, or only when there are no credentials, but only at boot. If you are loosing connection when the esp has already started and after it connected, you probably need to check your module or your network/router.
@tablatronix commented on GitHub (Mar 15, 2019):
the esp8266 automatically reconnnects wifi if you have autoconnect enabled, wifimanager is not needed for that at all, unless you are using static ips and stuff, then yeah you may have issues.
you may want to make sure you are setting wifi_sta mode in your code to make sure softap is not running when it is not supposed to be.
Also wifi can start failing if your power is not good enough, try boosting it or adding a large capacitor
@LeoCharpentier commented on GitHub (Mar 20, 2019):
OK, thanks !
What capacitor value does it take?
@tablatronix commented on GitHub (Mar 20, 2019):
no idea, what is your power supply?
@LeoCharpentier commented on GitHub (Mar 26, 2019):
3,3v with battery supply and regulator
@tablatronix commented on GitHub (Mar 26, 2019):
Can it supply 500ma ?
@joao16mariano commented on GitHub (Oct 25, 2021):
Boa tarde a amigo.
Um modo prático de resolver seu problema é colocar um delay dentro do setup() por exemplo 40 segundos, com isso caso falte energia o esp atrasa um pouco dando tempo do roteador iniciar.