From e6918d8b9cd635daf0749fb73e6a10dd6c3e08d5 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 16 Apr 2025 11:35:06 +0200 Subject: [PATCH] Fix ESP8266 IPv6 compilation --- CHANGELOG.md | 2 +- RELEASENOTES.md | 1 + tasmota/tasmota_support/support_wifi.ino | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc89392b..15edc441e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file. - Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM` - PZEM_AC device address in JSON and GUI (#23268) - Filesystem command ``UfsList[2]`` -- Show network interface priority in `Status 5` debug logging +- ESP32 show network interface priority in `Status 5` debug logging (#23302) ### Breaking Changed - HASPmota added `y2_min` and `y2_max` to control the second series of `chart` (#23287) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 63589e8d4..bd12c1ca5 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -125,6 +125,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - PZEM_AC device address in JSON and GUI [#23268](https://github.com/arendst/Tasmota/issues/23268) - Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` [#22998](https://github.com/arendst/Tasmota/issues/22998) - AlpineJS 2.8.2 - optional for now [#23259](https://github.com/arendst/Tasmota/issues/23259) +- ESP32 show network interface priority in `Status 5` debug logging [#23302](https://github.com/arendst/Tasmota/issues/23302) - Berry experimental driver for AXP2101 for M5Core2v1.1 [#23039](https://github.com/arendst/Tasmota/issues/23039) - Berry `tasmota.when_network_up()` and simplified Matter using it [#23057](https://github.com/arendst/Tasmota/issues/23057) - Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM [#23063](https://github.com/arendst/Tasmota/issues/23063) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index e4942679c..57e737072 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -648,10 +648,13 @@ String DNSGetIPStr(uint32_t idx) // #include "lwip/dns.h" +#ifdef ESP32 #include "esp_netif_net_stack.h" +#endif void WifiDumpAddressesIPv6(void) { for (netif* intf = netif_list; intf != nullptr; intf = intf->next) { +#ifdef ESP32 esp_netif_t *esp_netif = esp_netif_get_handle_from_netif_impl(intf); int32_t route_prio = esp_netif ? esp_netif_get_route_prio(esp_netif) : -1; if (!ip_addr_isany_val(intf->ip_addr)) AddLog(LOG_LEVEL_DEBUG, "WIF: '%c%c%i' IPv4 %s (%i)", intf->name[0], intf->name[1], intf->num, IPAddress(&intf->ip_addr).toString(true).c_str(), route_prio); @@ -661,7 +664,17 @@ void WifiDumpAddressesIPv6(void) IPAddress(&intf->ip6_addr[i]).toString(true).c_str(), ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : "", route_prio); } +#else + if (!ip_addr_isany_val(intf->ip_addr)) AddLog(LOG_LEVEL_DEBUG, "WIF: '%c%c%i' IPv4 %s", intf->name[0], intf->name[1], intf->num, IPAddress(&intf->ip_addr).toString(true).c_str()); + for (uint32_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { + if (!ip_addr_isany_val(intf->ip6_addr[i])) + AddLog(LOG_LEVEL_DEBUG, "IP : '%c%c%i' IPv6 %s %s", intf->name[0], intf->name[1], intf->num, + IPAddress(&intf->ip6_addr[i]).toString(true).c_str(), + ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : ""); + } +#endif } + AddLog(LOG_LEVEL_DEBUG, "IP : DNS: %s %s", IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString(true).c_str()); AddLog(LOG_LEVEL_DEBUG, "WIF: v4IP: %_I v6IP: %s mainIP: %s", (uint32_t) WiFi.localIP(), WifiGetIPv6Str().c_str(), WifiGetIPStr().c_str()); //#if defined(ESP32) && CONFIG_IDF_TARGET_ESP32 && defined(USE_ETHERNET)