Search found 19 matches

by Cimby1
Mon Oct 21, 2024 10:56 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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.
by Cimby1
Mon Oct 21, 2024 9:15 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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...
by Cimby1
Sat Oct 19, 2024 4:25 pm
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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.
by Cimby1
Sat Oct 19, 2024 10:03 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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.
by Cimby1
Sat Oct 19, 2024 8:09 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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.
by Cimby1
Fri Oct 18, 2024 11:18 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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?
by Cimby1
Fri Oct 18, 2024 9:25 am
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

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.
by Cimby1
Thu Oct 17, 2024 6:55 pm
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

Re: ESP IDF MQTT connection lost after few hours

I am grateful for your explanation. I try to implement your solution in my code. But before that, here is the outcome of the new cJSON_free(json_str); method. With this line added my esp run for almost a day long, and produced the same error...: I (95888556) mqtt: MQTT_EVENT_ERROR I (95888556) mqtt:...
by Cimby1
Wed Oct 16, 2024 3:29 pm
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

Re: ESP IDF MQTT connection lost after few hours

Now I understand. But if this would break my MQTT why is my other task which is simply pushing a log info to the console keep running ? Weird. I implemented the cJSON_free(json_str); fix, I go a round with that. (I have to wait like 8 hours to happen...). If it keeps happening I try to delete the pa...
by Cimby1
Wed Oct 16, 2024 12:32 pm
Forum: ESP-IDF
Topic: ESP IDF MQTT connection lost after few hours
Replies: 21
Views: 2079

Re: ESP IDF MQTT connection lost after few hours

Is it that bad ? I thought if I suspend a task when there is no broker where I should send the data, then it's unnecessarily to querry any sensor information. Hence I suspend and resume tasks via the mqtt_handler. But I can agree with you if you give me an explanation, or another idea to pause tasks...