From d2be58ba31793e43d72a11cbc1559a0706faa866 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 8 Jun 2019 16:47:27 +0200 Subject: [PATCH] Work around ESP32 core WiFi Bug (#627) * Work around ESP32 WiFi Bug * Lint --- esphome/components/wifi/wifi_component.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index ceca9f1a1b..28ff54826f 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -246,7 +246,11 @@ void print_signal_bars(int8_t rssi, char *buf) { } void WiFiComponent::print_connect_params_() { - uint8_t *bssid = WiFi.BSSID(); + uint8_t bssid[6] = {}; + uint8_t *raw_bssid = WiFi.BSSID(); + if (raw_bssid != nullptr) + memcpy(bssid, raw_bssid, sizeof(bssid)); + ESP_LOGCONFIG(TAG, " SSID: " LOG_SECRET("'%s'"), WiFi.SSID().c_str()); ESP_LOGCONFIG(TAG, " IP Address: %s", WiFi.localIP().toString().c_str()); ESP_LOGCONFIG(TAG, " BSSID: " LOG_SECRET("%02X:%02X:%02X:%02X:%02X:%02X"), bssid[0], bssid[1], bssid[2], bssid[3],