I got a TP-Link WR710N router with USB interface, to which I connect a second wifi interface (USB dongle).
My issue is how to differentiate between the two interfaces, how to get the wlanX or phyX of the USB.
I have several devices and rebooted a few times, it seems the wlanX (0 or 1) is assigned rather randomly.
uci shows me which one is the USB wifi (path=platform/ehci-platform/usb1)
~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.hwmode=11ng
wireless.radio0.path=platform/ar933x_wmac
wireless.radio0.ht_capab=SHORT-GI-20 SHORT-GI-40 RX-STBC1 DSSS_CCK-40
wireless.radio0.htmode=HT20
wireless.radio1=wifi-device
wireless.radio1.type=mac80211
wireless.radio1.channel=11
wireless.radio1.hwmode=11ng
wireless.radio1.path=platform/ehci-platform/usb1/1-1/1-1:1.0
wireless.radio1.ht_capab=GF SHORT-GI-20 SHORT-GI-40 RX-STBC1
wireless.radio1.htmode=HT20
wifi doesn't make clear by itself which one is internal and external, if wlanX is not up, it's name is not displayed
~# wifi status
{
"radio0": {
"up": true,
"pending": false,
"autostart": true,
"disabled": false,
"interfaces": [
{
"section": "cfg033579",
"ifname": "wlan1"
}
]
},
"radio1": {
"up": true,
"pending": false,
"autostart": true,
"disabled": false,
"interfaces": [
{
"section": "cfg063579",
"ifname": "wlan0"
}
]
}
}
iw gives no indication which one is USB
~# iw list
Wiphy phy1
max # scan SSIDs: 4
max scan IEs length: 2257 bytes
Coverage class: 0 (up to 0m)
...
Wiphy phy0
max # scan SSIDs: 4
max scan IEs length: 2257 bytes
Coverage class: 0 (up to 0m)
...
ifconfig has also no indication
~# ifconfig
wlan0 Link encap:Ethernet HWaddr 7C:DD:90:11:22:33
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:9604 (9.3 KiB)
wlan1 Link encap:Ethernet HWaddr 10:FE:ED:11:22:33
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4575 (4.4 KiB)
What's the logic for the name assignments?
If I want to get the wlanX or phyX name of the USB interface, whats the best solution?