Ai-thinker ESP32 - constant reconnection after few hours of use

166 views
Skip to first unread message

frederic...@gmail.com

unread,
May 3, 2021, 2:33:19 PM5/3/21
to TasmotaUsers
Hi,

I have a esp32-S cam from Ai-Thinker.
It is working good under tasmota 9.4.0 until few hours of use. After that the device constantly connect & disconnect. Here what I can see from the console:

{"AP":1,"SSId":"SFR_B7A8","BSSId":"E4:5D:51:69:B7:AE","Channel":11,"RSSI":48,"Signal":-76,"LinkCount":1,"Downtime":"0T00:00:06"}}
20:08:05.442 MQT: stat/webcam_salon/STATUS10 = {"StatusSNS":{"Time":"2021-05-03T20:08:05","ESP32":{"Temperature":52.8},"TempUnit":"C"}}
20:08:21.974 MQT: Attempting connection...
20:08:24.490 MQT: Connected
20:08:24.496 MQT: tele/webcam_salon/LWT = Online (retained)
20:08:24.499 MQT: cmnd/webcam_salon/POWER =
20:09:02.587 MQT: stat/webcam_salon/RESULT = {"Time":"2021-05-03T20:09:02","Uptime":"0T01:20:41","UptimeSec":4841,"Heap":115,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":5968,"MqttCount":24,"POWER":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"SFR_B7A8","BSSId":"E4:5D:51:69:B7:AE","Channel":11,"RSSI":52,"Signal":-74,"LinkCount":1,"Downtime":"0T00:00:06"}}
20:09:03.805 MQT: Attempting connection...
20:09:05.646 MQT: Connected
20:09:05.651 MQT: tele/webcam_salon/LWT = Online (retained)
20:09:05.655 MQT: cmnd/webcam_salon/POWER =
20:09:08.042 MQT: stat/webcam_salon/RESULT = {"Time":"2021-05-03T20:09:08","Uptime":"0T01:20:47","UptimeSec":4847,"Heap":126,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":1167,"MqttCount":25,"POWER":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"SFR_B7A8","BSSId":"E4:5D:51:69:B7:AE","Channel":11,"RSSI":48,"Signal":-76,"LinkCount":1,"Downtime":"0T00:00:06"}}
20:09:08.085 MQT: stat/webcam_salon/STATUS10 = {"StatusSNS":{"Time":"2021-05-03T20:09:08","ESP32":{"Temperature":52.2},"TempUnit":"C"}}
20:09:23.792 MQT: domoticz/in = {"idx":90,"nvalue":1,"svalue":"100","Battery":100,"RSSI":4}
20:09:23.796 MQT: stat/webcam_salon/RESULT = {"POWER":"ON","Dimmer":100}


Any idea what is wrong ?
Many thanks

Philip Knowles

unread,
May 3, 2021, 2:51:05 PM5/3/21
to frederic...@gmail.com, TasmotaUsers

The wifi isn’t dropping so it’s a MQTT issue. It’s worth looking at the MQTT logs for errors  Is the disconnection roughly every 40 seconds?

 

Regards

 

Phil K

 

 

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/1ea1904b-938f-4afe-8cf4-addd87f42fa3n%40googlegroups.com.

 

frederic...@gmail.com

unread,
May 4, 2021, 7:02:35 AM5/4/21
to TasmotaUsers
I attach two logs, one from syslog, the other fro mosquitto log.
Reconnection is every two/three seconds.

I do not see any errors from the log (log level of syslog is error, set from the tasmota ui of the webcam).

Let me know if I have to provide other logs.

Again many thanks
syslog-webcam.log
mosquitto.log

Philip Knowles

unread,
May 4, 2021, 8:33:28 AM5/4/21
to frederic...@gmail.com, TasmotaUsers

I wonder why this is happening?

May  4 12:14:57 webcam-salon ESP-MQT: Unsubscribe from homeassistant/status

 

A common cause of frequent MQTT disconnects is 2 clients with the same name but don’t think this is the case here.

frederic...@gmail.com

unread,
May 4, 2021, 3:07:12 PM5/4/21
to TasmotaUsers
I started automation with domoticz and use it currently. In parallel I am testing home assistant for discovering the capabilities and differences with domoticz.
To be honest I do not remember what I did either with home assistant or into the console (into tasmota) which could lead to the message above.
I tested today to shutdown home assistant and restart the camera, same issue.

I have reseted the tasmota configuration and configure it again with the minimum of parameters / commands (the only one was to set the resolution to the maximum).
Let's if this has solved the issue.

I keep you in touch.

frederic...@gmail.com

unread,
May 5, 2021, 3:14:43 PM5/5/21
to TasmotaUsers
Same issue with:
1620240695: Client DVES_EAA038 closed its connection.
1620240704: New connection from 192.168.1.5:52631 on port 1883.

This is repeated endless.
I don't know why.



frederic...@gmail.com

unread,
May 7, 2021, 1:30:06 AM5/7/21
to TasmotaUsers
Hi,

No idea about what is wrong when using tasmota32-webcam. I have replaced tasmota32-webcam by tasmota32-FR.
With this firmware I have absolutely no issue with MQTT. Is there a way to activate the camera with this firmware or the firmware tasmota32-webcam is mandatory ?

Philip Knowles

unread,
May 7, 2021, 1:42:22 AM5/7/21
to TasmotaUsers, frederic...@gmail.com
I think it might be worth reading this page

He has the same board

Regards

Phil K


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of frederic...@gmail.com <frederic...@gmail.com>
Sent: Friday, May 7, 2021 6:30:06 AM
To: TasmotaUsers <sonof...@googlegroups.com>

frederic...@gmail.com

unread,
May 7, 2021, 1:56:43 AM5/7/21
to TasmotaUsers

Hi Phil,

I did follow this good article first time. I do it again with latest development firmware -webcam one). Let see how it goes.
I will flash again the board as specified in the article as next step if MQTT issue is still there.

frederic...@gmail.com

unread,
May 7, 2021, 2:05:20 AM5/7/21
to TasmotaUsers
I did see the section about tasmocompiler, will give it a try !

knowles...@gmail.com

unread,
May 7, 2021, 7:08:41 AM5/7/21
to TasmotaUsers, frederic...@gmail.com

The date of the post would point to v9.2.0 so it may be worth trying that version just in case a bug has been introduced.

Regards

Phil K

From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of frederic...@gmail.com <frederic...@gmail.com>
Sent: Friday, May 7, 2021 6:56:43 AM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Ai-thinker ESP32 - constant reconnection after few hours of use

 


Hi Phil,

 

I did follow this good article first time. I do it again with latest development firmware -webcam one). Let see how it goes.

I will flash again the board as specified in the article as next step if MQTT issue is still there.

Le vendredi 7 mai 2021 à 07:42:22 UTC+2, knowles...@gmail.com a écrit :

I think it might be worth reading this page

He has the same board

Regards

Phil K

frederic...@gmail.com

unread,
May 7, 2021, 8:08:04 AM5/7/21
to TasmotaUsers
With latest version 9.4.0.3 from the development branch same issue.
Currently running with the firmware I have compiled 9.4.0.3 with followings options:

Capture d’écran 2021-05-07 à 14.03.20.png
I have removed the option SD card as I don't use the slot. Do you think this can create trouble  if no SD card and the option activated ?

Currently the looks much better, I mean only one connection to MQTT broker. Will wait few hours and see. In case this is OK, I will try to select version 9.2.0 as per reference from my post and try again.

frederic...@gmail.com

unread,
May 8, 2021, 12:15:57 PM5/8/21
to TasmotaUsers
I tried few other options like mqtt over tls, went back to 9.2.0. No improvement.
As soon as domoticz is enable, I get the issue. If domoticz is disabled, all good.

I give up....:-(

frederic...@gmail.com

unread,
May 31, 2021, 1:57:06 AM5/31/21
to TasmotaUsers
Hi,

I have got a new device and have the same issue.

I am doing a test.
Instead of using mosquitto broker on a raspberry where domoticz is running with option "false" to prevent loop, I use another mosquitto broker available on another raspberry where HA is running.

With the first case (raspberry domoticz), mosquitto version is 2.0.10.
With the second case (raspberry HA), mosquitto version is 1.6.12.

Do you think that the issue must be related to the version of mosquitto ? Or the fact that I have the option set to false to prevent loop ?
FYI, the issue regarding constant reconnection is only on esp webcam devices.

Philip Knowles

unread,
May 31, 2021, 3:11:54 AM5/31/21
to frederic...@gmail.com, TasmotaUsers

I think it may be Mosquitto V2 – there are a few Issues on GitHub with Tasmota users on V2 . The problem is that you have too many variables to check. If you update Mosquitto on the second Pi (or downgrade on the first) you can at least narrow it down.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: frederic...@gmail.com
Sent: 31 May 2021 06:57
To: TasmotaUsers
Subject: Re: Ai-thinker ESP32 - constant reconnection after few hours of use

 

Hi,

 

I have got a new device and have the same issue.

 

I am doing a test.

Instead of using mosquitto broker on a raspberry where domoticz is running with option "false" to prevent loop, I use another mosquitto broker available on another raspberry where HA is running.

 

With the first case (raspberry domoticz), mosquitto version is 2.0.10.

With the second case (raspberry HA), mosquitto version is 1.6.12.

 

Do you think that the issue must be related to the version of mosquitto ? Or the fact that I have the option set to false to prevent loop ?

FYI, the issue regarding constant reconnection is only on esp webcam devices.

 

Le samedi 8 mai 2021 à 18:15:57 UTC+2, frederic...@gmail.com a écrit :

I tried few other options like mqtt over tls, went back to 9.2.0. No improvement.

As soon as domoticz is enable, I get the issue. If domoticz is disabled, all good.

 

I give up....:-(

Le vendredi 7 mai 2021 à 14:08:04 UTC+2, frederic...@gmail.com a écrit :

With latest version 9.4.0.3 from the development branch same issue.

Currently running with the firmware I have compiled 9.4.0.3 with followings options:


frederic...@gmail.com

unread,
May 31, 2021, 3:16:06 AM5/31/21
to TasmotaUsers
Good point, I will try downgrade to 1.X.X instead of 2 and see how it goes.

I keep you in touch.

frederic...@gmail.com

unread,
May 31, 2021, 3:14:41 PM5/31/21
to TasmotaUsers
Work great now for both module as long as they deal with mosquitto 1.X.X (indeed not 2.X.X).
I will great an issue on the github. It might be interesting to troubleshooting this.

Philip Knowles

unread,
Jun 1, 2021, 6:32:12 AM6/1/21
to frederic...@gmail.com, TasmotaUsers

It could be as simple as

listener 1883
allow_anonymous true

as these are significant changes between 1.6 and 2.0 (apparently)

To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers..@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

frederic...@gmail.com

unread,
Jun 1, 2021, 7:18:48 AM6/1/21
to TasmotaUsers
Hello,

It was the setting I had when using mosquitto V2.0.10. With that configuration I had the modules working for few hours and got constant disconnections & reconnections.

Reply all
Reply to author
Forward
0 new messages