Chat freely about anything...

User avatar
By trendchaster
#31164 Hello kolban,
(Sorry its different topic)I am working on MQTT code(tuanpmt ) and I want to disconnect the MQTT after publishing the data to broker i.e Mosquitto server to the client.The output on serial terminal as shown below
MQTT: Sending, type: 3, id: 0000
TCP: Sent
MQTT: Published
MQTT: Sending, type: 3, id: 0000
TCP: Sent
MQTT: Published
MQTT: Sending, type: 3, id: 0000
TCP: Sent
MQTT: Published
MQTT: Sending, type: 3, id: 0000
TCP: Sent
MQTT: Published

MQTT: Send keepalive packet to xxxxxxxxxxxx:1883!
MQTT: Sending, type: 12, id: 0000
TCP: Sent
TCP: data received 2 bytes
TCP: Disconnected callback
MQTT: Disconnected

After it mentioning disconnect on console ,it maintain the connection with server i.e MQTT: Send keepalive packet to xxxxxxxxxxxx:1883!.I want to disconnect it and continue to main loop.How it can be possible?plz guide me
User avatar
By Atlantis
#31209
Personally, I have switched to 1.4 and switch to the latest SDK every time a new one comes out. There are pains associated with it ... APIs change, things that used to work ... work differently (not necessarily broken ... just different).


I noticed, that ESP keeps resetting from time to time, after switching to 1.4.
Although, code is compiling without any problem.
I restored 1.1.1 and everything is fine again.

Am I doing something wrong, or 1.4 is less stable?
User avatar
By Atlantis
#31575 Ok, I've already figured it out.
Problem was caused by configuration of my router. There was no DNS address configured, so it was supplied by my ISP with DHCP. After reset router didn't have any DNS address, to pass i to reconnected ESP8266 via local DHCP.