WiFi stability issues with TP-Link Archer C7 v5 and ESP8266 devices

Hello,

I have several ESP8266 devices at home (mostly Shelly 1 and Shelly 1 PM) connected to a separate SSID on a TP-Link Archer C7 v5 used as AP.
Some time ago I noticed that one of the ESP8266 devices (living-lamp) was randomly and constantly disconnecting/reconnecting to the MQTT broker (but not to the WiFi). All other devices were stable.
I tried investigating the device but nothing seems problematic with it.
After some time I decided to replace (just to test) the TP-Link Archer C7 v5 with a Linksys WRT1900ACS that was laying around (also configured as AP with the same configuration as the TP-Link Archer C7 v5) and after several days, everything was stable (no ESP8266 devices disconnected/reconnected to the MQTT broker).
I decided to go back to the TP-Link Archer C7 v5 and noticed that this time another ESP8266 device (bedroom-lamp) was randomly and constantly disconnecting/reconnecting to the MQTT broker (but again no WiFi disconnects). All other devices (including the one that was previously unstable - living-lamp - were stable).
But the question is : why only one device from all of them? And not the same one...
This let me conclude that the issue is not with the ESP8266 devices, but rather with the TP-Link Archer C7 v5 (as with the Linksys WRT1900ACS every device was stable).
Nothing appears in the logs of the TP-Link Archer C7 v5 when the ESP8266 device disconnects/reconnects to the MQTT broker.
I could just keep using the Linksys WRT1900ACS as the AP but I wanted to use wpa2/wpa3 mixed on the main SSID (not the one for the ESP8266 devices), but after trying to enable it, my Android devices couldn't connect anymore to WiFi. Also I wanted to activate fast roaming (as I initially intended to add the Linksys WRT1900ACS as a second AP for better coverage) and this also seems to be broken on Linksys WRT1900ACS. These seem to be a known limitation of mwlwifi -> WRT1900ACS - WiFi stopped working for Android phones after upgrade to OpenWrt 22.03.0.
On the other hand, this functionalities (wpa2/wpa3 mixed and fast roaming) seem to work reliability on TP-Link Archer C7 v5 (after enabling them and making a few tests).

So, does anybody know how I can further debug the instability caused by the TP-Link Archer C7 v5 on (only one, random) ESP8266 device (at a time)?

Please paste the disconnects and connects including 10 lines before and 10 lines after.
Redact public IP and MAC but use something if MAC changes. e.g. A,B,C etc.

I get this sometimes too but it is so fast it does not take up a second of time, so I ignore it and just wonder if someone is trying to get enough handshakes to try and crack my 22 character password.
I wish them either a fried computer or a natural death trying

1 Like

Open an ssh session to the router and leave logread ; logread -f running, to see the debug messages (among others) from hostapd, check if there are wireless disconnects or DHCP renewals around the time your device drops off the mqtt broker (and obviously keep tabs on its logging as well).
Do check what happens if you ping/ and or connect to the esp8266 webinterface (if installed) when the device is in a failed state.

Apart from that, roughly how many wireless devices are connected to the 2.4 GHz radio at the same time?

Please post the wireless configuration of your 2.4 GHz radio (obviously redact MAC addresses, ESSIDs and PSKs) from /etc/config/wireless.

1 Like

I will not discard the idea that the culprits are the ESP8266s, or perhaps the combination of these with a specific router. Fir example, he WRT3200 is notorious for having serious issues with the early versions of the firmware in the ESP8266, and the ESPHome project has a comment in there documentation about frequent disconnections on these devices.

There's been a couple of Shelly threads at the forum recently, might be worth reading.

I just get the line saying that the device disconnected and reconnected in the MQTT broker logs. Nothing on the TP-Link Archer C7 v5 at that moment (and I don't expect to see anything on these logs, as the device doesn't disconnect and reconnect from WiFi, just MQTT broker -> and I know this for sure as there are entities for WiFi and MQTT reconnects, and while the value for WiFi reconnects is always stable no matter what, the one for MQTT is increasing with every disconnects/reconnects I observe). But it has to do with something in (the WiFi driver of) the TP-Link Archer C7 v5 that creates these MQTT disconnects/reconnects.

As mentioned above, there aren't WiFi disconnects/reconnects, but rather something in the TP-Link Archer C7 v5 that provokes these MQTT disconnects/reconnects.
That is why in my original post and in the title, I didn't mention "WiFi disconnects" but rather "WiFi stability issues".

At most 20. I wouldn't expect this to be a problem...

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel '6'
	option band '2g'
	option htmode 'HT20'
	option country 'XX'
	option cell_density '0'

config wifi-iface 'wifinetx'
	option device 'radio1'
	option mode 'ap'
	option ssid 'IoT'
	option encryption 'psk2+ccmp'
	option isolate '1'
	option ifname 'iot-24'
	option key 'xxxxxxxxxxxxxxxxxxxxx'
	option network 'iot'

This is exactly the case : there are instabilities with TP-Link Archer C7 v5, but none with Linksys WRT1900ACS. But I wouldn't say that the issue is with the ESP8266, as everything works perfectly with the Linksys WRT1900ACS that also has the latest OpenWRT firmware on it.

Had a look at it, but mine all have Tasmota on them (which I forgot to mention, but I am not really sure it matters as, like I said, with the Linksys WRT1900ACS it works flawlessly). Didn't find someone with the same issue in my researches on this forum so far.

I feel like this is a lost battle, as it seems to be too low level for my knowledge, to be able to debug.
In this case, can you recommend a router (5 ethernet ports) with good WiFi support : stability (as I wouldn't want to have the same issue with the ESP8266 devices on the TP-Link Archer C7 v5), features (WiFi Fast Roaming, WPA2/WPA3 Mixed -> as these are not functional on Linksys WRT1900ACS), future proof (enough CPU power, RAM, and Flash space to support OpenWRT for many years). In essence a mix of the TP-Link Archer C7 v5 and the Linksys WRT1900ACS.
I have stumbled upon the TP-Link Archer AX23 which seems really nice, but has really limited RAM and Flash to be future proof (and also I couldn't judge the "features" part from above, as I would need to activate the Fast Roaming and WPA2/WPA3 Mixed mode and check if they are functional).

Have you updated the Tasmota firmware on the ESP8266s?

Yes, latest version on all of them.
Regardless of the version that was on the ESP8266, I always encountered the issue with the TP-Link Archer C7 v5 and never with the Linksys WRT1900ACS.