Git Product home page Git Product logo

Comments (6)

gleanlux avatar gleanlux commented on July 16, 2024

I think the reconnection occurs after a message is sent.
(I send the uptime every 10 seconds on mqtt)
Could it have anything to do with the message being sent to QoS1?

kép

I continue to monitor the disconnect.

from arduino-mqtt.

crazy888 avatar crazy888 commented on July 16, 2024

I have the same problem.
!client.connect is false but my mosquitto logs says there is no disconnect of that client.
So the ESP reconnect a lot without any reason.

1706501287: New connection from 192.168.1.192:50896 on port 1883. 1706501287: Client Piridach already connected, closing old connection.

I also tried the set keepalive up and also moved my mosquitto server from my pi to my nas, but it does not change anything.
I have other clients like tasmota connected to the mosquitto server without any problems.
Also my network is stable without any drops.
It has nothing to do with publish things. It just happens in standby while looping over client.loop();
So i´m out of ideas...........

from arduino-mqtt.

Afriza87 avatar Afriza87 commented on July 16, 2024

Make sure the client IDs are not the same, please.

When using "Arduino," it's better to use a client ID that no one else is likely to use.

If there is a duplicate client ID, it will immediately disconnect from the broker, and because it disconnects, the ESP32 will attempt to reconnect.

This will continue endlessly. Additionally, if it is used for subscribing, just subscribe to one topic using a wildcard, for example, ex/#. This way, all topics starting with ex will automatically be subscribed.

from arduino-mqtt.

gleanlux avatar gleanlux commented on July 16, 2024

In my case the problem was caused by QOS1.
Currently, the library cannot handle QOS1, and this is what caused me to lose the connection.
Since I set it to QOS0 the problem has disappeared.

from arduino-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.