Skip to content
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

Error while connecting to a website via IPv6 connection (IDFGH-11103) #12275

Closed
3 tasks done
my-dudhwala opened this issue Sep 20, 2023 · 6 comments
Closed
3 tasks done
Assignees
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@my-dudhwala
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I am getting a lot of errors while trying to work on any web project, the only and only problem is IPv6 router, I have tried a lot of codes from different articles, git repos and inbuilt examples with different configurations, most of are working with IPv4,

I am updating each codes with its error on on a github repo
https://github.com/my-dudhwala/ESP_IPv6/

Error in esp_http_client code,

E (13733) esp-tls: [sock=54] select() timeout
E (13734) TRANSPORT_BASE: Failed to open a new connection: 32774
E (13735) HTTP_CLIENT: Connection failed, sock < 0
E (13740) HTTP_CLIENT: HTTP GET request failed: ESP_ERR_HTTP_CONNECT

@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 20, 2023
@github-actions github-actions bot changed the title Error while connecting to a website via IPv6 connection Error while connecting to a website via IPv6 connection (IDFGH-11103) Sep 20, 2023
@david-cermak
Copy link
Collaborator

Have you tried to enable CONFIG_LWIP_IPV6_AUTOCONFIG ?

Please check the IDF docs in https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#ipv6-support

@my-dudhwala
Copy link
Author

@david-cermak

Have you tried to enable CONFIG_LWIP_IPV6_AUTOCONFIG ?

Please check the IDF docs in https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/lwip.html#ipv6-support

yea, I have tried every basic possible conditions including every internet connection codes of ESP IDF, Arduino IDE, YouTube videos and web articles, I tried to achieve this for almost a month. I have also tried on ESP8266, but no success, and yea there is an IPv6 option in tools of Arduino IDE for ESP8266, but still not working, thank you very much for your support, I am still waiting and I hope anyone will come up with solution or any new configuration for IPv6. thanks

@david-cermak
Copy link
Collaborator

Then it's probably an issue with your local network. ESP-IDF is fully IPv6 aware (supporting IPv6-only, too); if you need a global address you'd just have to set CONFIG_LWIP_IPV6_AUTOCONFIG=y (if you use SLAAC) or enable DHCPv6 (otherwise -- a bit complex, but still quite rare scenario)

You can also try to setup a WiFI hotspot (I hear that a few decent ISPs already support IPv6)

@sgryphon
Copy link

sgryphon commented Feb 24, 2024

I am not sure if it is relevant for your scenario, but I recently put up a pull request to update the protocol examples to work with all/any network configuration. The branch is here: #13250

The update examples work out of the box (no config or code changes) with all network types: IPv4-only, IPv6-only, and dual stack. (You do need to provide config for things like your WiFi password)

I have tested the http_request example with the changes and there is example output in the README of it working on different network types and different servers (dual stack, IPv6 only, IPv4 only).

If you have DNS64/NAT64 available, then it even works for an IPv6-only network to connect to an IPv4-only server.

Maybe you can use something out of the examples to get your scenario working.

@david-cermak
Copy link
Collaborator

Hi @my-dudhwala

I'm closing this, as it seems your issues are unrelated to IDF's IPv6 handling. If you get more information, please feel free to share it here and reopen this issue.

@sgryphon
Copy link

Just a note that the above example changes only ended up working for HTTP, by doing a manual DNS lookup (to support some scenarios connecting to a dual-stack host from an IPv6 only network).

However the approach did not work with HTTPS, which does it's own lookup. Most production use will require HTTPS.

I tracked down the issue to the way LWIP does DNS result ordering, and have a change request up with a fix, but it is not merged yet, so there are still some IPv6 scenarios that ESP-IDF does not yet handle correctly.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Won't Do This will not be worked on and removed Status: Opened Issue is new labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants