mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1129] ModemSleep Esp8266 and Wifi Manager #967
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#967
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 @floatAsNeeded on GitHub (Sep 21, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1129
Hi all!
I'm not sure whether is an issue, but I'm using the library together with a modem sleep. Basically the code runs for 4.5 minutes in modem sleep and then it connects to the wifi and transmits some data and then the Wifi would go off again.
It is working perfectly, but just sometimes, like for example once in a day (Is running 24/7) is doesn't connect to the wifi and it goes in AP mode waiting to be configured. I just want to ask if I'm using the right method.
This is my function where it connects and then goes to modem sleep:
In the setup I just simply this for connection:
Of course I already have in the code the following:
Do you think I can improve somehow this?
I'm using a Wemos D1 mini pro and external antenna.
Thank you in advance!
@tablatronix commented on GitHub (Sep 21, 2020):
In this case I would avoid using autoconnect and manually start up cp when needed to avoid this.
You can also make sure you are setting a portal timeout so it doesn't sit there.
@floatAsNeeded commented on GitHub (Sep 22, 2020):
Hi! Thank you for your answer!
You mean to put in the code already the Wifi information like password and name?
For the purpose of my project, I really need to use Autoconnect because I want to set up the wifi connection not by software in case I want to use different networks in different locations of the world also.
I'm using at the moment this code, as you suggested to put a portal timeout
I'm running in the setup this
and in the loop this
Basically, if it fails to connect it goes to sleep for 1 minute and then would try again and again until it connects. In this case just if for real you need to set up the network it won't connect, but it should avoid the fact to get stuck in case of just missed connection. I'm then running in the loop just simple Wifi.begin
What do you think about this? And also if you could explain that CP startup. Thanks! :)
@tablatronix commented on GitHub (Sep 22, 2020):
Well you can maybe add a timer and if you cannot reconnect after 3 retries, then start configportal. Or run your own check and and use button press etc
@floatAsNeeded commented on GitHub (Sep 22, 2020):
Yes, I also added a timer, but just in the loop, because in the setup there is already the portal timeout.
So basically I'm putting the loop :
In case it takes more than 30 seconds to establish a connection it goes to sleep, just for saving power purpose and then try again from setup.
In setup, if it fails it still will try until everything is not set as it should. I think unless for real the network is not available anymore, it should work this way!
@tablatronix commented on GitHub (Sep 22, 2020):
yeah you can do it like that, I mean you do not necessarily need to reboot, but that works ok also if its a hardware issue.
@floatAsNeeded commented on GitHub (Sep 22, 2020):
Yeah, I prefer to do it like that also for what you mention and also I want to take every chance to save a bit power, otherwise, it would be continuously using at least 75mA, until connection is not established. At least sleeping for 1 minute can provide me a bit of saving of energy. In my project, I'm using a solar panel and a battery so I need to do that :D Thanks for the help