feature-requests
feature-requests copied to clipboard
IPv6 support
Describe the problem you have/What new integration you would like ESPHome should be usable (== addressable) on an IPv6-only network.
Please describe your use case for this integration and alternatives you've tried: My HomeAssistant instance used to live on an IPv6-only network until it needed to communicate with an ESPHome node.
Additional context Based on my cursory look, ESP-IDF supports IPv6 with SLAAC.
Looks like there is already work on mDNS-IPv6 in the arduino core: https://github.com/esp8266/Arduino/pull/7335
Unfortunately enabling IPv6 in lwIP currently breaks ESPAsyncTCP: https://github.com/me-no-dev/ESPAsyncTCP/issues/148
Is there any progress on this?
Still nothing? Have anyone at least started porting this to IPv6-enabled LWIP?
I am looking for any examples (from forks of this or any other entirely different projects) so I can understand how calls to dual-stack IPAddress
structs should look like and how should any interface deal with it, so I/we can start at least some hacky working draft for this...
Does anyone know of any good one?
What is the status of the IPv6 support? If I implement a new device architecture, I have to be sure that it is future proof.
Enabling IPv6 in lwIP still breaks ESPAsyncTCP, and the issue was unfortunately closed because no one was working on it: me-no-dev/ESPAsyncTCP#148.
That project seems dead - no commits since 2019, and eight pull requests collecting dust.
In any case, it's a problem to be fixed there, and not in esphome. Maybe @me-no-dev can comment? If espressif doesn't intend to invest in ESPAsyncTCP anymore, maybe volunteer maintainers can step in, or the project can be forked?
If possible, I also expect esphome to support IPv6 protocol stack, and I think this is the trend in the future
v6 is the future and will also make many things easier e.g. static-ips without dhcp (faster link-local-addresses)
Matter (formerly Project CHIP) Application Layer support requirements might be very strong argument why IPv6 support is needed.
Created separate feature request discussion for Matter/CHIP Application Layer support in https://github.com/esphome/feature-requests/issues/1430 but looks like IPv6 is required now.
hmm, do these documents from ESP-IDF Programming guide for ESP32 v4.3.1 make it sound like IPv6 is supported on ESP32?
https://docs.espressif.com/projects/esp-idf/en/v4.3.1/esp32/api-guides/lwip.html?highlight=ipv6
ESP-IDF version of lwIP (esp-lwip) list IPv6 support under FEATURES:
https://github.com/espressif/esp-lwip/blob/2.1.2-esp/README
- IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over multiple network interfaces
https://github.com/espressif/esp-lwip
The blocker here is IPv6 support on the esp8266. It would be unfortunate if esphome only supported ipv6 on the esp32.
The blocker here is IPv6 support on the esp8266. It would be unfortunate if esphome only supported ipv6 on the esp32.
OK then that is understandable. Espressif and the Matter/CHIP only support Matter/CHIP Application Layer on ESP32 anyway.
I looked a bit into this, and created an updated ESPAsyncTCP that works with IPv6, https://github.com/HeMan/ESPAsyncTCP/tree/ipv6 and I have a local version of https://github.com/HeMan/esphome/tree/ipv6 that could at least start web_server
on an ESP8266.
It seems that the Arduino for ESP32 doesn't have IPv6 support, but I'll try to get it to work with esp-idf.
ESPHome 2022.2.0 was released with IPv6 support for esp-idf framework, https://esphome.io/changelog/2022.2.0.html#new-features
Note that the esp-idf framework doesn't support some components (yet), for example the web server or the captive portal.
@nagyrobi can we really consider this as completed as it is only available with ESP-IDF which still not support all component and is only for ESP32?
AFAIK the long-term goal is to move everyting to ESP-IDF. And indeed you're riht, ESP-IDF platform is still missing Ethernet support in ESPHome, so actually things depend on each other. However, I think the first big step has been done, ice broken - with compromises but yes, can be used.
And what about ESP8266? I thought ESP-IDF was only for ESP32, which is the case in ESPHome.
About not supported components I was referring for example to captive portal which is still not compatible with ESP-IDF, because of web server which is not yet compatible if I am not wrong. But I suppose in long term it will be compatible...
Also I cannot compile esp-idf on Raspberry PI4
I have a working IPv6 implementation for ESP8266 that needs some work. Some of the components doesn't support IPv6, and I have a created a PR to solve one (https://github.com/OttoWinter/ESPAsyncTCP/pull/4). IPv6 on the Arduino version for ESP32 needs a newer Arduino than what Platform.io had when I last looked into it, but that could have changed now.
Tasmota has gained great success in implementing IPv6 for ESP32 and ESP8266. Details can be found in the related issue https://github.com/arendst/Tasmota/issues/2521 and their release notes https://github.com/arendst/Tasmota/releases/tag/v12.4.0. Maybe their implementation is helpful or even compatible to reuse in esphome.
Finally got some time to work on IPv6 support and have created two PRs, https://github.com/esphome/esphome/pull/4750 and https://github.com/esphome/esphome/pull/4759. The second one needs ~~https://github.com/OttoWinter/ESPAsyncTCP/pull/4~~ https://github.com/esphome/ESPAsyncTCP/pull/1 to be merged before it compiles. Next step is to enable it for Ethernet as well. RP2040 is unfortunately a lot harder to get working with IPv6.
Got IPv6 to work with Ethernet as well, https://github.com/esphome/esphome/pull/4807
Originally posted by @HeMan in https://github.com/esphome/esphome/issues/4807#issuecomment-1544766968
This just adds dynamic IPv6 via SLAAC or DHCPv6, in par with IPv6 for ESP-IDF (https://github.com/esphome/esphome/pull/2953). Adding static addresses needs a bigger internal change that starts with https://github.com/esphome/esphome/pull/4729.
Off-topic but an indirectly related question; dynamic IPv6 addresses should be compatible with Matter standard/protocol, right?
Question is related to this other ESPHome feature request for Matter standard/protocol support -> https://github.com/esphome/feature-requests/issues/1430
As I understand the core Matter protocol should in theory be able to communicate over any type of IPv6 transport and network.
Off-topic but an indirectly related question; dynamic IPv6 addresses should be compatible with Matter standard/protocol, right?
Question is related to this other ESPHome feature request for Matter standard/protocol support -> #1430
As I understand the core Matter protocol should in theory be able to communicate over any type of IPv6 transport and network.
I think so. Dynamic addressing, especially on IPv6, is a more convenient way to maintain a network. Static addresses have it uses so I'm still going to implement it, but I think the main part is going to use dynamic addresses.
Keep in mind there are two kind of dynamic address assignment in IPv6: SLAAC and DHCPv6. For IoT devices, address assignment via DHCPv6 might not be necessary (Android devices for example also cannot use DHCPv6 to get an IPv6 address).
If you want to read up about IPv6, there is a nice public book here on Github: https://github.com/becarpenter/book6
I now have basic IPv6 working on all platforms and have started to rewrite the internals to be more address agnostic. It also need to understand that it could have multiple addresses, since IPv6 could have a few and also since it will be dual stack it could have one IPv4 address. DNS-resolving for MQTT for example need to look for both A- and AAAA-records, and happy eyeballs should perhaps be implemented as well.
I just enabled IPv6 on one of my sensors - but debug output did not show any IPv6 addresses being assigned. Checking my firewalls NDP table I only see a link-local address for this device. Do I need to enable any additional debug to see IPv6 related messages?
I just enabled IPv6 on one of my sensors - but debug output did not show any IPv6 addresses being assigned. Checking my firewalls NDP table I only see a link-local address for this device. Do I need to enable any additional debug to see IPv6 related messages?
Could you please open a issue with information about hardware and the important parts of your yaml.
Yey, PR for enabling IPv6 on ESP8266 and RP2040 (Raspberry Pi Pico) was merged yesterday! 🥳
I think this could be close after https://github.com/esphome/esphome/pull/5449 is merged. Could you people test it when it gets merged or from my branch now?