Comments (6)
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?
I continue to monitor the disconnect.
from arduino-mqtt.
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.
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.
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)
- Unreliable behaviour with reconnections HOT 3
- MQTT HOT 1
- Websockets support HOT 3
- MQTT SSL connection issue with QoS1 and QoS2 messages HOT 1
- DCU: cannot connect to local MQTT broker HOT 1
- This library uses some posix functions that are not provided for Uno R4 HOT 3
- Subscribe query HOT 1
- Release version `v2.5.1` different of master version HOT 1
- 0
- Error connect MQTT SSL/TLS with module CBU use platform libretiny
- RP2040 seems to work fine HOT 2
- payload length / reconnect HOT 1
- Random error in MQTTClient::loop() function HOT 2
- Cosmetics only in MQTTClient.h / MQTTClient(...)
- Wrong version in README.md?
- ESP32 PSRAM for MQTT buffer?
- if available bytes on the network is available, close connection. HOT 1
- MQTT5 HOT 1
- subscribe fails HARD
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-mqtt.