mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Improve WiFi disconnect messages (#857)
* Improve WiFi disconnect messages * Fix * Update wifi_component_esp32.cpp
This commit is contained in:
		| @@ -329,8 +329,12 @@ void WiFiComponent::wifi_event_callback_(system_event_id_t event, system_event_i | ||||
|       char buf[33]; | ||||
|       memcpy(buf, it.ssid, it.ssid_len); | ||||
|       buf[it.ssid_len] = '\0'; | ||||
|       ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason=%s", buf, | ||||
|                format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); | ||||
|       if (it.reason == WIFI_REASON_NO_AP_FOUND) { | ||||
|         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf); | ||||
|       } else { | ||||
|         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason='%s'", buf, | ||||
|                  format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); | ||||
|       } | ||||
|       break; | ||||
|     } | ||||
|     case SYSTEM_EVENT_STA_AUTHMODE_CHANGE: { | ||||
|   | ||||
| @@ -330,8 +330,12 @@ void WiFiComponent::wifi_event_callback(System_Event_t *event) { | ||||
|       char buf[33]; | ||||
|       memcpy(buf, it.ssid, it.ssid_len); | ||||
|       buf[it.ssid_len] = '\0'; | ||||
|       ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=%s reason='%s'", buf, format_mac_addr(it.bssid).c_str(), | ||||
|                get_disconnect_reason_str(it.reason)); | ||||
|       if (it.reason == REASON_NO_AP_FOUND) { | ||||
|         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf); | ||||
|       } else { | ||||
|         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason='%s'", buf, | ||||
|                  format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); | ||||
|       } | ||||
|       break; | ||||
|     } | ||||
|     case EVENT_STAMODE_AUTHMODE_CHANGE: { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user