WiFi issue or something else?

After a bit of advice if i may.

I’ve got around 10 or so Sonoff Tasmota switches in and around the house. I’ve got my HA installed on a Pi3 connected to my router via Ethernet. I’ve also got my Texecom Smart Connect connected to router via Ethernet.

In all, i have around 20 WiFi devices (laptops, smart switches, nest, phones, tablet, TVs etc.) and i’ve just configured two new Sonoffs (S26 and TH10) using bin file and then added some base level config via termite and after that i went and added custom names and configured the switch type and i’ve not had a problem with this approach before now.

The two new switches will connect to the router, connect to the mosquito broker and i can toggle them in HA front end but they both keep dropping WiFi connection. Do you think this is a broker issue or a WiFi issue? I don’t think it’s a configuration issue, but happy to hear ideas.

This is the log out of Mosquito;

Log

1543932537: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543932537: Client DVES_43AA68 already connected, closing old connection. 1543932537: Client DVES_43AA68 disconnected. 1543932537: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543932568: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543932568: Client DVES_43AA68 already connected, closing old connection. 1543932568: Client DVES_43AA68 disconnected. 1543932568: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543932687: New connection from 94.197.121.220 on port 1883. [INFO] found Rosie on Home Assistant 1543932689: Client rosierosiephone already connected, closing old connection. 1543932689: Client rosierosiephone disconnected. 1543932689: New client connected from 94.197.121.220 as rosierosiephone (c0, k3600, u’Rosie’). 1543932710: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543932710: Socket error on client DVES_43AA68, disconnecting. 1543933163: Client 7ee32dbb-9121-4d96-b877-bba0b6e69d5a disconnected. 1543933827: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543933827: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543933837: New connection from 192.168.1.30 on port 1883. [INFO] found MQTT-USER on local database 1543933837: New client connected from 192.168.1.30 as DVES_31A136 (c1, k15, u’MQTT-USER’). 1543933924: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543933924: Socket error on client DVES_43AA68, disconnecting. 1543934024: Client DVES_31A136 has exceeded timeout, disconnecting. 1543934024: Socket error on client DVES_31A136, disconnecting. 1543934103: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934103: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934170: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934170: Socket error on client DVES_43AA68, disconnecting. 1543934196: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934196: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934248: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934248: Socket error on client DVES_43AA68, disconnecting. 1543934290: New connection from 192.168.1.30 on port 1883. [INFO] found MQTT-USER on local database 1543934290: New client connected from 192.168.1.30 as DVES_31A136 (c1, k15, u’MQTT-USER’). 1543934312: Saving in-memory database to /data/mosquitto.db. 1543934314: New connection from 192.168.1.30 on port 1883. [INFO] found MQTT-USER on local database 1543934314: Client DVES_31A136 already connected, closing old connection. 1543934314: Client DVES_31A136 disconnected. 1543934314: New client connected from 192.168.1.30 as DVES_31A136 (c1, k15, u’MQTT-USER’). 1543934340: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934340: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934387: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934387: Client DVES_43AA68 already connected, closing old connection. 1543934387: Client DVES_43AA68 disconnected. 1543934387: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934396: Client DVES_31A136 has exceeded timeout, disconnecting. 1543934396: Socket error on client DVES_31A136, disconnecting. 1543934427: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934427: Socket error on client DVES_43AA68, disconnecting. 1543934487: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934487: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934509: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934509: Socket error on client DVES_43AA68, disconnecting. 1543934530: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934530: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934553: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934553: Socket error on client DVES_43AA68, disconnecting. 1543934656: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934656: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934679: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934679: Socket error on client DVES_43AA68, disconnecting. 1543934942: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543934942: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543934979: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543934979: Socket error on client DVES_43AA68, disconnecting. 1543935263: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543935263: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543935286: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543935286: Socket error on client DVES_43AA68, disconnecting. 1543935327: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543935327: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543935347: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543935348: Client DVES_43AA68 already connected, closing old connection. 1543935348: Client DVES_43AA68 disconnected. 1543935348: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543935371: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543935371: Socket error on client DVES_43AA68, disconnecting. 1543935446: New connection from 192.168.1.27 on port 1883. [INFO] found MQTT-USER on local database 1543935446: New client connected from 192.168.1.27 as DVES_43AA68 (c1, k15, u’MQTT-USER’). 1543935498: Client DVES_43AA68 has exceeded timeout, disconnecting. 1543935498: Socket error on client DVES_43AA68, disconnecting.

Is the error just caused by the switch losing connection to WiFi is the socket error causing the WiFi issue. I can’t ping either switch after the socket error. Seems like they both connect and disconnect a lot, which may also be causing the issue?

S26 configured as S20 in Tasmota
TH11 configured as TH10 in Tasmota

termite script add SSID, password, mqtt host ip, mqttuser, mqtt password, as well as switchretain off, powerretain off, poweronstate 3

The client already connected error quite often means you already have a different sonoff with the same client_id already connected. Check that all your client_id’s are unque.

The client id for all of my Tasmota devices is DVES_%06X, which should make all ID’s unique as it is based off the mac address.

Theoretically yes, but these are cheap components and it is perfectly possible for them to be using illegitimate chips that are reusing mac addresses.

Checking should be as simple as turning off the new devices and seeing if anything else with that client id connects, so it is worth doing before going further.

It is also possible that the sonoff is disconnecting and re-connecting before the broker has detected it has gone, which would cause the same error. If its a wifi problem, it could be signal strength related, or your router could be overloaded with the number of connections. Moving the sonoffs and turning off other items should eliminate those possibilities.

1 Like

I did check to see if i had any ID clashes and i don’t, all of them are defined in the same way and all have unique mac addresses. I’ve made some additions to the standard Tasmota client_ID and they are both up at the moment, hopefully that fixes it. Thanks for your help, gpbenton.

Edit: to add, it was certainly some sort of clash causing the problem. Both were stable if the other was turned off, but if both were on then after a few minutes i’d lose them both. Changing one of the client id’s would keep it stable so i repeated this on the 2nd device.

BIt strange, any ideas why it would happen with them both being unique?

Actually, both have crashed again so this hasn’t fixed it.

1543946357: Client OLDVES_31A136 has exceeded timeout, disconnecting.
1543946357: Socket error on client OLDVES_31A136, disconnecting.
1543946762: New connection from 192.168.1.27 on port 1883.
[INFO] found MQTT-USER on local database
1543946762: New client connected from 192.168.1.27 as POW_DVES_43AA68 (c1, k15, u’MQTT-USER’).
1543946844: Client POW_DVES_43AA68 has exceeded timeout, disconnecting.
1543946844: Socket error on client POW_DVES_43AA68, disconnecting.

I rebooted HA and both are up and have been up for a few hours so I guess it was just a glitch.

I have the exact same issue with a very similar HASS and Sonoff tasmota setup. I am running 0.86.2 on a HP micro PC. I spent a lot of money on Ubiquity unify to try to avoid these type of things. I’m no expert so perhaps throwing money at the problem is not the solution. Feeling a bit frustrated. All help with this is appreciated. Thanks

Did you ever get this sorted Denis?