Skip to content
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

Closed
5 of 6 tasks
EricMc1289 opened this issue Jun 12, 2018 · 10 comments
Closed
5 of 6 tasks

Comments

@EricMc1289
Copy link

EricMc1289 commented Jun 12, 2018

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in the current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP12-E & ESP01
  • Core Version: 2.4.1
  • Development Env: Arduino IDE (Visual Micro in VS)
  • Operating System: Windows

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: dio
  • Flash Size: 4MB(ESP12-E) | 1MB(ESP01)
  • lwip Variant: v2 Lower Memory
  • Reset Method: ck
  • Flash Frequency: 40Mhz
  • CPU Frequency: 160MHz
  • Upload Using: SERIAL
  • Upload Speed: 115200

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;

		case STATION_WRONG_PASSWORD:
			if (WiFi.getMode() != WIFI_AP_STA) {
				startAP();
			}
			fm.addLogEntry(F("WiFi wrong Password"), "WIFI");
		break;

		case STATION_NO_AP_FOUND: 
			fm.addLogEntry(F("Network not found"), "WIFI");
			wifiDriver::connect(15000);
		break;
		
		case STATION_CONNECT_FAIL:
			fm.addLogEntry(F("WiFi connection failed"), "WIFI");
			wifiDriver::connect(15000);
		break;
		
		case STATION_GOT_IP:
			fm.addLogEntry("WiFi Connected to: " + WiFi.SSID() + " with IP: " + WiFi.localIP().toString(), "WIFI");
			lastConnected = millis();
			
			if (WiFi.getMode() != WIFI_STA) {
				WiFi.mode(WIFI_STA);
				fm.addLogEntry(F("AP stopped"), "WIFI");
				dnsServer.stop();
			}
			wifiData userWiFi;
			EEPROM.get(EEPROMSTART_WIFI, userWiFi);
			if (userWiFi.channel != WiFi.channel() || memcmp(userWiFi.bssid, WiFi.BSSID(), sizeof(userWiFi.bssid)!=0) || !WiFi.SSID().equals(userWiFi.ssid)) {
				memcpy(userWiFi.bssid, WiFi.BSSID(), 7);
				userWiFi.channel = WiFi.channel();
				EEPROM.put(EEPROMSTART_WIFI, userWiFi);
				EEPROM.commit();
			}
		break;
		default:
			fm.addLogEntry("Unknown wifi state: "+String(status), "WIFI");
			break;
	}

} else {
	if (status == STATION_GOT_IP) {
		lastConnected = millis();
         }
}

The methodfm.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.

@devyte
Copy link
Collaborator

devyte commented Jun 17, 2018

Duplicate of #4792 . Closing.

@devyte devyte closed this as completed Jun 17, 2018
@d-a-v
Copy link
Collaborator

d-a-v commented Jun 18, 2018

@EricMc1289 can you please try the proposed fix in #4792 and report whether it is working.
We will reopen if that's not the case.

@EricMc1289
Copy link
Author

EricMc1289 commented Jun 25, 2018

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.

@d-a-v
Copy link
Collaborator

d-a-v commented Jun 25, 2018

@EricMc1289 another fix has come out some hours ago (#4843-comment).
It may solve your reconnection issue, although it does not solve #4843 yet.
About the disconnection issue, and without more details, you may have a look to #4658's proposals.
Please try, and please report.

@d-a-v d-a-v reopened this Jun 25, 2018
@TD-er
Copy link
Contributor

TD-er commented Jul 6, 2020

I'm working on wifi issues here and I run into the same issue as described here.
I do have a connection (webserver serves pages) but WiFi.connected() returns false.
This happens every now and then when I perform a quick reconnect (with bssid and channel) or kick the esp node from the AP (web interface of mikrotik)

Running with core 2.7.1

@d-a-v
Copy link
Collaborator

d-a-v commented Jul 6, 2020

WiFi.connected() or WiFi.status() == WL_CONNECTED ?
After 2.7.2 is released, we will work on core-v3 with #6680 among nice others, which will have a more direct link to network interfaces and lwIP. lwIP is generally well told/teached about wlan connectivity so maybe we can have a better view of the network state.

@TD-er
Copy link
Contributor

TD-er commented Jul 6, 2020

WiFi.isConnected()
So the same as your mentioned compare of the status.

I'm typing from my phone now as the internet cable of our entire street is cut :(

@d-a-v
Copy link
Collaborator

d-a-v commented Jul 6, 2020 via email

@TD-er
Copy link
Contributor

TD-er commented Jul 6, 2020

The cable has been restored from a backup, so you'll have a bit more time to implement it :)

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 31, 2021

Closing as duplicate #7432, let's follow-up there !

@d-a-v d-a-v closed this as completed Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants