main/task_wifi.c

changeset 5
b1f38105ca7e
parent 4
d0155c16e992
child 6
bad3414f7bc4
--- a/main/task_wifi.c	Wed Mar 29 21:39:07 2023 +0200
+++ b/main/task_wifi.c	Thu Mar 30 17:05:05 2023 +0200
@@ -104,7 +104,7 @@
                 } else {
 		    ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_STA_DISCONNECTED");
 		}
-//		connect_mqtt(false);
+		connect_mqtt(false);
                 xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED);
                 xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED);
 		break;
@@ -135,7 +135,7 @@
 		} else {
 			ESP_LOGE(TAG, "got_ip_event_handler() lock error IP_EVENT_STA_GOT_IP");
 		}
-//		connect_mqtt(true);
+		connect_mqtt(true);
 		break;
 
 	case IP_EVENT_STA_LOST_IP:
@@ -150,7 +150,7 @@
 		} else {
 			ESP_LOGE(TAG, "got_ip_event_handler() lock error IP_EVENT_STA_LOST_IP");
 		}
-//		connect_mqtt(false);
+		connect_mqtt(false);
 		break;
 
 	case IP_EVENT_AP_STAIPASSIGNED:
@@ -227,7 +227,7 @@
 	    /*
 	     * user requested a disconnect, this will in effect disconnect the wifi
 	     */
-//	    connect_mqtt(false);
+	    connect_mqtt(false);
 	    ESP_LOGI(TAG, "Request STA disconnect");
 	    ESP_ERROR_CHECK(esp_wifi_disconnect());
 	    xEventGroupWaitBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED, pdFALSE, pdTRUE, portMAX_DELAY );

mercurial