Hi,
I am trying the switch example on the custom ESP32 board and getting the below error.
E (783471) MQTT_CLIENT: mqtt_message_receive: transport_read() error: errno=119
E (783471) esp_mqtt_glue: MQTT_EVENT_ERROR
E (783471) MQTT_CLIENT: esp_mqtt_connect: mqtt_message_receive() returned -1
E (783481) MQTT_CLIENT: MQTT connect failed
W (783491) esp_mqtt_glue: MQTT Disconnected. Will try reconnecting in a while...
actually, the switch example was working fine some time back but now it is showing this error. I tried this example on some other esp32 board but it is reporting the same issue.
I am using the esp idf 4.4 version.
any idea, how can I approach to resolve this issue?
Thanks,
Nirmesh
Error: MQTT_CLIENT: MQTT connect failed
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: Error: MQTT_CLIENT: MQTT connect failed
Can you tell us whether you used CLI based claiming for this or assisted claiming, or whether you have used both on the same board at different points of time? Are the same credentials mistakenly used elsewhere on an active device?
Re: Error: MQTT_CLIENT: MQTT connect failed
I was testing Arduino-esp32 example RMakerSwitch.ino on the same ESP32 board and it works.
so after that, whenever I am using esp rainmaker switch example or my own switch code on the same ESP32 board then getting this error message.
so after that, whenever I am using esp rainmaker switch example or my own switch code on the same ESP32 board then getting this error message.
Re: Error: MQTT_CLIENT: MQTT connect failed
i erased flash and uploaded the switch example program. now it is working fine.
Re: Error: MQTT_CLIENT: MQTT connect failed
Sorry to bring up an old thread but I am having a similar issue with my board and noticed your comment. I have been playing around with both types of claiming (self and assisted claiming.) And I have noticed that the connection to the rainmaker backend via MQTT is very unstable. Why did you raise this concern? Is there something that can happen if you use both types of claiming? And if I have used both types on one board is there a resolution?ESP_Piyush wrote: ↑Mon Feb 28, 2022 7:04 amCan you tell us whether you used CLI based claiming for this or assisted claiming, or whether you have used both on the same board at different points of time? Are the same credentials mistakenly used elsewhere on an active device?
FYI I remove the nodes from the dashboard when I wipe the board and I always "erase-flash flash monitor". But I keep getting getting offline/online messages in my app constantly throughout the day.
-
- Posts: 309
- Joined: Wed Feb 20, 2019 7:02 am
Re: Error: MQTT_CLIENT: MQTT connect failed
In the original issue, the node was unable to connect, hence the question regarding claiming. If you use host driven claiming, followed by assisted claiming and then again followed by host driven claiming, it is possible that a stale certificate gets written to the device, which will never be able to connect. Switching between self/assisted claiming does not cause any issues though.
Frequent disconnects and reconnects can typically happen due to network issues wherein either the MQTT PING request or PING response failed, causing a disconnect and a reconnect.
Frequent disconnects and reconnects can typically happen due to network issues wherein either the MQTT PING request or PING response failed, causing a disconnect and a reconnect.
Who is online
Users browsing this forum: No registered users and 72 guests