Is there any way I can get a list of access points and signal strength with the Yun?
There are lots of things to do this on desktop Linux distributions, e.g. iwspy, but I'm not sure what's available for the Wi-Fi hardware in the Yun. Thanks!
iwlist wlan0 scan |grep 'Channel:\|Quality\|ESSID'
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"OMAR BATISTA's Network"
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"OMAR BATISTA's Guest Network"
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"DVW3201B38"
Channel:9
Quality=70/70 Signal level=-22 dBm
ESSID:"TP-LINK_2.4GHz"
Channel:10
Quality=34/70 Signal level=-76 dBm
ESSID:"TP-LINK_2.4GHz_2"
Channel:1
Quality=25/70 Signal level=-85 dBm
ESSID:"SBG658034"
Channel:1
Quality=21/70 Signal level=-89 dBm
ESSID:"scrappy"
Channel:4
Quality=18/70 Signal level=-92 dBm
ESSID:"Adlink"
Channel:6
Quality=21/70 Signal level=-89 dBm
ESSID:"MH9KQ"
Channel:6
Quality=23/70 Signal level=-87 dBm
ESSID:"bubbly"
Wifi Channel-frequency
Wifi Quality-Signal level
http://forum.arduino.cc/index.php?topic=188101.msg1597553#msg1597553
Wow, awesome, thanks!!
sonnyyu:
iwlist wlan0 scan |grep 'Channel:\|Quality\|ESSID'
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"OMAR BATISTA's Network"
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"OMAR BATISTA's Guest Network"
Channel:1
Quality=46/70 Signal level=-64 dBm
ESSID:"DVW3201B38"
Channel:9
Quality=70/70 Signal level=-22 dBm
ESSID:"TP-LINK_2.4GHz"
Channel:10
Quality=34/70 Signal level=-76 dBm
ESSID:"TP-LINK_2.4GHz_2"
Channel:1
Quality=25/70 Signal level=-85 dBm
ESSID:"SBG658034"
Channel:1
Quality=21/70 Signal level=-89 dBm
ESSID:"scrappy"
Channel:4
Quality=18/70 Signal level=-92 dBm
ESSID:"Adlink"
Channel:6
Quality=21/70 Signal level=-89 dBm
ESSID:"MH9KQ"
Channel:6
Quality=23/70 Signal level=-87 dBm
ESSID:"bubbly"
Wifi Channel-frequency ![|500x331](http://s11.postimg.org/qnctddi1f/wifi.png) http://en.wikipedia.org/wiki/List_of_WLAN_channels Wifi Quality-Signal level http://forum.arduino.cc/index.php?topic=188101.msg1597553#msg1597553
May I ask how one would go about using this in an arduino sketch?
I want to write the result to the console and eventually parse it and store it in some variables or as a csv. Thank you.
lohanis:
May I ask how one would go about using this in an arduino sketch?
...
...
void loop() {
Process p;
p.begin("iwlist wlan0 scan |grep 'Channel:\|Quality\|ESSID'");
while (p.running());
...
lohanis:
...
I want to write the result to the console and eventually parse it and store it in some variables or as a csv.
...
wget -O iwlistparse.py https://gist.githubusercontent.com/dubkov/79738a7a15fcb47809bc/raw/c26ab3cd2289686bf56ee8671ef5454876b4d77b/iwlistparse.py --no-check-certificate
iwlist wlan0 scan | python iwlistparse.py > iwlist.txt
cat iwlist.txt
Name Address Quality Channel Encryption
TP-LINK_2.4GH_SC C4:6E:1F:54:DE:C2 100 % 3 WPA v.1
FiOS-OIE54 48:5D:36:0A:1E:AC 93 % 11 WEP
TG1672G52 40:70:09:3F:A7:50 86 % 1 WEP
OMAR BATISTA's Guest Network 5E:96:9D:66:42:14 67 % 6 WEP
...
iwlist.txt is tab delimited file, convert it into csv.
awk '{$1=$1}1' OFS="," iwlist.txt > iwlist.csv
cat iwlist.csv
Name,Address,Quality,Channel,Encryption
TP-LINK_2.4GH_SC,C4:6E:1F:54:DE:C2,100,%,3,WPA,v.1
FiOS-OIE54,48:5D:36:0A:1E:AC,97,%,11,WEP
TG1672G52,40:70:09:3F:A7:50,67,%,1,WEP
...
fix TP-LINK_2.4GH_SC,C4:6E:1F:54:DE:C2,100,%,3,WPA,v.1 problem.
cat iwlist.txt | sed 's/\(.\) /\1/g' |awk '{$1=$1}1' OFS=","
Name,Address,Quality,Channel,Encryption
TP-LINK_2.4GH_SC,C4:6E:1F:54:DE:C2,100%,3,WPAv.1
FiOS-OIE54,48:5D:36:0A:1E:AC,97%,11,WEP
TG1672G52,40:70:09:3F:A7:50,67%,1,WEP
...
sonnyyu:
...
void loop() {
Process p;
p.begin("iwlist wlan0 scan |grep 'Channel:|Quality|ESSID'");
while (p.running());
...
[Process Class with Return Variable](http://www.ibuyopenwrt.com/index.php/2-uncategorised/208-process-class-with-return-variable)
Superkarma to you sonnyyu! Thanks, I'll look through this and get it working.
Here is a sketch ready to go:
A simple sketch to get the wifi information from the Linux side of the Yun
There are four main pieces of information this sketch produces
- The date and time as known to the Yun.
- The Access Points (APs) known to the Yun.
- The Wifi configuration of the Yun.
- The default gateway for the Yun, if any.