Listing associated wifi clients and scanning for other networks

I want to do iwinfo xxx scan on all radios, and iwinfo yyy assoclist for all my wifi networks.

Is there a recommended best place to find the names for the radios (xxx) and wlan interfaces (yyy)? Ideally something general which will work on 21.xx routers and current releases.

M

root@newB:~# wifi status | fgrep -w ifname | sort -u
                                "ifname": "phy0-ap0",
                                "ifname": "phy0-ap1",
                                "ifname": "phy1-ap0",
root@newB:~# iwinfo | awk '/PHY name/{print $6}' | sort -u
phy0
phy1
root@newB:~# 
for radio in $(wifi status | grep '\"radio[0-9]' | cut -d'"' -f 2); do echo "Radio: $radio"; iwinfo $radio scan; done
for wlan in $(iwinfo | grep ESSID | awk '{print $1}'); do echo "Device: $wlan"; iwinfo $wlan assoclist; done

:man_shrugging: There's always more than one way to skin a cat ...

2 Likes

ubus -v list iwinfo

then use jshn change shell arrays to json and back.

1 Like