mqtt with single use credentials #192
Unanswered
Kakomis
asked this question in
Course Qeustions
Replies: 1 comment
-
You could try esp_mqtt_client_stop() command if mqtt disconnected. Then try to reconnect as in the code. There is also a reconnect command esp_mqtt_client_reconnect() to see if you can reconnect without going through the whole config process again. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Mair,
I'm using single use mqtt credentials so I have to handle reconnection by my own, I have this:
The thing is when MQTT_EVENT_DISCONNECTED occurs xTaskNotifyWait(0, 0, &command, portMAX_DELAY); is never called, I only get this message:
E (31986) MQTT_CLIENT: mqtt_message_receive: transport_read() error: errno=119
I (31986) MQTT: MQTT_EVENT_ERROR
E (31986) MQTT_CLIENT: mqtt_process_receive: mqtt_message_receive() returned -1
I (31996) MQTT: MQTT_EVENT_DISCONNECTED, msg_id=44288
I (42006) MQTT: Other event id: 7
W (43136) MQTT_CLIENT: Connection refused, not authorized
I (43136) MQTT: MQTT_EVENT_ERROR
E (43136) MQTT_CLIENT: MQTT connect failed
I (43146) MQTT: MQTT_EVENT_DISCONNECTED, msg_id=0
I (58146) MQTT: Other event id: 7
W (59216) MQTT_CLIENT: Connection refused, not authorized
I (59216) MQTT: MQTT_EVENT_ERROR
E (59216) MQTT_CLIENT: MQTT connect failed
I (59226) MQTT: MQTT_EVENT_DISCONNECTED, msg_id=0
I (74226) MQTT: Other event id: 7
W (75286) MQTT_CLIENT: Connection refused, not authorized
I (75296) MQTT: MQTT_EVENT_ERROR
E (75296) MQTT_CLIENT: MQTT connect failed
I (75296) MQTT: MQTT_EVENT_DISCONNECTED, msg_id=0
I (90296) MQTT: Other event id: 7
W (91366) MQTT_CLIENT: Connection refused, not authorized
I (91366) MQTT: MQTT_EVENT_ERROR
E (91366) MQTT_CLIENT: MQTT connect failed
I (91376) MQTT: MQTT_EVENT_DISCONNECTED, msg_id=0
It would be great if you could help me.
Beta Was this translation helpful? Give feedback.
All reactions