esp8266-react
esp8266-react copied to clipboard
MQTT connection issue only on ESP32
I've tried building the default project for esp8266 and esp32, but I'm having issues with the esp32 version. It seems that on the esp32 version, the MQTT doesn't connect to the broker. I get the following status:
If I'm looking at the broker log in home assistant, I don't see any incoming failed connections either.
MQTT works fine if I compile for esp8266 with the same MQTT settings.
I've not seen that issue before, though an update to the SDK or libraries could have caused something to break of course.
Let me see if I can reproduce the issue.
On Tue, Oct 13, 2020 at 9:48 AM RadViking [email protected] wrote:
I've tried building the default project for esp8266 and esp32, but I'm having issues with the esp32 version. It seems that on the esp32 version, the MQTT doesn't connect to the broker. I get the following status: [image: image] https://user-images.githubusercontent.com/50738897/95837304-c2ab3400-0d40-11eb-90e7-f92afa2a48ef.png
If I'm looking at the broker log in home assistant, I don't see any incoming failed connections either.
MQTT works fine if I compile for esp8266 with the same MQTT settings.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rjwats/esp8266-react/issues/199, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKE4VGNKGLX35VTYCNS32DSKQH5XANCNFSM4SOM3T6Q .
It appears to still be working fine for me on both ESP32 and ESP8266 devices having built a new firmware from the latest SDK. I have tried connecting by both IP address and hostname and both worked for me on both devices. In my case this is a standalone mosquitto instance running on a VM on my network.
Not quite sure what to suggest, I know that the framework does not support TLS or certificate validation so you'll need to be connecting on an insecure port. Though that will be the same for esp8266 of course and you've managed to connect OK on one of those.
Oddly regardless of whether i use invalida credentials or a completly unresolvable domain name the MQTT status service always returns '0' for disconnect_reason instead of one of the many more useful codes it seems to suggest it might return:
I'm not sure what to suggest, other than double check everything and maybe try and connect to another MQTT broker as a test.
Thank you for the info.
I tried connecting to another broker with the esp32 and that works. Strange that I can't connect to my home assistant broker.
I'm not sure what to try next either.
I figured out the problem.
When I enter "homeassistant.home" or the IP address as the MQTT host, it works on the ESP32 and the ESP8266. When I enter "homeassistant.local", it only works on the ESP8266.
It seems like the problem is in resolving the host name.
The fact that the error message is always the same only added to the confusion though.
Thanks again for the help!
yes I had the same issue "hassio.local" does not resolve from the esp32 but does from the esp8266. I even entered a ticket for this a while back. I ended up using the IP address. May be something is different for this class of dns that end with *.local are handled because other "normal" DNSs do work from the esp32. It might be a library issue on esp32.
Yes, this is multicast DNS - "mDNS".
I think another user had commented that the ".home" extension works on the ESP32 and ESP8266 where ".local" only works on the ESP8266.
I'm not aware of any API which exposes the configuration of the internal mDNS resolution. It may be there and I've just not seen it yet.
I know the MDNS singleton may be used for configuring the device's mDNS responder. The framework could probably deal with this better. At the moment the OTA service configures the MDNS responder which isn't ideal if you wanted to configure it or extend it's configuration yourself.
I'll have a dig around the APIs to see if there are any obvious ways of configuring the mDNS resolver... if you know of any APIs which allow for this to be configured let me know.
On Sun, Dec 6, 2020 at 11:23 PM Tichaona Hwandaza [email protected] wrote:
yes I had the same issue "hassio.local" does not resolve from the esp32 but does from the esp8266. I even entered a ticket for this a while back. I ended up using the IP address. May be something is different for this class of dns that end with *.local are handled because other "normal" DNSs do work from the esp32
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rjwats/esp8266-react/issues/199#issuecomment-739583346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKE4VBEYL3GFRY2SEITBLTSTQG77ANCNFSM4SOM3T6Q .