Skip to content
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

MQTT_Disconnect don't disconnect #87

Open
sifourquier opened this issue Dec 27, 2015 · 4 comments
Open

MQTT_Disconnect don't disconnect #87

sifourquier opened this issue Dec 27, 2015 · 4 comments

Comments

@sifourquier
Copy link

Hi
MQTT_Disconnect clear memory but don't close TCP connection

I have edit the mqtt.c for close the TCP but if you can check

Tanks you for your work
mqtt.c.zip

@luuke
Copy link

luuke commented Dec 28, 2015

Hey
With old version my ESP-07 module was having exception watchdog resets after disconnecting from MQTT and (straight after that) disconnecting from WIFI. Module was reseting in about 95% attempts.

Just replaced mqtt.c file with your version and so far my module is working fine as it is supposed to.
Was trying to find the problem for few days already. You made my day!

Thanks,
Luuke

@sifourquier
Copy link
Author

Hi think i have found a "error in me new code"
of MQTT are disconnected for another reason of a desired disconnect the esp don't reconnect.
If i found a best solution i post.

@vowstar
Copy link
Contributor

vowstar commented Jan 1, 2016

@sifourquier You can try this https://github.com/vowstar/esp_mqtt, I'm testing and it is OK to safe disconnect MQTT client.
My branch is still under testing so I'm not create pull request to upstream, until it is stable.
You can use MQTT_Disconnect(MQTT_Client *mqttClient) to disconnect TCP connection,
and use MQTT_DeleteClient(MQTT_Client *mqttClient) to fully free the memory. When you delete client, you must redo MQTT_InitClient. When you use MQTT_Disconnect, need'nt re init client.
Please try.

@Cicero-MF
Copy link

To me, MQTT_Disconnect() should send a mqtt_msg_disconnect() message, message type MQTT_MSG_TYPE_DISCONNECT = 14. But that function isn't used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants