Wifi adapter shuts down from time to time

I upgraded my TP-Link Archer C7 from OpenWrt to "LuCI lede-17.01 branch (git-18.033.59178-3d46f25) / LEDE Reboot 17.01.4 r3560-79f57e422d".

Since that time I have the problem that from time to time my Wifi interface is shutting down. If this happens I can see the enclosed log messages.

I need to disable and re-enable the interface. Afterwards everything works fine again.

As a work around I have created a cron job which checks every minute if the adapter is still working and restarting it if not. However I hope that someone might be able to help me to find the root cause ...

Thanks a lot.

Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: interface state ENABLED->DISABLED
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1-1: AP-DISABLED
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1-1: CTRL-EVENT-TERMINATING
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Network device 'wlan1-1' link is down
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Interface 'guest' has link connectivity loss
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Interface 'guest' is now down
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Interface 'guest' is disabled
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED XXXXXXXXXX
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: AP-DISABLED
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: wlan1: CTRL-EVENT-TERMINATING
Sat Feb 10 18:25:26 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Sat Feb 10 18:25:26 2018 kern.info kernel: [76971.953467] device wlan1 left promiscuous mode
Sat Feb 10 18:25:26 2018 kern.info kernel: [76971.958094] br-lan: port 2(wlan1) entered disabled state
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Network device 'wlan1' link is down
Sat Feb 10 18:25:27 2018 daemon.info odhcpd[939]: Using a RA lifetime of 1800 seconds on br-lan
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.260642] ath: EEPROM regdomain: 0x8114
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.264752] ath: EEPROM indicates we should expect a country code
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.270925] ath: doing EEPROM country->regdmn map search
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.276324] ath: country maps to regdmn code: 0x37
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.281178] ath: Country alpha2 being used: DE
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.285691] ath: Regpair used: 0x37
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.289230] ath: regdomain 0x8114 dynamically updated by user
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.300479] ath: EEPROM regdomain: 0x8114
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.304563] ath: EEPROM indicates we should expect a country code
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.310736] ath: doing EEPROM country->regdmn map search
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.316131] ath: country maps to regdmn code: 0x37
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.320988] ath: Country alpha2 being used: DE
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.325501] ath: Regpair used: 0x37
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.329041] ath: regdomain 0x8114 dynamically updated by user
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.400648] ath: EEPROM regdomain: 0x809e
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.404755] ath: EEPROM indicates we should expect a country code
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.410936] ath: doing EEPROM country->regdmn map search
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.416340] ath: country maps to regdmn code: 0x50
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.421195] ath: Country alpha2 being used: TW
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.425709] ath: Regpair used: 0x50
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.429391] ath: regdomain 0x809e dynamically updated by user
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.440655] ath: EEPROM regdomain: 0x809e
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.444739] ath: EEPROM indicates we should expect a country code
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.450915] ath: doing EEPROM country->regdmn map search
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.456307] ath: country maps to regdmn code: 0x50
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.461164] ath: Country alpha2 being used: TW
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.465677] ath: Regpair used: 0x50
Sat Feb 10 18:25:31 2018 kern.debug kernel: [76977.469216] ath: regdomain 0x809e dynamically updated by user
Sat Feb 10 18:25:32 2018 daemon.notice netifd: radio1 (32169): sh: acs_survey: out of range
Sat Feb 10 18:25:33 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Sat Feb 10 18:25:33 2018 kern.info kernel: [76978.858430] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
Sat Feb 10 18:25:33 2018 kern.info kernel: [76978.868066] device wlan1 entered promiscuous mode
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: wlan1: interface state COUNTRY_UPDATE->ACS
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: wlan1: ACS-STARTED
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed
Sat Feb 10 18:25:33 2018 daemon.notice hostapd: handle_probe_req: send failed

SSH in to the router and run the following...

cat /etc/config/network

cat /etc/config/wireless

Note: Make sure to obscure the "option key" value(s) in the wireless config results before posting.

1 Like

Thanks, Jim. Find enclosed the content of the files. I masked all stuff which I do not want to be publicly available. Let me know if you need something of that as well:

/etc/config/network:
====================

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'XXXXXXXXXXXXXX'

config interface 'lan'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr 'XXXXXXXXXX'
        option netmask 'XXXXXXXXXX'
        option _orig_ifname 'eth1 wlan0 wlan1'
        option _orig_bridge 'true'
        option ifname 'eth1'
        option dns 'XXXXXXXXXX'
        option ip6assign '64'

config interface 'wan'
        option ifname 'eth0'
        option _orig_ifname 'eth0'
        option _orig_bridge 'false'
        option proto 'static'
        option ipaddr 'XXXXXXXXXX'
        option netmask 'XXXXXXXXXX'
        option gateway 'XXXXXXXXXX'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 2 3 4 5'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 6'

config route
        option interface 'lan'
        option target 'XXXXXXXXXX'
        option netmask 'XXXXXXXXXX'
        option gateway 'XXXXXXXXXX'

config interface 'guest'
        option _orig_ifname 'wlan1-1'
        option _orig_bridge 'false'
        option proto 'static'
        option ipaddr 'XXXXXXXXXX'
        option netmask 'XXXXXXXXXX'
        option ipv6 '1'

config route
        option interface 'lan'
        option target 'XXXXXXXXXX'
        option netmask 'XXXXXXXXXX'
        option gateway 'XXXXXXXXXX'

config interface 'henet'
        option proto '6in4'
        option peeraddr 'XXXXXXXXXX'
        option ip6addr 'XXXXXXXXXX'
        option tunnelid 'XXXXXXXXXX'
        option username 'XXXXXXXXXX'
        option password 'XXXXXXXXXX'
        option ip6prefix 'XXXXXXXXXX'


-----------

/etc/config/wireless:
====================

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:01/0000:01:00.0'
        option bursting '1'
        option ff '1'
        option compression '1'
        option country 'DE'
        option txpower '14'
        option channel '36'
        option htmode 'HT20'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'XXXXXXXXXX'
        option encryption 'psk2'
        option key 'XXXXXXXXXX'
        option network 'lan'
        option disabled '1'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/qca955x_wmac'
        option htmode 'HT40'
        option bursting '1'
        option ff '1'
        option compression '1'
        option noscan '1'
        option channel 'auto'
        option country 'TW'
        option txpower '25'

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'XXXXXXXXXX'
        option encryption 'psk2'
        option network 'lan'
        option key 'XXXXXXXXXX'
        option macfilter 'allow'
        list maclist 'XXXXXXXXXX'
        list maclist 'XXXXXXXXXX'
		list maclist 'XXXXXXXXXX'
        list maclist 'XXXXXXXXXX - and some more mac list lines ...'		

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'XXXXXXXXXX'
        option network 'guest'
        option encryption 'psk-mixed'
        option key 'XXXXXXXXXX'
1 Like

2.4 Ghz -

Take channel selection off auto and use either channel 1, 6, or 11.

Set channel width to HT20.

Transmit power can be set up to 25.

5 Ghz -

Change the channel to one in the higher range that doesn't require DFS, In the US, I recommend starting at 153.

Set channel width to VHT80.

Transmit power can be set up to 30.

Both -

Set encryption to WPA2-PSK and AES.

I would also recommend Lizard Systems free WiFi Scanner to see what wireless traffic in your area looks like…

https://lizardsystems.com/wi-fi-scanner

1 Like

Hi Jim, thanks. I changed the config to the suggested values. Could you explain to me why you think these settings will make the Wifi interface more stable? Should mean, why would my former settings could have caused the interface to shutdown automatically?

In Germany/Europe 1, 5, 9, 13 actually allow one more undisturbed channel than the 1, 6, 11 combination recommended in the U.S., see https://en.wikipedia.org/wiki/List_of_WLAN_channels.

I agree that 40 MHz is pushing it on 2.4GHz (there is only room for two such 40Mhz broadcasters in the available 2.4 GHz spectrum, so unless you have no neighbors 40 MHz will probably be less robust than 20 MHz), even though I always assumed that the AP would degrade to 20 MHz channel given enough on-air competition.

This seems wrong, I would guess this should be DE as well

1 Like

Just to make sure: My issue is not an unstable Wifi connection. If the Wifi adapter is acive then all connections are stable and fast. However, from time to time (once a week or so), Wifi on the router shuts down completely. See the log entries in my first post. Then I need to re-enable the Wifi adapter on the router again.

Sat Feb 10 18:25:26 2018 kern.info kernel: [76971.958094] br-lan: port 2(wlan1) entered disabled state
Sat Feb 10 18:25:26 2018 daemon.notice netifd: Network device 'wlan1' link is down

Except when neighboring connections are using 1, 6, 11 which will cause issues for those using 1, 5, 9, 13.

I did read your initial post.

Try running with those settings and see if it helps.

Lots of info online about channel selection, channel width, and encryption.

One of the guides you might look at is on DD-WRT's wiki...

https://dd-wrt.com/wiki/index.php/QCA_wireless_settings

This seems to describe a similar problem. I have the same hardware:

However, I have no additional USB device active on the router. And I had never the issue with OpenWRT before.

Ok, will give it a try. If that does not help I will also disable SQM as I am unsure if the issue started to happen directly after upgrading to LEDE or 2 weeks later after I added SQM.

Another one reporting similar issue with that hardware, but the solution does not work for my settings as I do not have set "Distance Optimization":

1 Like

If you have set up SQM by following the guidelines in the LEDE User Guide, it should not be causing issues...

https://openwrt.org/docs/user-guide/sqm

As you have seen, several things can cause similar issues.

You can set Distance Optimization in LuCI by clicking on Network > Wireless and click on a radio link at the top.

Then in Device Configuration, click on the Advanced Settings tab.

I personally have both radios set to 1350, but it depends on your maximum distance from the router.

Another thought...if you upgraded from an older version of OpenWrt and used the old configurations, that could also be a contributing factor.

In that case, I would reset LEDE to factory settings, and reconfigure from scratch.

1 Like

Many thanks. I will now try the following things:

  1. Wait, if the settings I made according the information above will already help
  2. If not, try to disable SQM, although we all do not think it might have something to do
  3. If nothing helps, reset LEDE to factor defaults and manually reconfigure all settings (this I will do only if really nothing else helps ;-))

I will give an update here, which things solved the issue. It will take some time to make sure it is solved, as the Wifi shutdown was not reproducable and not happening very often.

That sounds like a good plan.

If it comes to that, this OpenWrt wiki article will help make it much less painful...

https://wiki.openwrt.org/doc/howto/generic.sysupgrade

Did you manage to find a solution for your issue? I'm having the same problem with my TP-LINK and I'm going insane with this.

No, I did not. In the meantime I switched from OpenWrt to pfSense ... And switched my Wifi to Ubiquiti

I having the same issue as above (similar sys log with @m0urs 's c7) and done multiple of checking on the config for weeks. It just somehow wlan1: interface state ENABLED->DISABLED for no reason.

When I was going to give up on it last week, I push the 'On/Off' switch behind the C7 toward 'Off' (from 'On').

One week past and so far no interface state ENABLED->DISABLE

Note: It might not apply to you. Just to share

i have the same problem. how did you make this cron job that check every minute adapter?

1 Like