-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wifi_station_get_connect_status() doesn't handle connection lost under several circumstances #4810
Comments
Duplicate of #4792 . Closing. |
@EricMc1289 can you please try the proposed fix in #4792 and report whether it is working. |
Mostly the solution from #4792 doesn't solve my issue. When I use this patch the esp's completely loose wifi after some minutes / hours and can't connect to the station again. That happens to all esp's which are flashed with that patch. They can't reconnect, from the logs they try and run the wifi.begin code but they can't establish a connection and I have to restart them by software or power supply. |
@EricMc1289 another fix has come out some hours ago (#4843-comment). |
I'm working on wifi issues here and I run into the same issue as described here. Running with core 2.7.1 |
|
WiFi.isConnected() I'm typing from my phone now as the internet cable of our entire street is cut :( |
I'm typing from my phone now as the internet cable of our entire street is cut :(
You can use your computer and esp8266 as AP+nat + SIM800L as modem
...
arh, soon in fact
|
The cable has been restored from a backup, so you'll have a bit more time to implement it :) |
Closing as duplicate #7432, let's follow-up there ! |
Basic Infos
current
master branch (aka latest git).Platform
Settings in IDE
Problem Description
With the Version 2.4.1 I am encountering the problem, that sometimes the wifi_station_get_connect_status() method doesn't recognize a connection loss. It stays at STATION_GOT_IP even if the AP which the ESP is connected to is turned off. My biggest problem is, that it is hard to reproduce because this happens not every time the ap is turned off. The ap is a Fritzbox 4790. Sometimes it happens even without turning off the ap, just losing the connection and doesn't change the status. This does not happen in Version 2.3.x
MCVE Sketch
This is called periodically by a task scheduler, so there is no loop. And the task is definitely called once every 2 seconds. That's the first thing I checked.
station_status_t
status = wifi_station_get_connect_status();if (oldStatus != status) { //if status changed
fm.addLogEntry("stacha: " + String(oldStatus) + "->" + String(status), "WIFI");
oldStatus = status;
switch (status) {
case STATION_IDLE:
if (WiFi.getMode() != WIFI_AP_STA) {
wifiDriver::connect(2500);
} else {
wifiDriver::connect(30000);
}
fm.addLogEntry("WiFi idling SSID set to: " + WiFi.SSID(), "WIFI");
break;
case STATION_CONNECTING:
fm.addLogEntry("WiFi connecting to: " + WiFi.SSID(), "WIFI");
break;
The method
fm.addLogEntry` saves the output to the following logfile:[TASK] Mon Jun 11 22:38:34 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 22:38:34 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:38:35 2018: connection failed
[TASK] Mon Jun 11 22:38:35 2018: long: user-cloud | 1090ms
[CLOU] Mon Jun 11 22:39:54 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:40:01 2018: connection failed
[TASK] Mon Jun 11 22:40:01 2018: long: user-cloud | 6412ms
[CLOU] Mon Jun 11 22:41:14 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:41:20 2018: connection failed
[TASK] Mon Jun 11 22:41:20 2018: long: user-cloud | 5989ms
[CLOU] Mon Jun 11 22:42:34 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:42:41 2018: connection failed
[TASK] Mon Jun 11 22:42:41 2018: long: user-cloud | 6397ms
[TASK] Mon Jun 11 22:43:39 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 22:43:54 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:44:01 2018: connection failed
[TASK] Mon Jun 11 22:44:01 2018: long: user-cloud | 6696ms
[CLOU] Mon Jun 11 22:45:14 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:45:21 2018: connection failed
[TASK] Mon Jun 11 22:45:21 2018: long: user-cloud | 6222ms
[CLOU] Mon Jun 11 22:46:34 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:46:41 2018: connection failed
[TASK] Mon Jun 11 22:46:41 2018: long: user-cloud | 6672ms
[CLOU] Mon Jun 11 22:47:54 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:48:00 2018: connection failed
[TASK] Mon Jun 11 22:48:00 2018: long: user-cloud | 6070ms
[TASK] Mon Jun 11 22:48:44 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 22:49:14 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:49:21 2018: connection failed
[TASK] Mon Jun 11 22:49:21 2018: long: user-cloud | 6468ms
[CLOU] Mon Jun 11 22:50:34 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:50:40 2018: connection failed
[TASK] Mon Jun 11 22:50:40 2018: long: user-cloud | 5937ms
[CLOU] Mon Jun 11 22:51:54 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:52:01 2018: connection failed
[TASK] Mon Jun 11 22:52:01 2018: long: user-cloud | 6515ms
[CLOU] Mon Jun 11 22:53:14 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:53:21 2018: connection failed
[TASK] Mon Jun 11 22:53:21 2018: long: user-cloud | 6173ms
[TASK] Mon Jun 11 22:53:49 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 22:54:34 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:54:41 2018: connection failed
[TASK] Mon Jun 11 22:54:41 2018: long: user-cloud | 6597ms
[CLOU] Mon Jun 11 22:55:55 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:56:01 2018: connection failed
[TASK] Mon Jun 11 22:56:01 2018: long: user-cloud | 6062ms
[CLOU] Mon Jun 11 22:57:15 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:57:21 2018: connection failed
[TASK] Mon Jun 11 22:57:21 2018: long: user-cloud | 6587ms
[CLOU] Mon Jun 11 22:58:35 2018: Connecting to cloud service
[CLOU] Mon Jun 11 22:58:41 2018: connection failed
[TASK] Mon Jun 11 22:58:41 2018: long: user-cloud | 6097ms
[TASK] Mon Jun 11 22:58:54 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 22:59:55 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:00:01 2018: connection failed
[TASK] Mon Jun 11 23:00:01 2018: long: user-cloud | 6597ms
[CLOU] Mon Jun 11 23:01:15 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:01:21 2018: connection failed
[TASK] Mon Jun 11 23:01:21 2018: long: user-cloud | 5998ms
[CLOU] Mon Jun 11 23:02:35 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:02:41 2018: connection failed
[TASK] Mon Jun 11 23:02:41 2018: long: user-cloud | 6390ms
[TASK] Mon Jun 11 23:03:59 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:03:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:04:01 2018: connection failed
[TASK] Mon Jun 11 23:04:01 2018: long: user-cloud | 1495ms
[CLOU] Mon Jun 11 23:05:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:05:26 2018: connection failed
[TASK] Mon Jun 11 23:05:26 2018: long: user-cloud | 6804ms
[CLOU] Mon Jun 11 23:06:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:06:46 2018: connection failed
[TASK] Mon Jun 11 23:06:46 2018: long: user-cloud | 6307ms
[CLOU] Mon Jun 11 23:07:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:08:06 2018: connection failed
[TASK] Mon Jun 11 23:08:06 2018: long: user-cloud | 6930ms
[TASK] Mon Jun 11 23:09:04 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:09:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:09:26 2018: connection failed
[TASK] Mon Jun 11 23:09:26 2018: long: user-cloud | 6462ms
[CLOU] Mon Jun 11 23:10:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:10:46 2018: connection failed
[TASK] Mon Jun 11 23:10:46 2018: long: user-cloud | 6830ms
[CLOU] Mon Jun 11 23:11:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:12:06 2018: connection failed
[TASK] Mon Jun 11 23:12:06 2018: long: user-cloud | 6253ms
[CLOU] Mon Jun 11 23:13:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:13:26 2018: connection failed
[TASK] Mon Jun 11 23:13:26 2018: long: user-cloud | 6587ms
[TASK] Mon Jun 11 23:14:09 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:14:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:14:46 2018: connection failed
[TASK] Mon Jun 11 23:14:46 2018: long: user-cloud | 6913ms
[CLOU] Mon Jun 11 23:15:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:16:06 2018: connection failed
[TASK] Mon Jun 11 23:16:06 2018: long: user-cloud | 6212ms
[CLOU] Mon Jun 11 23:17:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:17:26 2018: connection failed
[TASK] Mon Jun 11 23:17:26 2018: long: user-cloud | 6684ms
[CLOU] Mon Jun 11 23:18:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:18:46 2018: connection failed
[TASK] Mon Jun 11 23:18:46 2018: long: user-cloud | 6167ms
[TASK] Mon Jun 11 23:19:14 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:19:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:20:06 2018: connection failed
[TASK] Mon Jun 11 23:20:06 2018: long: user-cloud | 6548ms
[CLOU] Mon Jun 11 23:21:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:21:25 2018: connection failed
[TASK] Mon Jun 11 23:21:25 2018: long: user-cloud | 5996ms
[CLOU] Mon Jun 11 23:22:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:22:46 2018: connection failed
[TASK] Mon Jun 11 23:22:46 2018: long: user-cloud | 6470ms
[CLOU] Mon Jun 11 23:23:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:24:06 2018: connection failed
[TASK] Mon Jun 11 23:24:06 2018: long: user-cloud | 6112ms
[TASK] Mon Jun 11 23:24:19 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:25:19 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:25:26 2018: connection failed
[TASK] Mon Jun 11 23:25:26 2018: long: user-cloud | 6435ms
[CLOU] Mon Jun 11 23:26:39 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:26:46 2018: connection failed
[TASK] Mon Jun 11 23:26:46 2018: long: user-cloud | 6675ms
[CLOU] Mon Jun 11 23:27:59 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:28:06 2018: connection failed
[TASK] Mon Jun 11 23:28:06 2018: long: user-cloud | 6192ms
[TASK] Mon Jun 11 23:29:24 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:29:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:29:25 2018: connection failed
[TASK] Mon Jun 11 23:29:25 2018: long: user-cloud | 1273ms
[CLOU] Mon Jun 11 23:30:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:30:51 2018: connection failed
[TASK] Mon Jun 11 23:30:51 2018: long: user-cloud | 6576ms
[CLOU] Mon Jun 11 23:32:04 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:32:10 2018: connection failed
[TASK] Mon Jun 11 23:32:10 2018: long: user-cloud | 5928ms
[CLOU] Mon Jun 11 23:33:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:33:31 2018: connection failed
[TASK] Mon Jun 11 23:33:31 2018: long: user-cloud | 6559ms
[TASK] Mon Jun 11 23:34:29 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:34:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:34:50 2018: connection failed
[TASK] Mon Jun 11 23:34:50 2018: long: user-cloud | 6038ms
[CLOU] Mon Jun 11 23:36:04 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:36:11 2018: connection failed
[TASK] Mon Jun 11 23:36:11 2018: long: user-cloud | 6568ms
[CLOU] Mon Jun 11 23:37:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:37:30 2018: connection failed
[TASK] Mon Jun 11 23:37:30 2018: long: user-cloud | 6074ms
[CLOU] Mon Jun 11 23:38:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:38:51 2018: connection failed
[TASK] Mon Jun 11 23:38:51 2018: long: user-cloud | 6365ms
[TASK] Mon Jun 11 23:39:34 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:40:04 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:40:11 2018: connection failed
[TASK] Mon Jun 11 23:40:11 2018: long: user-cloud | 6827ms
[CLOU] Mon Jun 11 23:41:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:41:31 2018: connection failed
[TASK] Mon Jun 11 23:41:31 2018: long: user-cloud | 6254ms
[CLOU] Mon Jun 11 23:42:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:42:51 2018: connection failed
[TASK] Mon Jun 11 23:42:51 2018: long: user-cloud | 6616ms
[CLOU] Mon Jun 11 23:44:04 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:44:11 2018: connection failed
[TASK] Mon Jun 11 23:44:11 2018: long: user-cloud | 6174ms
[TASK] Mon Jun 11 23:44:39 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:45:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:45:31 2018: connection failed
[TASK] Mon Jun 11 23:45:31 2018: long: user-cloud | 6520ms
[CLOU] Mon Jun 11 23:46:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:46:51 2018: connection failed
[TASK] Mon Jun 11 23:46:51 2018: long: user-cloud | 6092ms
[CLOU] Mon Jun 11 23:48:04 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:48:11 2018: connection failed
[TASK] Mon Jun 11 23:48:11 2018: long: user-cloud | 6525ms
[CLOU] Mon Jun 11 23:49:24 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:49:31 2018: connection failed
[TASK] Mon Jun 11 23:49:31 2018: long: user-cloud | 5995ms
[TASK] Mon Jun 11 23:49:44 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:50:44 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:50:51 2018: connection failed
[TASK] Mon Jun 11 23:50:51 2018: long: user-cloud | 6451ms
[CLOU] Mon Jun 11 23:52:05 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:52:11 2018: connection failed
[TASK] Mon Jun 11 23:52:11 2018: long: user-cloud | 5893ms
[CLOU] Mon Jun 11 23:53:25 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:53:31 2018: connection failed
[TASK] Mon Jun 11 23:53:31 2018: long: user-cloud | 6183ms
[TASK] Mon Jun 11 23:54:49 2018: long: system-updater | 4883ms
[CLOU] Mon Jun 11 23:54:49 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:54:50 2018: connection failed
[TASK] Mon Jun 11 23:54:50 2018: long: user-cloud | 1243ms
[CLOU] Mon Jun 11 23:56:09 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:56:16 2018: connection failed
[TASK] Mon Jun 11 23:56:16 2018: long: user-cloud | 6662ms
[CLOU] Mon Jun 11 23:57:29 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:57:35 2018: connection failed
[TASK] Mon Jun 11 23:57:35 2018: long: user-cloud | 6070ms
[CLOU] Mon Jun 11 23:58:49 2018: Connecting to cloud service
[CLOU] Mon Jun 11 23:58:56 2018: connection failed
[TASK] Mon Jun 11 23:58:56 2018: long: user-cloud | 6538ms
[TASK] Mon Jun 11 23:59:54 2018: long: system-updater | 4883ms
[CLOU] Tue Jun 12 00:00:09 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:00:15 2018: connection failed
[TASK] Tue Jun 12 00:00:15 2018: long: user-cloud | 5889ms
[CLOU] Tue Jun 12 00:01:29 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:01:36 2018: connection failed
[TASK] Tue Jun 12 00:01:36 2018: long: user-cloud | 6344ms
[CLOU] Tue Jun 12 00:02:49 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:02:56 2018: connection failed
[TASK] Tue Jun 12 00:02:56 2018: long: user-cloud | 6716ms
[CLOU] Tue Jun 12 00:04:09 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:04:16 2018: connection failed
[TASK] Tue Jun 12 00:04:16 2018: long: user-cloud | 6210ms
[TASK] Tue Jun 12 00:04:59 2018: long: system-updater | 4883ms
[CLOU] Tue Jun 12 00:05:29 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:05:36 2018: connection failed
[TASK] Tue Jun 12 00:05:36 2018: long: user-cloud | 6732ms
[CLOU] Tue Jun 12 00:06:49 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:06:56 2018: connection failed
[TASK] Tue Jun 12 00:06:56 2018: long: user-cloud | 6238ms
[CLOU] Tue Jun 12 00:08:09 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:08:16 2018: connection failed
[TASK] Tue Jun 12 00:08:16 2018: long: user-cloud | 6519ms
[CLOU] Tue Jun 12 00:09:29 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:09:35 2018: connection failed
[TASK] Tue Jun 12 00:09:35 2018: long: user-cloud | 5969ms
[TASK] Tue Jun 12 00:10:04 2018: long: system-updater | 4883ms
[CLOU] Tue Jun 12 00:10:49 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:10:56 2018: connection failed
[TASK] Tue Jun 12 00:10:56 2018: long: user-cloud | 6492ms
[CLOU] Tue Jun 12 00:12:09 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:12:16 2018: connection failed
[TASK] Tue Jun 12 00:12:16 2018: long: user-cloud | 6885ms
[CLOU] Tue Jun 12 00:13:29 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:13:36 2018: connection failed
[TASK] Tue Jun 12 00:13:36 2018: long: user-cloud | 6292ms
[CLOU] Tue Jun 12 00:14:49 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:14:56 2018: connection failed
[TASK] Tue Jun 12 00:14:56 2018: long: user-cloud | 6729ms
[TASK] Tue Jun 12 00:15:09 2018: long: system-updater | 4883ms
[CLOU] Tue Jun 12 00:16:10 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:16:16 2018: connection failed
[TASK] Tue Jun 12 00:16:16 2018: long: user-cloud | 6186ms
[CLOU] Tue Jun 12 00:17:30 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:17:36 2018: connection failed
[TASK] Tue Jun 12 00:17:36 2018: long: user-cloud | 6633ms
[CLOU] Tue Jun 12 00:18:50 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:18:56 2018: connection failed
[TASK] Tue Jun 12 00:18:56 2018: long: user-cloud | 6050ms
[TASK] Tue Jun 12 00:20:14 2018: long: system-updater | 4883ms
[CLOU] Tue Jun 12 00:20:14 2018: Connecting to cloud service
[CLOU] Tue Jun 12 00:20:15 2018: connection failed
[TASK] Tue Jun 12 00:20:15 2018: long: user-cloud | 1313ms
[CLOU] Tue Jun 12 00:21:34 2018: Connecting to cloud service
At the moment of the log is caught the ESP was not connected to the ap, I checked this by the admin view of the router and the connectivity to the app. And the most interesting thing is, that it logs "Connecting to cloud service". This service shall only try to connect if there is a wifi connection. Because the task of the Cloud service starts with:
if (WiFi.status() == WL_CONNECTED) {
Hope someone just knows why the wifi_station_get_connect_status() doesn't update after a connection loss.
The text was updated successfully, but these errors were encountered: