Frequent MQT Attempting connection... Unstable since 6.0.0a

347 views
Skip to first unread message

Tam481

unread,
Jun 30, 2018, 7:59:14 AM6/30/18
to SonoffUsers
hello all,
Has anyone else been experiencing this issue? I've upgraded from 5.2.1 to 6.0.0a and since then my Sonoff Basic has been really unstable making frequent attempts to connect to my MQTT broker (it seems). I have also added a Sonoff Touch unit which is doing the same thing but less frequently (I think) it's fairly new and I have not been able to monitor it as much.

09:26:53 MQT: Attempting connection...
09:26:53 MQT: Connected
09:26:53 MQT: tele/TLamp/LWT = Online (retained)
09:26:53 MQT: cmnd/TLamp/POWER = 
09:26:53 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
09:26:53 MQT: stat/TLamp/POWER = OFF (retained)
09:27:45 MQT: Attempting connection...
09:27:45 MQT: Connected
09:27:45 MQT: tele/TLamp/LWT = Online (retained)
09:27:45 MQT: cmnd/TLamp/POWER = 
09:27:45 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
09:27:45 MQT: stat/TLamp/POWER = OFF (retained)
09:32:10 MQT: Attempting connection...
09:32:10 MQT: Connected
09:32:10 MQT: tele/TLamp/LWT = Online (retained)
09:32:10 MQT: cmnd/TLamp/POWER = 
09:32:10 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
09:32:10 MQT: stat/TLamp/POWER = OFF (retained)
09:42:45 MQT: tele/TLamp/STATE = {"Time":"2018-06-30T09:42:45","Uptime":"0T08:48:14","Vcc":3.466,"POWER":"OFF","Wifi":{"AP":1,"SSId":"IOWifi","RSSI":100,"APMac":"24:AE:00:49:12:31"}}
09:42:45 MQT: tele/TLamp/SENSOR = {"Time":"2018-06-30T09:42:45","SI7021":{"Temperature":24.60,"Humidity":42.00},"TempUnit":"C"}
09:47:05 MQT: Attempting connection...
09:47:05 MQT: Connected
09:47:05 MQT: tele/TLamp/LWT = Online (retained)
09:47:05 MQT: cmnd/TLamp/POWER = 
09:47:06 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
09:47:06 MQT: stat/TLamp/POWER = OFF (retained)
09:47:45 MQT: Attempting connection...
09:47:45 MQT: Connected
09:47:45 MQT: tele/TLamp/LWT = Online (retained)
09:47:45 MQT: cmnd/TLamp/POWER = 
09:47:46 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
09:47:46 MQT: stat/TLamp/POWER = OFF (retained)
10:02:01 MQT: tele/TLamp/UPTIME = {"Time":"2018-06-30T10:02:01","Uptime":"0T09:07:30"}
10:02:49 MQT: tele/TLamp/STATE = {"Time":"2018-06-30T10:02:49","Uptime":"0T09:08:18","Vcc":3.459,"POWER":"OFF","Wifi":{"AP":1,"SSId":"IOWifi","RSSI":86,"APMac":"24:AE:00:49:12:31"}}
10:02:49 MQT: tele/TLamp/SENSOR = {"Time":"2018-06-30T10:02:49","SI7021":{"Temperature":25.00,"Humidity":43.40},"TempUnit":"C"}
10:19:20 MQT: Attempting connection...
10:19:20 MQT: Connected
10:19:20 MQT: tele/TLamp/LWT = Online (retained)
10:19:20 MQT: cmnd/TLamp/POWER = 
10:19:21 MQT: stat/TLamp/RESULT = {"POWER":"OFF"}
10:19:21 MQT: stat/TLamp/POWER = OFF (retained)

Colin Law

unread,
Jun 30, 2018, 8:13:57 AM6/30/18
to SonoffUsers
Have you accidentally got the same MQTT Client ID in both systems?
That will cause them both to keep re-connecting. Otherwise have a
look in the MQTT broker log to see if there are any clues.

Colin
> --
> You received this message because you are subscribed to the Google Groups
> "SonoffUsers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sonoffusers...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sonoffusers.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/sonoffusers/71d20fbc-8393-4d55-94ee-b31fcb88e825%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Tam481

unread,
Jun 30, 2018, 8:38:59 AM6/30/18
to SonoffUsers
I've added this to my user_config_override file

#undef  MQTT_CLIENT_ID
#define MQTT_CLIENT_ID         "TLamp"

Colin Law

unread,
Jun 30, 2018, 9:26:04 AM6/30/18
to SonoffUsers
On 30 June 2018 at 13:38, Tam481 <tam0...@gmail.com> wrote:
> I've added this to my user_config_override file
>
> #undef MQTT_CLIENT_ID
> #define MQTT_CLIENT_ID "TLamp"

Do you mean you have now added that or you already had it? If you
already had it is it different to other devices in the network?

Colin

>
> On Saturday, 30 June 2018 13:13:57 UTC+1, Colin Law wrote:
>>
>> Have you accidentally got the same MQTT Client ID in both systems?
>> That will cause them both to keep re-connecting. Otherwise have a
>> look in the MQTT broker log to see if there are any clues.
>>
>> Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "SonoffUsers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sonoffusers...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sonoffusers.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/sonoffusers/16d70ee5-7d9a-4344-bf7c-a6b8ccf8726f%40googlegroups.com.

Tam481

unread,
Jun 30, 2018, 9:35:31 AM6/30/18
to sonof...@googlegroups.com
I meant I had added it before posting my issue here as I read in the Troubleshooting Wiki page that it could be relevant but the issue persists despite manually changing the MQTT client ID 

Edit:
In all cases shouldn't the client ID be unique anyway as it uses part of the device MAC address!

Colin Law

unread,
Jun 30, 2018, 10:01:36 AM6/30/18
to SonoffUsers
Have you tried my other suggestion?

Colin

Colin Law

unread,
Jun 30, 2018, 10:03:55 AM6/30/18
to SonoffUsers
On Saturday, 30 June 2018 14:35:31 UTC+1, Tam481 wrote:

Edit:
In all cases shouldn't the client ID be unique anyway as it uses part of the device MAC address!


Yes, provided you have left it at the default.  Some people put identifiable names in as it makes it easier to follow mqtt logs and so on, you might have been one that did that and accidentally used the same id on both.

Colin

Tam481

unread,
Jun 30, 2018, 10:08:22 AM6/30/18
to SonoffUsers
I'm afraid I've run out of ideas. I only changed it when I started looking into the issue in order to be able to identify them in logs etc if necessary.

Colin Law

unread,
Jun 30, 2018, 10:09:32 AM6/30/18
to SonoffUsers
So what do you see in the MQTT log?

Tam481

unread,
Jun 30, 2018, 10:20:51 AM6/30/18
to SonoffUsers
TLamp still showing as "DVES_xxxx" despite me changing MQTT_CLIENT_ID. (I flashed the bin and reset 2 to apply changes but still didn't take for some reason)

Mosquitto log showing

1530242671: Socket error on client DVES_xxxxx, disconnecting.
1530242672: New connection from xxx.xxx.xxx.xxx on port 1883.
1530242672: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530244016: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1530245565: New connection from xxx.xxx.xxx.xxx on port 1883.
1530245565: Client DVES_xxxxx already connected, closing old connection.
1530245565: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530245817: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1530246117: Socket error on client DVES_xxxxx, disconnecting.
1530246117: New connection from xxx.xxx.xxx.xxx on port 1883.
1530246117: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530246168: New connection from xxx.xxx.xxx.xxx on port 1883.
1530246168: Client DVES_xxxxx already connected, closing old connection.
1530246168: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530246213: New connection from xxx.xxx.xxx.xxx on port 1883.
1530246213: Client DVES_xxxxx already connected, closing old connection.
1530246213: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530247078: Client DVES_xxxxx has exceeded timeout, disconnecting.
1530247081: New connection from xxx.xxx.xxx.xxx on port 1883.
1530247081: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).
1530247618: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1530248385: New connection from xxx.xxx.xxx.xxx on port 1883.
1530248385: Client DVES_xxxxx already connected, closing old connection.
1530248385: New client connected from xxx.xxx.xxx.xxx as DVES_xxxxx (c1, k15, usonoffuser).

Colin Law

unread,
Jun 30, 2018, 10:31:39 AM6/30/18
to SonoffUsers
Are the ip addresses you have redacted all the same?

Another possibility have you got two devices with the same ip address?

Tam481

unread,
Jun 30, 2018, 10:44:07 AM6/30/18
to SonoffUsers
Yes. All are for the TLamp

Colin Law

unread,
Jun 30, 2018, 11:34:25 AM6/30/18
to SonoffUsers
So with that one disconnected do you see any connections with id or client id?

Colin

Tam481

unread,
Jul 1, 2018, 7:01:09 AM7/1/18
to SonoffUsers
Yes. If you look at the log above, it seems to constantly disconnect and reconnect. The Sonoff Touch seems to also do the same thing but much less frequently. Both devices are now showing a readable client name and it is clear that TLamp is a lot worse.

Tam481

unread,
Jul 2, 2018, 4:41:18 PM7/2/18
to SonoffUsers
Just noticed that the issue seems to happen when the Sonoff is connected through my Xiaomi Repeater 2 (Same SSID as the master) 

Could this be the cause? I found this issue #2562. Could this be relevant?

Colin Law

unread,
Jul 2, 2018, 4:50:25 PM7/2/18
to SonoffUsers
On 2 July 2018 at 21:41, Tam481 <tam0...@gmail.com> wrote:
Just noticed that the issue seems to happen when the Sonoff is connected through my Xiaomi Repeater 2 (Same SSID as the master) 

Have you configured the Sonoff with fixed ip or using DHCP?  If using fixed ip connect your laptop to via the repeater and check the ip address it has been given,  is it a different subnet to the ip you have configured for the sonoff?

Can you connect reliably to the sonoff using the webserver?

Colin
 

Could this be the cause? I found this issue #2562. Could this be relevant?


On Sunday, 1 July 2018 12:01:09 UTC+1, Tam481 wrote:
Yes. If you look at the log above, it seems to constantly disconnect and reconnect. The Sonoff Touch seems to also do the same thing but much less frequently. Both devices are now showing a readable client name and it is clear that TLamp is a lot worse.

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

Tam481

unread,
Jul 3, 2018, 5:51:29 PM7/3/18
to SonoffUsers
No. The Sonoff has a statically assigned IP by my router but the device itself is configured to use DHCP. I checked for conflicts etc and that's not the case.

Colin Law

unread,
Jul 4, 2018, 3:39:10 AM7/4/18
to SonoffUsers
On 3 July 2018 at 22:51, Tam481 <tam0...@gmail.com> wrote:
> No. The Sonoff has a statically assigned IP by my router but the device
> itself is configured to use DHCP. I checked for conflicts etc and that's not
> the case.

So even though it is connected through the extender the router is till
issuing the address?

Are you able to access it reliably over the web interface, using that
ip address, when it is on the extender? I think I asked that before.
Also try running ping to the device for a period and make sure it gets
reliable results and is not missing any or any with long times.
Compare the result with it connected direct to the router if possible.

Colin


>> Have you configured the Sonoff with fixed ip or using DHCP? If using
>> fixed ip connect your laptop to via the repeater and check the ip address it
>> has been given, is it a different subnet to the ip you have configured for
>> the sonoff?
>>
>> Can you connect reliably to the sonoff using the webserver?
>>
>> Colin
>>
>>>
>>>
>>> Could this be the cause? I found this issue #2562. Could this be
>>> relevant?
>>>
>>>
>>> On Sunday, 1 July 2018 12:01:09 UTC+1, Tam481 wrote:
>>>>
>>>> Yes. If you look at the log above, it seems to constantly disconnect and
>>>> reconnect. The Sonoff Touch seems to also do the same thing but much less
>>>> frequently. Both devices are now showing a readable client name and it is
>>>> clear that TLamp is a lot worse.
>
> --
> You received this message because you are subscribed to the Google Groups
> "SonoffUsers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sonoffusers...@googlegroups.com.

João Cosme

unread,
Dec 21, 2018, 11:19:16 AM12/21/18
to SonoffUsers
Hi, I have the same issue... I can't solve this. I don't have any repeater or so... how did you solve it? Thank's

Philip Knowles

unread,
Dec 22, 2018, 12:04:18 AM12/22/18
to João Cosme, SonoffUsers
What version are you on?

Can you cut and paste the console output?

Regards

Phil K

--

Greg from Oz

unread,
Dec 22, 2018, 12:50:42 AM12/22/18
to SonoffUsers
Try 6.2.1 I had problems with 6 as well but 6.2.1 seems stable.

Kris J

unread,
Dec 22, 2018, 6:21:44 AM12/22/18
to SonoffUsers
I had that problem with clients reconnecting wile using firmware built with core 2.4.2.  
If I build the firmware with  core 2.3.0 all seems good.

prebuilt core 2.3.0 firmware here http://thehackbox.org/tasmota/release/020300/  If you need.

Hope it helps.

P.S.
Sorry to the person I emailed directly, I meant to email the Google group.

João Cosme

unread,
Dec 22, 2018, 7:23:09 AM12/22/18
to SonoffUsers
Hi. DONE! Really thanks bro :) it seems problem with some users. 6.2.1 its working well. Thanks :)

João Cosme

unread,
Dec 22, 2018, 7:24:36 AM12/22/18
to SonoffUsers
Problem solved. Thanks Guys. If anyone have same problem, use tasmota 6.2.1 or write "sleep 0" on console, Thanks

Greg from Oz

unread,
Dec 22, 2018, 7:38:18 AM12/22/18
to SonoffUsers
I use 6.2.1 and sleep 1 and it works fine.
Reply all
Reply to author
Forward
0 new messages