1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 15:26:01 +00:00

Enable IPv6 for ESP32 Arduino, wifi and ethernet (#4865)

This commit is contained in:
Jimmy Hedman
2023-07-31 00:20:55 +02:00
committed by GitHub
parent 98bf427600
commit c418eecf83
4 changed files with 75 additions and 6 deletions

View File

@@ -485,6 +485,9 @@ void WiFiComponent::wifi_event_callback_(esphome_wifi_event_id_t event, esphome_
buf[it.ssid_len] = '\0';
ESP_LOGV(TAG, "Event: Connected ssid='%s' bssid=" LOG_SECRET("%s") " channel=%u, authmode=%s", buf,
format_mac_addr(it.bssid).c_str(), it.channel, get_auth_mode_str(it.authmode));
#if LWIP_IPV6
WiFi.enableIpV6();
#endif /* LWIP_IPV6 */
break;
}
@@ -547,6 +550,13 @@ void WiFiComponent::wifi_event_callback_(esphome_wifi_event_id_t event, esphome_
s_sta_connecting = false;
break;
}
#if LWIP_IPV6
case ESPHOME_EVENT_ID_WIFI_STA_GOT_IP6: {
auto it = info.got_ip6.ip6_info;
ESP_LOGV(TAG, "Got IPv6 address=" IPV6STR, IPV62STR(it.ip));
break;
}
#endif /* LWIP_IPV6 */
case ESPHOME_EVENT_ID_WIFI_STA_LOST_IP: {
ESP_LOGV(TAG, "Event: Lost IP");
break;