Random ordering of wlan0 and wlan1 at boot time? (wndr3700)

Hi,

I am really struggling with this!

I have some scripts that run along time after boot to toggle the 2.4g and 5.0g radios on a netgear wndr3700 (OpenWrt 21.02.2, r16495-bf0c965af0)

The scripts use uci to toggle the interfaces and then the standard 'ip' or 'ifconfig' to check the new interface is up and running Ok with an address.

After much poking around I think the issue is that the naming of wlan0 and wlan1 is not consistent between boots, (i.e sometimes wlan0 is the 2.4g radio other times its the 5g radio). The wndr3700 is also 'confused' as it sometimes shows the blue 5ghz radio light when the 2.4ghz radio is definitely in operation :frowning:

So how can you be sure, with your own scripts which interface you have, and in general how are the names given to the interfaces at boot time (first up wlan0?) ?

This sequence details the problem, the wndr in this state shows the blue light for the 5Ghz radio in operation, when infact everything else points to the 2.4g being up.

The script to bring up the 2.4ghz radio:

root@OpenWrt:/# cat ./wifi24.sh 
uci set wireless.radio24.disabled=0
uci set wireless.radio50.disabled=1
uci commit
/etc/init.d/network reload

Running the script:
 ./wifi24.sh 
'radio50' is disabled
'radio50' is disabled

Checking the config, shows 2.4 should be on and 5 off.
uci show wireless.radio24
wireless.radio24=wifi-device
wireless.radio24.type='mac80211'
wireless.radio24.path='pci0000:00/0000:00:11.0'
wireless.radio24.htmode='HT40'
wireless.radio24.channel='auto'
wireless.radio24.band='2g'
wireless.radio24.disabled='0'

root@OpenWrt:/# uci show wireless.radio50
wireless.radio50=wifi-device
wireless.radio50.type='mac80211'
wireless.radio50.channel='36'
wireless.radio50.band='5g'
wireless.radio50.path='pci0000:00/0000:00:12.0'
wireless.radio50.htmode='HT40'
wireless.radio50.country='GB'
wireless.radio50.disabled='1'

logread -f, shows wlan1 is up

Tue May  9 08:36:48 2023 daemon.notice netifd: Wireless device 'radio24' is now up
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: SME: Trying to authenticate with c0:a3:6e:df:3e:62 (SSID='AccessPointName' freq=2462 MHz)
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.525868] wlan1: authenticate with c0:a3:6e:df:3e:62
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.546170] wlan1: send auth to c0:a3:6e:df:3e:62 (try 1/3)
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.554192] wlan1: authenticated
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: Trying to associate with c0:a3:6e:df:3e:62 (SSID='AccessPointName' freq=2462 MHz)
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.562755] wlan1: associate with c0:a3:6e:df:3e:62 (try 1/3)
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.572962] wlan1: RX AssocResp from c0:a3:6e:df:3e:62 (capab=0x1411 status=0 aid=2)
Tue May  9 08:36:51 2023 kern.warn kernel: [ 6204.580792] br-lan: received packet on eth0.1 with own address as source address (addr:00:24:b2:58:f0:48, vlan:0)
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.591481] wlan1: associated
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: Associated with c0:a3:6e:df:3e:62
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Tue May  9 08:36:51 2023 daemon.notice netifd: Network device 'wlan1' link is up
Tue May  9 08:36:51 2023 daemon.notice netifd: Interface 'wwan' has link connectivity
Tue May  9 08:36:51 2023 daemon.notice netifd: Interface 'wwan' is setting up now
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: WPA: Key negotiation completed with c0:a3:6e:df:3e:62 [PTK=CCMP GTK=CCMP]
Tue May  9 08:36:51 2023 daemon.notice wpa_supplicant[1399]: wlan1: CTRL-EVENT-CONNECTED - Connection to c0:a3:6e:df:3e:62 completed [id=0 id_str=]
Tue May  9 08:36:51 2023 kern.info kernel: [ 6204.626909] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Tue May  9 08:36:51 2023 daemon.notice netifd: wwan (6021): udhcpc: started, v1.33.2
Tue May  9 08:36:51 2023 daemon.notice netifd: wwan (6021): udhcpc: sending discover

Confirming wlan1 is running @2.4g

root@OpenWrt:/# iwinfo wlan1 info 
wlan1     ESSID: "AccessPointName"
          Access Point: 00:24:B2:58:F0:48
          Mode: Client  Channel: 11 (2.462 GHz)
          Center Channel 1: 11 2: unknown
          Tx-Power: 17 dBm  Link Quality: 49/70
          Signal: -61 dBm  Noise: -95 dBm
          Bit Rate: 1.0 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 168C:0029 168C:A095 [Atheros AR9223]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy1

BUT BUT, the light on the front of the box says that ONLY the 5ghz radio is running AND
sometimes after boot wlan0 is the 2.4g radio and wlan1 is the 5ghz (as per blue light).

Running the scripts after a boot is always consistent and does not change the order of wlan0 and wlan1, its only on a cold boot.

Any ideas of what is going on and/or how to get some consistency with the wlan0/wlan1 naming, that I can live with really appreciated

Many thanks
nick

In "/etc/config/wireless" you can give a static name to each interface, using "option ifname 'wlan_...'" under each "config wifi-iface '...'" section.

1 Like

It's not supposed to matter what the wlan name is. Those are assigned at runtime as wireless interfaces are started up. wlanX should not be referenced anywhere in the configuration.

1 Like

Hi,

It does seem to have worked :grinning:

Whatever I set as an option name in the wifi-iface is reflected in the radio that is up.

Only slight annoyance is that the wndr blue and green radio leds seem to be opposite to the radio that is actually up, i.e 5ghx blue still shown for the confirmed 2.4Ghz radio in use, regardless of the interface name.

Dont supposed you have any words of wisdom on this ??!!

But thank you for replying and fixing eduperez!

1 Like

That was noticed already some 5 years ago, when I helped in the DTS transition of the WNDR3700. No solution was found. (See e.g. my comment in https://github.com/openwrt/openwrt/pull/1284 or Wndr3700: DSA conversion - #11 by hnyman )

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.