Tasmota Connection Failed

I dont see why this would be an issue if he can connect to the plug by tasmota web UI. Seams the routing is working just fine, if your not sure, ping from HA command line the tasmota plug and from tasmota console the HA server (edit: the tasmota has in standard config no ping capability).

Anyhow, I have a home style DSL router that is handling way more than 255 ip clients on a /16 net. And I dont know of any half recent hardware with the limitations your describing.

You are lucky then, once I went over my limit, I had the same …trying to connect…retrying in… error. Adding a WAP and assigning another SSID fixed my issues and it has been rock solid ever since.

Well, I just found out that pinging from a tasmota isnt the easiest thing. ping is not activated by default… so strike that.

And indeed I remember some older routers having problems managing more than a bunch of IP clients via dhcp, that should not be an issue if you set static ip.

This goes on tasmota with ‘ipaddress1 xxx.xxx.xxx.xxx’ form console

However since the device is accessible via web UI I dont think thats the issue here.

what gets me a bit flabbergasted, is the wp5 not going to the 11 firmware. the update routine from 8 something worked just fine on my nous A1 wich is basically the same smart plug inside.

Hello
My whole network is Ubiquiti.

HA is set up as a virtual machine on a Proxmox server.

I can ping 192.168.4.113 and the newly assigned static IP of 192.168.4.96 from the HA terminat at 192.168.4.2.

Check out the console print out. First there’s and rc -2 then it connects to HA and the entity is recognize. So what does this prove? Hopefully it will stay connected!

19:50:41 MQT: Connect failed to 192.168.4.2:1883, rc -2. Retry in 10 sec
19:50:52 MQT: Attempting connection…
19:50:52 MQT: Connect failed to 192.168.4.2:1883, rc -2. Retry in 10 sec
19:51:03 MQT: Attempting connection…
19:51:03 MQT: Connect failed to 192.168.4.2:1883, rc -2. Retry in 10 sec
19:51:14 MQT: Attempting connection…
19:51:14 MQT: Connect failed to 192.168.4.2:1883, rc -2. Retry in 10 sec
19:51:25 MQT: Attempting connection…
19:51:25 MQT: Connect failed to 192.168.4.2:1883, rc -2. Retry in 10 sec
19:51:36 MQT: Attempting connection…
19:51:36 MQT: Connected
19:51:36 MQT: tele/switch_gosund_plug_1/LWT = Online (retained)
19:51:36 MQT: cmnd/switch_gosund_plug_1/POWER =
19:51:36 MQT: tele/switch_gosund_plug_1/INFO1 = {“Module”:“Gosund-WP5”,“Version”:“9.1.0(tasmota)”,“FallbackTopic”:“cmnd/DVES_25BFE5_fb/”,“GroupTopic”:“cmnd/tasmotas/”}
19:51:36 MQT: tele/switch_gosund_plug_1/INFO2 = {“WebServerMode”:“Admin”,“Hostname”:“Gosund_Plug_1”,“IPAddress”:“192.168.4.96”}
19:51:36 MQT: tele/switch_gosund_plug_1/INFO3 = {“RestartReason”:“Software/System restart”}
19:51:36 MQT: stat/switch_gosund_plug_1/RESULT = {“POWER”:“OFF”}
19:51:36 MQT: stat/switch_gosund_plug_1/POWER = OFF
19:51:37 MQT: homeassistant/switch/25BFE5_RL_1/config = {“name”:“Sun_Room”,“stat_t”:“tele/switch_gosund_plug_1/STATE”,“avty_t”:“tele/switch_gosund_plug_1/LWT”,“pl_avail”:“Online”,“pl_not_avail”:“Offline”,“cmd_t”:“cmnd/switch_gosund_plug_1/POWER”,“val_tpl”:"{{value_json.POWER}}",“pl_off”:“OFF”,“pl_on”:“ON”,“uniq_id”:“25BFE5_RL_1”,“dev”:{“ids”:[“25BFE5”]}} (retained)
19:51:37 MQT: homeassistant/sensor/25BFE5_status/config = {“name”:“Tasmota status”,“stat_t”:“tele/switch_gosund_plug_1/HASS_STATE”,“avty_t”:“tele/switch_gosund_plug_1/LWT”,“pl_avail”:“Online”,“pl_not_avail”:“Offline”,“json_attr_t”:“tele/switch_gosund_plug_1/HASS_STATE”,“unit_of_meas”:"%",“val_tpl”:"{{value_json[‘RSSI’]}}",“ic”:“mdi:information-outline”,“uniq_id”:“25BFE5_status”,“dev”:{“ids”:[“25BFE5”],“name”:“Tasmota”,“mdl”:“Gosund-WP5”,“sw”:“9.1.0(tasmota)”,“mf”:“Tasmota”}} (retained)
19:51:40 MQT: tele/switch_gosund_plug_1/STATE = {“Time”:“2022-03-02T19:51:40”,“Uptime”:“0T00:02:54”,“UptimeSec”:174,“Heap”:26,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:1,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“IoT”,“BSSId”:“E6:63:DA:A4:73:19”,“Channel”:1,“RSSI”:56,“Signal”:-72,“LinkCount”:1,“Downtime”:“0T00:00:03”}}
19:52:30 MQT: tele/switch_gosund_plug_1/STATE = {“Time”:“2022-03-02T19:52:30”,“Uptime”:“0T00:03:44”,“UptimeSec”:224,“Heap”:26,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:1,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“IoT”,“BSSId”:“E6:63:DA:A4:73:19”,“Channel”:1,“RSSI”:58,“Signal”:-71,“LinkCount”:1,“Downtime”:“0T00:00:03”}}
19:52:30 MQT: stat/switch_gosund_plug_1/RESULT = {“POWER”:“OFF”}
19:52:30 MQT: stat/switch_gosund_plug_1/POWER = OFF

well, thats wired, the only thing I see is an intermediate wifi connection issue.

have you been in the console while this rc2 happend? did it update right away, or did you return to the browser tab after it happend?

could you for test sake plug the wp5 right next to your Access-Point?

My plug right next to an AP reports -36 yours report Signal -71, maybe a signal issue?

I just checked, Signal -71 is real bad wifi signal. its probably a distance issue.

try a reset 3 from console, wait till its online again and then power cycle it by unplugging. this should recalibrate the wifi unit.

At my home Signal -71 means several steel reinforced concrete walls upward of 25cm and a concrete floor also reinforced and about the same thickness plus its floating screed and aobut 15m distance.

Hence the rc-2 errors from the console and issue of staying connected.

Maybe the kind folk on Tasmota Discord can see something more irregular from your logs?

Good luck with it and let us know how you go :+1:

Hello
Placed the wp5 1M away from the the AP

“Channel”:1,“RSSI”:100,“Signal”:-45,“LinkCount”:1,“Downtime”:“0T00:00:03”}}

Did a “reset 3” and power cycled the unit.

“Channel”:1,“RSSI”:100,“Signal”:-41,“LinkCount”:1,“Downtime”:“0T00:00:03”}}

So to recap.
Did a firmware upgrade
Assigned a static IP address
Verified the signal strength at the wp5 location
Verified signal strength when the wp5 was directly under an AP

I have two AP’s and maybe they both are to far away? Time to add a third?

See how the device behaves next to your router. Maybe Restart the device a few times from the console. Check the logs, does the rc error still appear ? Trial and error approach basically.

Possible, maybe, not sure :wink:

Take care my friend.

I had two Tasmotas behaving this way. Nothing helped. Even a backup restore from times when they worked resulted in the same behavior.

What did the trick was running a firmware upgrade on both Tasmotas.

Thanks for the update. Did you update them to the current firmware available at the time? For example I have a device running Tasmota Firmware version 8.5.1. If I upgrade it to the current version then it would be at V 12.0.2.

Yes, my NodeMCUs were running Tasmota 9.5.0, and were upgraded via the “Start upgrade” button under “OTA Url/Upgrade by web server” to 12.0.2. Just hit the “Start upgrade” button, without changing anything in the Url field.

Just in case someone stumbles upon this thread like I did:

My Tasmotas (v. 10.0) behaved strangely too, regularly losing the connection to the broker and being unable to reconnect without a restart.

Problem was again: NTP.

I compiled three NTP servers into the firmware, the first two being my own, the third one of the pools.

Sometime last year I had to reinstall the main server after the root drive crash.
I simply forgot to install the (first) NTP server again and while the second and third servers were online all the time, the connection to the first seems to be of more importance.

After reading this thread I reinstalled the NTP and voilà - no connection drops anymore for one week straight.

I am pretty sure that you saved me a lot of headache with this comment! I recently flashed my sonoff sv with tasmota to controll my outside gate and I had a lot of issues where I would get notifications that the gate was opened and then immediately after closed. I did lots of troubleshooting replacing the reed sensors, re-wiring everything, relpacing the sonoff sv etc. None of that helped. I then realised that the device goes unavailable every 3-5 minutes and when it becomes available again, the state updates and I get a notification about the gate opening and closing because of that. I then looked into the logs from Tasmota and saw " Attempting MQTT connection…failed, rc=-2 try again in 5 seconds" as well as rc=-4 errors.

I was reading through lots of posts, almost ordered shelly uni to replace my sonoff (probably a good thing to do at some point anyway) and then saw your comment!

My topic was sonoffsv_outside_gate and I swear that as soon as I changed it to outsidegate everything settled down. Not only does the device not show as unavailable anymore in HA but things also got better with my other sonoff sv that I use with the garage gate. As if the MQTT broker was struggling with the old topic format?
It might sound crazy but even the page where you can configure your tasmota device changed from loading for very long time to being super responsive.

So thank you! Let’s see if things remain stable the coming days but so far so good!

EDIT:
I spoke to soon… after a relatively long period of everything being fine, I get the device unavailable status every couple of minutes again. Usually with the rc -2 error code.