-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
MQTTS client connection to MQTT broker on IPV6 only instance. (IDFGH-14445) #15222
Comments
Hi @Zeni241, could you provide logs of the connection phase with the errors? Please enable VERBOSE log level for the components, refer to mqtt client examples on IDF for the list of most important ones and how to do it. |
Hi @euripedesrocha Thanks for your response . In fact I am not able to get IPV6 address for my ESP32 when I connect to wifi. I only get IPV4 address and this may be the reason I cannot connect to mqtt broker behind IPV6. To connect to wifi my code is
And in event handler I have added"
I have checked that my router supports SLAAC and has IPV6 global address. Can you please guide me how can I get IPV6 address when I connect ESP32 to wifi. Presently it get only IPV4 address. |
The easiest way is to use example_connect. https://github.com/espressif/esp-idf/blob/master/examples/protocols/mqtt/tcp/main/app_main.c#L159
The source code for example_connect tells you a lot about IPV6 addresses. |
Thanks @euripedesrocha for guiding me I will go through this example and give my feedback here. |
Dear @euripedesrocha thanks for the link, Now I am able to get Global IPV6 address in my ESP-32 WIFI connection and now I can connect my MQTT client on my ESP32 to this broker behind IPV6 only address. |
Answers checklist.
General issue report
My mosquitto MQTT broker is hosted on AWS EC2, which only has IPV6 address attached to it (no IPV4 address, as it costs 😉 ).
The problem is I cannot connect my MQTT client on my ESP32 to this broker. I am sure this is due to IPV6 only address of my EC2 because if I attach an IPV4 elastic IP to this instance, the MQTT client on ESP32 can easily connect to the broker on EC2.
Any solution please.
The text was updated successfully, but these errors were encountered: