Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 11 Dec 2017, 17:14
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Multi-Wifi-Interface scan and connect "Wifi-Scanner-2"
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [33 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Fri 09 Jun 2017, 18:31    Post subject:  

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.
Back to top
View user's profile Send private message MSN Messenger 
slavvo67

Joined: 12 Oct 2012
Posts: 1434
Location: The other Mr. 305

PostPosted: Fri 09 Jun 2017, 19:03    Post subject:  

I have a number of wifi dongles, as well. Never thought to use them in that way. I've been wanting to try the hotspot idea for a while.... Any tips?
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Sat 10 Jun 2017, 02:43    Post subject:  

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
Code:
make install

check installation and get useful info

Code:
create_ap


Wifi-HotSpot gui has information button
xscreenshot-20170610T073644.png
 Description   
 Filesize   29.39 KB
 Viewed   517 Time(s)

xscreenshot-20170610T073644.png

whm.png
 Description   click larger icon for full info.
 Filesize   23.58 KB
 Viewed   519 Time(s)

whm.png

xscreenshot-20170610T073658.png
 Description   
 Filesize   20.43 KB
 Viewed   523 Time(s)

xscreenshot-20170610T073658.png

Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Thu 06 Jul 2017, 15:53    Post subject:  

see last or first post
Last edited by stemsee on Thu 26 Oct 2017, 09:47; edited 8 times in total
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Sat 08 Jul 2017, 05:29    Post subject:  

The one thing I would like to add now is a static tab for control options.
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Tue 05 Sep 2017, 15:07    Post subject:  

This is my main wifi ap connection tool. It is now faster than previously. There are also un-stated options; for example closing the gui using the 'x' in the top right corner causes immediate rescan and gui display reopen. Using 'close' ends all scanning. Using 'ok' with a selected ap causes connection, without selected ap causes immediate rescan. Leaving alone cause timed close and rescan.
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Fri 20 Oct 2017, 19:02    Post subject:  

I had not been able to connect to an android wpa-psk secure hotspot until today!

I spent hours searching for the reason. Finally using wpa_supplicant without the -B but option revealed a list of errors which I researched online. Finally I found that the command without the -D driver specification is the only one that works... eureka!
Code:
wpa_supplicant -B -i $int -c /tmp/netsel.conf

is all that is required having first generated the .conf using
Code:
wpa_passphrase "$ssid" "$password" > /tmp/netsel.conf


So I see just how frustrating using my Wifi-Scanner-2 must have been for anything other than open networks and those with 2nd stage security protocols such as eduroam.

one problem solved!

EDIT: Actually the reason seems more to do with the broadcom chipset or driver! As using all plugin cards work fine with wext.

Last edited by stemsee on Tue 14 Nov 2017, 16:14; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Thu 26 Oct 2017, 09:47    Post subject:  

see update
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Tue 14 Nov 2017, 16:16    Post subject:  

Update provides: psk correctly implemented.
used interface eliminated from continued scan option.
while loops have sleep to stop uncontrolled cpu use.
a pop-up gui input box which lets the user specify driver + options for wpa_supplicant connection.
It is an extended password and id box which greys out unused selections.

It is much faster now too. The fastest wifi and wired connection utility on the planet!!!

Still to do: remove sed commands. add wps. add auto connect. add use saved profiles.
Wifi-Scanner-2.fake.gz
Description 
gz

 Download 
Filename  Wifi-Scanner-2.fake.gz 
Filesize  24.73 KB 
Downloaded  11 Time(s) 
xscreenshot-20171114T193453.png
 Description   
 Filesize   26.08 KB
 Viewed   245 Time(s)

xscreenshot-20171114T193453.png

xscreenshot-20171114T193733.png
 Description   
 Filesize   24.85 KB
 Viewed   246 Time(s)

xscreenshot-20171114T193733.png


Last edited by stemsee on Mon 20 Nov 2017, 18:20; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Wed 15 Nov 2017, 12:27    Post subject:  

Added autoconnect/no-auto feature which starts wifi connection with a default profile. The script is /etc/xdg/Startup/autocon.

Also corrected udhcpc hook default.script location to /usr/share/udhcpc/default.script in fatdog anyhow. Dhcpcd is still available if 'busybox which udhcpc' returns empty.
Back to top
View user's profile Send private message MSN Messenger 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Thu 16 Nov 2017, 11:10    Post subject:  

I have tidied up the formatting within the script - no more long lines!

wpa_cli option in menu with interface selection available. So wps is available for those who know how to
Code:
wpa_pin/wpa_pbs


see further on for script

Last edited by stemsee on Mon 20 Nov 2017, 17:43; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1397
Location: Japan

PostPosted: Sat 18 Nov 2017, 08:50    Post subject:  

Code:
   #make sure associate interface variables
   int1=${int1}
   int2=${int2}
   int3=${int3}
   int4=${int4}
   int5=${int5}
   int6=${int6}
   int7=${int7}
   int8=${int8}
What is the purpose of this exercise?
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Mon 20 Nov 2017, 10:06    Post subject:  

@MochiMoppel

The purpose was at one point to make sure that after $int was used in a connection the other wireless interfaces '$inters' selected for scanning would fully occupy the variables with '$int' removed from scanning interfaces, as it should be connected. For me it was a temporary measure that I forgot about even though it no longer made any difference. Now removed.

Sed statements have also been reduced.

now I cannot yet get the saved profilesfn selected profile to connect.

Last edited by stemsee on Wed 22 Nov 2017, 10:42; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1397
Location: Japan

PostPosted: Tue 21 Nov 2017, 07:58    Post subject:  

stemsee wrote:
Sed statements have also been reduced.
Not much. All these piped seds cost you performance.

Instead of 12 seds per scan ...
Code:
[[ ! -z "${int1}" ]] && ecann1=`iwlist ${int1} scan | grep -e 'ESSID' \
-e 'Quality' -e 'Address' -e 'key' | sed -e 's/  \+/ /g' | sed 's/Quality=/  /g' | sed 's/level=/    /g' | sed 's/ESSID://g' | \
sed 's/key:on/~on~/g' | sed 's/key:off/~off~/g' | sed 's/Encryption//g' | sed 's/ Signal//g' | \
sed 's/- Address: / /g' | sed 's|Cell ...|\n|g' | sed 's/ - //g' | sed "s/^[ \t]*//" | tac
.
.
.
[[ ! -z "${int2}" ]] && ecann2=`iwlist ${int2} scan | grep -e 'ESSID' \
-e 'Quality' -e 'Address' -e 'key' | sed -e's/  */ /g' | sed 's/Quality=/  /g' | sed 's/level=/    /g' | sed 's/ESSID://g' | \
sed 's/key:on/~on~/g' | sed 's/key:off/~off~/g' | sed 's/Encryption//g' | sed 's/ Signal//g' | \
sed 's/- Address: / /g' | sed 's|Cell ...|\n|g' | sed 's/ - //g' | sed "s/^[ \t]*//" | tac


you need only 1 sed statement. If you put the pattern into a variable you also don't need to repeat the pattern for each scan:
Code:
PATTERN='
s/^.*Address: ([0-9A-Z:]*)/\n\1/p
s/^.*Quality=([^ ]*).*Signal level=(.*)/\1 \2/p
s/^.*key:([onf]*)/~\1~/p
s/^.*ESSID://p'

[[ $int1 ]] && ecann1=`iwlist ${int1} scan | sed -rn "$PATTERN" | tac
.
.
.
[[ $int2 ]] && ecann2=`iwlist ${int2} scan | sed -rn "$PATTERN" | tac
Also note that [[ ! -z "${int1}" ]] is the same as [[ -n "${int1}" ]] and [[ "${int1}" ]] and [[ "$int1" ]] and [[ $int1 ]] ..take your pick.


With your previous sample data the result looks like this:
Code:
"BTWifi-X"
~on~
35/70 -75 dBm 
52:8A:AE:8C:5E:7E

"BTWifi-with-FON"
~off~
31/70 -79 dBm 
32:8A:AE:8C:5E:7E
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2001
Location: In The Way

PostPosted: Tue 21 Nov 2017, 10:12    Post subject:  

Thank you! Very Happy
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 2 of 3 [33 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0528s ][ Queries: 14 (0.0067s) ][ GZIP on ]