mqtt disconnect every 30 sec.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

mqtt disconnect every 30 sec.

#1 Post by alero » 14 Jul 2023, 09:57

Hi,

i have an wemos mini d1 with espeasy and the counter. The wemos communicate ovewr mqtt with my iobroker. for 30 sec everything works fine. then mqtt lost connection and an other 30 sec it reconnect.

See attachfile

any ideas?
Attachments
Snap4.jpg
Snap4.jpg (173.93 KiB) Viewed 1219 times

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

Re: mqtt disconnect every 30 sec.

#2 Post by TD-er » 14 Jul 2023, 10:27

Might not be for the same reason as in this GitHub issue, but at least there were some possible causes discussed which you could also look into.

For example:
- Poor WiFi connection
- ESP receiving too many messages on subscribed topics
- Too low timeout in the controller settings in ESPEasy
- Increase "keep alive" setting in the MQTT broker
- ECO mode enabled on ESPEasy? If so, try with disabling it

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#3 Post by alero » 14 Jul 2023, 10:53

hi,
thanks for the quick response.
Answers:
- Poor WiFi connection connection
802.11g (RSSI -64 dBm)
- ESP receiving too many messages on subscribed topics
where can i find it?
- Too low timeout in the controller settings in ESPEasy
client timeout 200ms tryed also 1000 . no efect
- Increase "keep alive" setting in the MQTT broker
where can i do this?
- ECO mode enabled on ESPEasy? If so, try with disabling it
you mean sleepmode? ist off or Where can i find it?

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

Re: mqtt disconnect every 30 sec.

#4 Post by TD-er » 14 Jul 2023, 11:02

OK, so WiFi connection is good at -64 dBm

Number of messages received....
Maybe the broker does keep some logs?
Otherwise you could use some desktop tools like MQTT Explorer (Windows store) to subscribe to the same topics as what your ESPEasy node does.
Then you can see what messages (and how many) must have been sent to the ESPEasy node.

The MQTT broker does have this keep alive setting, so it must be in the MQTT broker configuration somewhere.

ECO mode in ESPEasy is not enabled by default. You can find it on the Tools->Advanced page.

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#5 Post by alero » 14 Jul 2023, 11:20

hi,

so mqtt exlorer has not much communication. see attach mqtt_ex
IObroker mqtt Settings see attach mqtt_iobroker_set. i cant find the alive
eco mode is disable
Attachments
mqtt_iobroker_set.jpg
mqtt_iobroker_set.jpg (139.79 KiB) Viewed 1198 times
mqtt_ex.jpg
mqtt_ex.jpg (87.02 KiB) Viewed 1198 times

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

Re: mqtt disconnect every 30 sec.

#6 Post by TD-er » 14 Jul 2023, 11:38

Does the log of your MQTT broker share any info on who initiated the MQTT disconnect?
Either the MQTT broker or the MQTT client?

Can you also try to uncheck the "ack=true" to see if this also means the client needs to send an acknowledgement?

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#7 Post by alero » 14 Jul 2023, 12:35

hi,

ack true disable and the iobroker lo see attch

same result.
Attachments
iobroker_log.jpg
iobroker_log.jpg (62.55 KiB) Viewed 1192 times

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#8 Post by alero » 14 Jul 2023, 12:36

hi,
i read something about to add a loop in esp. but i dont know where to add.

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

Re: mqtt disconnect every 30 sec.

#9 Post by TD-er » 14 Jul 2023, 13:20

Where did you read this? It doesn't ring a bell here and I also can't think of a way how that may help these issues.

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

Re: mqtt disconnect every 30 sec.

#10 Post by TD-er » 14 Jul 2023, 13:22

alero wrote: 14 Jul 2023, 12:35 hi,

ack true disable and the iobroker lo see attch

same result.
I don't really understand what's being posted here...
It looks more like the log of the MQTT broker indicating the broker might have crashed and is restarting?

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#11 Post by alero » 14 Jul 2023, 13:28

hi,

i change the intervall time from 10 to 40. now the mqtt is 60 sec online and only 5 sec offline. before changing ist was 30 sec online 30 sec offline.

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: mqtt disconnect every 30 sec.

#12 Post by Ath » 14 Jul 2023, 13:32

You might consider upgrading your IOBroker installation to the latest release (4.3.4), as you seem to be on a somewhat older version (4.1.1) (all according to some googling...)
/Ton (PayPal.me)

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#13 Post by alero » 14 Jul 2023, 13:41

mqtt 4.1.1 is the last stable version.

alero
New user
Posts: 8
Joined: 05 Jul 2023, 10:52

Re: mqtt disconnect every 30 sec.

#14 Post by alero » 14 Jul 2023, 14:01

hi, i have no ideas left :-(

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 40 guests