iw dev radio0 scan
returns:
command failed: No such device (-19)
I can ran scan on this device using LuCI with no problem,
I can create access point using this device (radio0) that works fine, after changing wireless to:
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:02.2/0000:03:00.0'
option htmode 'VHT40'
option country 'US'
option cell_density '0'
but I still can't use iwinfo radio0 scan in the terminal
AP works fine. STA works fine. LuCI has no problem doing the scan on this device and showing me all wifi in the area. The only thing that doesn't appear to work is calling iwinfo from terminal.
I checked network.js that LuCI uses, it appears to use iwinfo scan as well,
what does it use for 'device', in LuCI interface it shows 'radio0'?
I had country set when created AP, and running in 2.4Ghz mode (see last config version in original post):
option htmode 'VHT40'
option country 'US' iwinfo radio0 scan still doesn't work. LuCI didn't have problem with original config
radio0 is the uci section name.
iwinfo expects the ifname, not the uci section name, but you have not set the ifname option.
Therefore it will default to an ifname of, most likely phy0-ap0
You can however just run iwinfo with no arguments and it will list information by ifname.
this only works if interface was already created, not on fresh install without any interfaces and only device being created by default or by running 'wifi config'
there is no phy0-ap0 yet. iwinfo by itself returns nothing
the reason I want to do iwinfo scan is to find AP to which to connect my router and create interface. Somehow I can do it via LuCI but not via terminal/script.
on my other router (gl-inet) i can run iwinfo on the uci wifi-device name and it works fine, for example
/etc/config/wireless
Sure. But you are going to need a STA virtual interface anyway....
You could use the iw utility.
Create the interface:
iw phy <phyname> interface add <name> type <type>
Scan using the interface name (ifname)
iw dev <ifname> scan dump
It is great to figure this out for yourself, but the hard work has been done in an OpenWrt package specially for the purpose. Not exactly your use case but pretty much identical if you think about it: