With my problem I did the same. In the MQTT handler I restart the wi-fi connection.
It is not the perfect solution, but I don’t have a better idea.
Search found 22 matches
- Thu Oct 31, 2024 3:35 pm
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
- Tue Oct 29, 2024 12:00 pm
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
I would say, welcome to the unsolved mystery club. I had a few tries with a similiar approch like you did. (I made a fall back mechanism when the wi-fi is unavailable) I solved my issue with starting AP and STA mode separaretly. Before each start/init of a mode I deleted the mode that I no longer us...
- Fri Oct 25, 2024 5:22 pm
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
A quick update on the mqtt problem. It happend again with no visable Wifi error. And no error in the mosquitto log. I always try to foolproof my code, so I tried to manually stop my MQTT and see what's happend. Manually: I (206506) mqtt: MQTT_EVENT_BEFORE_CONNECT E (206506) esp-tls: [sock=54] delaye...
- Mon Oct 21, 2024 10:56 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
I don't want to do anything like this. I plan to use this in an environment with a wifi router and an MQTT server hosted locally or over the internet. Nothing more.
- Mon Oct 21, 2024 9:15 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
Finally I was (or the nature was) able to reproduce the error. So my village have frequent power outage, only for 2-3 seconds. This interval is enough to restart my WIFI router, but it is not able to shutdown my ESP nor my MQTT host, because these are running on an UPS. Today I was working on my ESP...
- Sat Oct 19, 2024 4:25 pm
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
I added warning and error logging for the future to my mosquitto. We will see.
But it is only happening with this code. I am running another very simple code without tasks. That is going for more than 2 day now.
I removed the 2 lines from my mqtt conf that you mentioned, going for another test.
But it is only happening with this code. I am running another very simple code without tasks. That is going for more than 2 day now.
I removed the 2 lines from my mqtt conf that you mentioned, going for another test.
- Sat Oct 19, 2024 10:03 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
I have my own server running in a docker, on local hardware. I mentioned it earlier.
I want to debug this issue.
I want to debug this issue.
- Sat Oct 19, 2024 8:09 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
Do you mind giving me a proper mqtt config that is working as expected ?
Maybe this is the problem.
Maybe this is the problem.
- Fri Oct 18, 2024 11:18 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
Then the TAG of the error message is misleading.
Which direction should I go in debugging?
Should I set more parameters in MQTT config?
Which direction should I go in debugging?
Should I set more parameters in MQTT config?
- Fri Oct 18, 2024 9:25 am
- Forum: ESP-IDF
- Topic: ESP IDF MQTT connection lost after few hours
- Replies: 26
- Views: 5234
Re: ESP IDF MQTT connection lost after few hours
Where should I look for it?
At my host that runs mosquitto ? Or in my ESP mqtt configuration ?
I reckon I don’t use TLS, because in MQTT Explorer where I monitor topics, messages, etc I disabled the TLS connection.
Side note:
I did a test again without task halt and it failed in about 8 hours.
At my host that runs mosquitto ? Or in my ESP mqtt configuration ?
I reckon I don’t use TLS, because in MQTT Explorer where I monitor topics, messages, etc I disabled the TLS connection.
Side note:
I did a test again without task halt and it failed in about 8 hours.