-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 support #718
Comments
Looks like there is already work on mDNS-IPv6 in the arduino core: esp8266/Arduino#7335 Unfortunately enabling IPv6 in lwIP currently breaks ESPAsyncTCP: me-no-dev/ESPAsyncTCP#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 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 #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
|
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 |
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 what about ESP8266? 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 (OttoWinter/ESPAsyncTCP#4). |
Tasmota has gained great success in implementing IPv6 for ESP32 and ESP8266. Details can be found in the related issue arendst/Tasmota#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 |
Finally got some time to work on IPv6 support and have created two PRs, esphome/esphome#4750 and esphome/esphome#4759. The second one needs |
Got IPv6 to work with Ethernet as well, esphome/esphome#4807 |
Originally posted by @HeMan in esphome/esphome#4807 (comment)
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? |
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 esphome/esphome#5449 is merged. Could you people test it when it gets merged or from my branch now? |
Thank you for all the work you've done on this! <3. I was planning on taking some time this weekend to update all my devices now that 24.02 is out but I can try pulling in your branch. The external_components:
- source: github://pr#5449
components: [ wifi_info ] Or does |
You need to clone my repo and check out the branch. It can unfortunately not be used as an external component. |
It is now merged so you should be able to use the dev-branch. |
It's now released as part of 2024.3, https://esphome.io/changelog/2024.3.0.html#ipv6. There are some more things I'd like to add, like support for IPv6 only networks, but it should be usable in dual stack environments for now. Could you people test? |
It did not work in one of my IPv6 only-networks. Kept disconnecting (like if it does not have an IPv4 address it did not consider itself connected). Also (in a dual stack network) it does not add an IPv6 DNS address. (using RA only. No DHCPv6). |
Yeah, that is expected since it still deserves IPv4 to consider started.
Did you mean mDNS? Regular DNS could not be updated with SLAAC. And mDNS works best with esp-idf version 5.0.x or above unfortunately. |
Perhaps something worth working on. I really dream about getting rid of IPv4 completely for my internal networks... |
mDNS could be worth working on. SLAAC does only send out information regarding the network, it doesn't get anything back, which means that it can't update a DNS. DHCPv6 could do that, but lwip doesn't support that part of DHCPv6. |
DNS is optionally present in the RA packets used for SLAAC: https://datatracker.ietf.org/doc/html/rfc8106 So when you receive RA required to do SLAAC, you could take the IPv6 DNS info if it is present without having to use DHCPv6. |
Yes, named RDNSS if I am not confusing with something else. |
RDNSS is to anounce which DNS server to use, not to update the DNS-server. RDNSS is supported by lwip. |
Oh, now I see what you mean! RDNSS do set the DNS server on the ESP, but it's not shown in the log. Just tried to remove my DNS setting in the DHCP server and just propagated it via SLAAC and resolving of addresses worked. Will try to figure out how to display it. |
For MDNS and ESP8266, does esphome/esphome#5359 change how IPv6 is supported? |
Is there a list of $things in ESPHome that still rely on IPv4? |
ESPHome networking components (ethernet and wifi) needs an IPv4 address to assume a connection. I haven't looked at what other components that communicates over IP that still needs IPv4. |
I guess one future scenario for IPv6-only devices is how and when native support for OpenThread (Thread) is added to ESPHome? "IThread is an Pv6-based networking protocol designed for low-power Internet of Things devices in an IEEE 802.15.4-2006 wireless mesh network, commonly called a Wireless Personal Area Network (WPAN). Thread is independent of other 802.15 mesh networking protocols" FYI, that includes ESP32-H2 and ESP32-C6 (and newer SoCs), but note there is a separate feature request for OpenThread here: PS: Off-topic but FYI, there is also an OpenThread proof-of-concept project for ESPHome discussed in community forum here: |
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.
The text was updated successfully, but these errors were encountered: