mqtt connection droping off every few days

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
kenkoknz
Normal user
Posts: 64
Joined: 03 Jul 2018, 23:46
Location: New Zealand

mqtt connection droping off every few days

#1 Post by kenkoknz » 31 Aug 2018, 08:52

Hi,
I have a simple ds18b20 set up on a esp01 with regulated buck psu, updating broker.hivemq every 30s. Works good except I have to reconnect the mqtt broker every few days, the connection to the broker seems to drop out, with publish failed, did not show connect failure. To get it going I have to reboot.

log:
1154013721: timeDiff() stats: Count: 1065241 - CPU cycles per call: 8.66
1154013721: Scheduler stats: (called/tasks/max_length/idle%) 503128/1935/7/90.20
1154040645: DS : Temperature: 20.50 (28-ff-c8-39-32-18-1-da)
1154040660: MQTT : publish failed
1154040660: MQTT : /kkesp01/temp1/temp 20.50
1154042826: WD : Uptime 19234 ConnectFailures 0 FreeMem 11248

Questions:
does espeasy connect only once to controller ?
does espeasy check controller (hivemq in this case) every time it send data to controller and try reconnect if not and will the log shows?
How do I retrive log history and how long is the log history?
Any advice will be appreciated.


Thanks in advance.

Ken

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: mqtt connection droping off every few days

#2 Post by grovkillen » 31 Aug 2018, 09:07

Log history on the node is not very long, you need to use a log server for that (search this forum for "tftpd32" and you will find).

Regarding your other questions, we're doing a queue system right now that might fix the issue you're experiencing.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: mqtt connection droping off every few days

#3 Post by TD-er » 31 Aug 2018, 23:25

The new queue system for ESPeasy may fix a lot of issues, but I am not entirely sure it will fix this particular issue with MQTT.

For the queue redesign, see this work-in-progress: https://github.com/letscontrolit/ESPEasy/pull/1669
I also made a test build yesterday: https://www.dropbox.com/s/dlvj7f1x3wlos ... 9.zip?dl=0
This build also includes a quick addition to the log about the MQTT state when a connection is lost.

Please ignore the strange looking version number in the filenames, I was just starting to make a build script on my computer and that's using my TD-er repository on Git and that one never receives Git tags. So the filenames represent the Git tag from the last moment I merged from ESPeasy repository.

kenkoknz
Normal user
Posts: 64
Joined: 03 Jul 2018, 23:46
Location: New Zealand

Re: mqtt connection droping off every few days

#4 Post by kenkoknz » 01 Sep 2018, 00:39

Thanks guys, great responsiveness and support. The log about mqtt state will be a big help. As there are so many variables. I will first update the firmware to latest (I was using mega-20180723), then try replacing the esp01 to see if there is any difference.
Thanks,
Ken

Post Reply

Who is online

Users browsing this forum: No registered users and 60 guests