Multi-Wifi-Interface scan and connect "Wifi-Scanner-2"
Multi-Wifi-Interface scan and connect "Wifi-Scanner-2"
Multi-Interface Wifi Connector and Scanner.
Can use upto 8 wireless interfaces in tabbed windows. Select AP from any tab to connect to it. Continue scanning on other interfaces.
Supports WPA2-PSK, PEAP, OPEN network configurations as I have not encountered WPA/WEP recently so I didn't add support but help yourself.
Creates saved profiles according to ssid and bssid.
see further on for script
Can use upto 8 wireless interfaces in tabbed windows. Select AP from any tab to connect to it. Continue scanning on other interfaces.
Supports WPA2-PSK, PEAP, OPEN network configurations as I have not encountered WPA/WEP recently so I didn't add support but help yourself.
Creates saved profiles according to ssid and bssid.
see further on for script
- Attachments
-
- xscreenshot-20170325T182812.png
- (46.19 KiB) Downloaded 719 times
Last edited by stemsee on Sun 24 Dec 2017, 19:44, edited 6 times in total.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Just tried it. No grep and only one sed statement would be almost 10 times more efficient in terms of CPU usage. Also MUCH shorter.6502coder wrote:Instead of a whole series of sed's piped together, wouldn't it be more efficient to throw all those sed edits into a single sed script?
But what is this? Are you trying to comment out code lines programmatically? Won't work
Code: Select all
if [[ ! -z "$int" ]]; then
case $int in
$int1) op1=#
these1="";;
$int2) op2=#
these2="";;
esac
fi
$op1 [[ ! -z "$int1" ]] && ecann1=`iwlist $int1 scan | ...
[[ ! -z "$int1" ]] && echo "$ecann1" | ...
$op2 [[ ! -z "$int2" ]] && ecann2=`iwlist $int2 scan | ...
[[ ! -z "$int2" ]] && echo "$ecann2" | ...
Still much room for improvement, but this may replace above code and should work without errors:
Code: Select all
[[ "$int" != "$int1" ]] && ecann1=`iwlist $int1 scan | ...
[[ "$int" != "$int1" ]] && echo "$ecann1" | ...
[[ "$int" != "$int2" ]] && ecann2=`iwlist $int2 scan | ...
[[ "$int" != "$int2" ]] && echo "$ecann2" | ...
Where is the improved statement then?MochiMoppel wrote:Just tried it. No grep and only one sed statement would be almost 10 times more efficient in terms of CPU usage. Also MUCH shorter.6502coder wrote:Instead of a whole series of sed's piped together, wouldn't it be more efficient to throw all those sed edits into a single sed script?
Yes, that was my intent. It didn't work also because the int1 variable got assigned a different interface anyway! Only the tabs got reassigned incorrectly with different labels but same interfaces.But what is this? Are you trying to comment out code lines programmatically? Won't work
I will try this!Let's say $int equals $int1, then you want to comment out the first [[ ! -z "$int1" ]] line? Not possible. May "work" for you as expected, but for a different reason. Bash will throw an error. And what about the following line? Should not work either since it depends on the result of the (faulty) previous line.Code: Select all
if [[ ! -z "$int" ]]; then case $int in $int1) op1=# these1="";; $int2) op2=# these2="";; esac fi $op1 [[ ! -z "$int1" ]] && ecann1=`iwlist $int1 scan | ... [[ ! -z "$int1" ]] && echo "$ecann1" | ... $op2 [[ ! -z "$int2" ]] && ecann2=`iwlist $int2 scan | ... [[ ! -z "$int2" ]] && echo "$ecann2" | ...
Still much room for improvement, but this may replace above code and should work without errors:Code: Select all
[[ "$int" != "$int1" ]] && ecann1=`iwlist $int1 scan | ... [[ "$int" != "$int1" ]] && echo "$ecann1" | ... [[ "$int" != "$int2" ]] && ecann2=`iwlist $int2 scan | ... [[ "$int" != "$int2" ]] && echo "$ecann2" | ...
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
On my USB stick.stemsee wrote:Where is the improved statement then?
I said that it's more efficient, I didn't say that it's more reliable. The problem is that when I run iwlist wlan0 scan the output is probably not what it should be and what you tested your code against:
Code: Select all
# iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 74:76:C5:73:30:FA
ESSID:"AirPort13306"
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality:4/5 Signal level:-59 dBm Noise level:-92 dBm
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: Unknown: DDB30050F204104A0001101044
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s
18 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 12 Mb/s
24 Mb/s; 48 Mb/s
Thanks for that MochiMoppel
Here is a sample output of iwlist scan on my machine
All I need to glean from the info is , Mac Address **:**:**:**:**:**; ESSID:"SomeName"; Encryption key: on or off; Signal Strength 29/70 Quality: -87 dBm (possibly frequency 2.4ghz Channel: 1)
for each AP found, from each card. Only need the data not the labels! IFS=" " e.g.
cheers
stemsee
Here is a sample output of iwlist scan on my machine
Code: Select all
iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 32:8A:AE:8C:5E:7E
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=31/70 Signal level=-79 dBm
Encryption key:off
ESSID:"BTWifi-with-FON"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000010a626c371f
Extra: Last beacon: 63ms ago
IE: Unknown: 000F4254576966692D776974682D464F4E
IE: Unknown: 010882848B960C121824
IE: Unknown: 030101
IE: Unknown: 0706474220010D14
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: Unknown: 2D1AAC011BFFFF000000000000000000008000000000000000000000
IE: Unknown: 3D1601080400000000000000000000000000000000000000
IE: Unknown: 4A0E14000A002C01C800140005001900
IE: Unknown: 7F080100000000000040
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
IE: Unknown: DD0900037F01010000FF7F
Cell 02 - Address: 52:8A:AE:8C:5E:7E
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=35/70 Signal level=-75 dBm
Encryption key:on
ESSID:"BTWifi-X"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000010a626bdbb4
Extra: Last beacon: 63ms ago
IE: Unknown: 00084254576966692D58
IE: Unknown: 010882848B960C121824
IE: Unknown: 030101
IE: Unknown: 0706474220010D14
IE: Unknown: 2A0100
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : 802.1x
Preauthentication Supported
IE: Unknown: 32043048606C
IE: Unknown: 2D1AAC011BFFFF000000000000000000008000000000000000000000
IE: Unknown: 3D1601080400000000000000000000000000000000000000
IE: Unknown: 4A0E14000A002C01C800140005001900
IE: Unknown: 7F080100000000000040
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : 802.1x
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
IE: Unknown: DD0900037F01010000FF7F
Cell 03 - Address: A4:2B:8C:16:E2:B9
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=41/70 Signal level=-69 dBm
Encryption key:on
ESSID:"BTHub5-6HRQ_EXT"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s
18 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000000289c0bad23
Extra: Last beacon: 63ms ago
IE: Unknown: 000F4254487562352D364852515F455854
IE: Unknown: 010882848B961224486C
IE: Unknown: 030101
IE: Unknown: 2A0100
IE: Unknown: 32040C183060
IE: Unknown: 2D1AEC0117FFFF000000000000000000000000000000000000000000
IE: Unknown: 3D1601000400000000000000000000000000000000000000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
IE: Unknown: 0B05020016127A
IE: Unknown: 7F0101
IE: Unknown: DD07000C4303000000
IE: Unknown: 0706444520010D10
IE: Unknown:
longline [....]
Cell 04 - Address: 00:8A:AE:8C:5E:7E
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=29/70 Signal level=-81 dBm
Encryption key:on
ESSID:"BTHub5-7PK2"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000010a626afd65
Extra: Last beacon: 63ms ago
IE: Unknown: 000B4254487562352D37504B32
IE: Unknown: 010882848B960C121824
IE: Unknown: 030101
IE: Unknown: 0706474220010D14
IE: Unknown: 2A0100
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: 32043048606C
IE: Unknown: 2D1AAC011BFFFF000000000000000000008000000000000000000000
IE: Unknown: 3D1601080400000000000000000000000000000000000000
IE: Unknown: 4A0E14000A002C01C800140005001900
IE: Unknown: 7F080100000000000040
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
IE: Unknown: DD0900037F01010000FF7F
IE: Unknown:
long line [....]
for each AP found, from each card. Only need the data not the labels! IFS=" " e.g.
Code: Select all
"BTWifi-with-Fon" **:**:**:**:** on 29/70 -87 2.4 1
stemsee
Last edited by stemsee on Thu 30 Mar 2017, 21:32, edited 1 time in total.
So I came up with code to list selected interfaces, then when connected, remove connected from that list for the continued scan loop using the other interfaces. Mostly working as well as any other connection tool I have used. Also admin mode, CLI, usage can change card mode and also update interfaces each loop, facilitating plug'n'play on the fly! Tested using once pci card and three usb cards; BCM (pci), ralink, Atheros, Ralink on a laptop.
Can select one or many interfaces!
Can use dhcpcd or udhcpc.
Connects with both ESSID and Mac address. Stores profiles likewise.
To do: change selection output to individual files to enable multi AP selections and connect each interface to one of its found APs, simultaneously! (Because why not!)
Also add harvesting mode to simply store AP by ESSID and MAC from each card.
Code: Select all
Wifi-Connect-2 admin managed
Can use dhcpcd or udhcpc.
Connects with both ESSID and Mac address. Stores profiles likewise.
To do: change selection output to individual files to enable multi AP selections and connect each interface to one of its found APs, simultaneously! (Because why not!)
Also add harvesting mode to simply store AP by ESSID and MAC from each card.
Last edited by stemsee on Thu 26 Oct 2017, 13:46, edited 2 times in total.
Question
Let us suppose I connected 6 wifi cards on one pc.
Each card connected by long aerial cable to different sides of the building.
All connected to different APs.
How then could the user select which 'connection' to pipe traffic through? Assuming the user is running FatDog64-710.
I want to be able to switch which active internal connection to use, by script.
Let us suppose I connected 6 wifi cards on one pc.
Each card connected by long aerial cable to different sides of the building.
All connected to different APs.
How then could the user select which 'connection' to pipe traffic through? Assuming the user is running FatDog64-710.
I want to be able to switch which active internal connection to use, by script.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
I own 5 usb wifi dongles plus the inbuilt pcie. Each card has different sensitivities and I use extension aerial cables to receive scan data from different sides of my building. Scanning with several wifi cards lets me compare the strengths and weaknesses of he cards. Also two interfaces for joining network and creating hotspot. Also just because I wanted to program it.
Eventually i want to develope auto switching between several cards.
Eventually i want to develope auto switching between several cards.
Wifi-HotSpot uses create_ap backend. 'create_ap' gets compiled on first use but the devx must be loaded. Or you can simply cd to /usr/sbin/create_ap-master then open terminal there and
check installation and get useful info
Wifi-HotSpot gui has information button
Code: Select all
make install
Code: Select all
create_ap
- Attachments
-
- xscreenshot-20170610T073644.png
- (29.39 KiB) Downloaded 605 times
-
- whm.png
- click larger icon for full info.
- (23.58 KiB) Downloaded 600 times
-
- xscreenshot-20170610T073658.png
- (20.43 KiB) Downloaded 605 times