Hi

Use wlan0 instead of radio0

Joyeux noel,
Etienne

Stefan Hellermann <ste...@the2masters.de> a écrit :

>Hi,
>
>> -i don't use {#DEV}, and it's a uci bug, i should just suppress it?
>
>Ok, I don't know how to use it, either.
>
>>
>> -for the wifi.discovery i'm always using phy instead of macaddress in 
>> wireless config (so i can flash a spare router quickly). you can suppress 
>> the {#PHY} part, or find another way? (don't use it i think)
>
>I changed my wifi config to use phy0 instead of the macaddress, then
>your script is fine. But the default config uses the macaddress, so we
>should support this. Just removing the phy part of your script works
>with both configs. Like this one:
>lua -l uci -l iwinfo -e 'x = uci.cursor(nil, "/var/state");list =
>"{\"data\":[";x:foreach("wireless", "wifi-iface", function(s)
>list=list.."{\"{#IF}\":\""..s.ifname.."\",
>\"{#SSID}\":\""..s.ssid.."\", \"{#NET}\":\""..s.network.."\",
>\"{#DEV}\":\""..s.device.."\",
>\"{#TYPE}\":\""..x:get("wireless",s.device,"type").."\",
>\"{#HWMODE}\":\""..x:get("wireless",s.device,"hwmode").."\",
>\"{#CHANNEL}\":\""..x:get("wireless",s.device,"channel").."\",
>\"{#BSSID}\":\""..iwinfo[iwinfo.type(s.ifname)].bssid(s.ifname).."\"},"
>end); list=string.gsub(list,",$",""); print(list.."]}")'
>
>{"data":[{"{#IF}":"wlan0", "{#SSID}":"zuhause2", "{#NET}":"lan",
>"{#DEV}":"radio0", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng",
>"{#CHANNEL}":"1", "{#BSSID}":"F4:EC:38:F0:F1:C9"}]}
>
>
>>
>> -for the txpower i may use the same trick as with bitrate
>> -for bitrate if there is no client value is nil, so i put 0 for default 
>> value.
>>
>> I will check later for the other value (you're getting too many nil for me)
>Thanks! I did a new measurement with a notebook connected to the wifi.
>
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].channel('radio0'))
>1
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].frequency('radio0'))
>2412
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].txpower('radio0'))
>nil
># lua -l iwinfo -e local b =
>iwinfo[iwinfo.type('radio0')].bitrate('radio0'); print(b or '0')
>0
># lua -l iwinfo -e local s =
>iwinfo[iwinfo.type('radio0')].signal('radio0'); print(s or '-255')
>-255
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].noise('radio0'))
>nil
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].quality('radio0'))
>0
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].quality_max('radio0'))
>70
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].mode('radio0'))
>Unknown
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].ssid('radio0'))
>nil
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].bssid('radio0'))
>nil
># lua -l iwinfo -e print(iwinfo[iwinfo.type('radio0')].country('radio0'))
>DE
># lua -l iwinfo -e print(#iwinfo[iwinfo.type('radio0')].assoclist('radio0'))
>0
># lua -l iwinfo -e local e =
>iwinfo[iwinfo.type('radio0')].encryption('radio0'); print(e and
>e.description or 'None')
>None
># lua -l iwinfo -e local
>x=iwinfo[iwinfo.type('radio0')].hwmodelist('radio0'); print((x.a and
>'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or
>''))
>bgn
>
>I would say something is clearly wrong here? I double checked, that
>the notebook is really connected to this router.
>
>>
>> what's your wifi router?
>It's a tp-link tl-wr741, a really cheap ar71xx device with ath9k wifi.
>
>Thanks,
>Stefan
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to