arduino-esp32
arduino-esp32 copied to clipboard
IPv6 readiness and support "by default"
Related area
tcp/ip stack
Hardware specification
any
Is your feature request related to a problem?
IPv6 support for IoT
Describe the solution you'd like
I want to create issue where i can track esp32 ipv6 readiness, ask questions regarding code and propose patches.
First question i have:
libraries/WiFi/src/WiFiGeneric.cpp
function
esp_err_t WiFiGenericClass::_eventCallback(arduino_event_t *event)
event ARDUINO_EVENT_WIFI_STA_CONNECTED
any particular reason why this line commented?
esp_netif_create_ip6_linklocal(esp_netifs[ESP_IF_WIFI_STA]);
Having it uncommented brings at least local IPv6 support.
I think if it might bring compatibility issues, i can send PR that will add some flag in wifi struct, which user can set to enable ipv6. For user it will look something like:
Serial.begin(115200); + WiFi.IPV6(true); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password);
Describe alternatives you've considered
No response
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
- [X] I confirm I have checked existing list of Feature requests and Contribution Guide.
It's possible to do it calling WiFi.enableIpV6();
I usually use it in ARDUINO_EVENT_WIFI_STA_CONNECTED
event, but it should work from other places
@nuclearcat Any updates?
is this still valid?
Yes might work on it at free time, probably this week
thanks @nuclearcat!
I added series of patches in PR, that provide necessary support for IPv6, but it needs serious testing, especially as i dont have yet devboards on s2, s3 and c3. Also i will test in more scenarios in upcoming days and probably will provide additional test/demo sketches.
Any feedback? :)
So... Another year has passed. Any progress on IPv6 support for ESP32 on Arduino Environment?
Latest PR is https://github.com/espressif/arduino-esp32/pull/7722 , it's not mine anymore, but i believe can call myself as co-author and i'm totally happy with it (it is used also in Tasmota). I suggest to support author and ping Espressif maintainers, as it's important matter to merge it.
What's the status of this PR? I have been trying to get an ipv6 address for my esp32 and it doesn't work. Here's the code:
#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "ssid";
const char* password = "intentionally_removed";
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.enableIpV6();
WiFi.begin(ssid, password);
Serial.println("\nConnecting to WiFi Network...");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(100);
}
Serial.println("\nConnected to the wifi network!");
}
void loop() {
HTTPClient http;
http.begin("http://api64.ipify.org");
int httpCode = http.GET();
if (httpCode > 0) {
String payload = http.getString();
Serial.println(payload);
}
http.end();
delay(1000);
}
Am I missing something? http://api64.ipify.org gives you an ipv6 address if you have one, else gives you an ipv4 address reply.
When I run this code, I only get the ipv4 address and not the ipv6 one.
Hello,
this should be solved by this PR: https://github.com/espressif/arduino-esp32/pull/9016
Please give it a try, if needed you can reopen this ticket.