Wifi-TrayNet and Wifi-Scanner

Message
Author
User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#61 Post by fredx181 »

Hi stemsee, looks good, your TODO list.
I do not know about yad negative geometry values, except starting at max res and subtracting from that, but that isn't yad that is math. How does yad do it?
Doesn't matter what resolution you have, this works e.g. for top-right corner:

Code: Select all

yad --geometry 200x200-40+40
Or e.g. for bottom-right corner:

Code: Select all

yad --geometry 200x200-40-40
Fred

stemsee

#62 Post by stemsee »

fredx181 wrote:Hi stemsee, looks good, your TODO list.
I do not know about yad negative geometry values, except starting at max res and subtracting from that, but that isn't yad that is math. How does yad do it?
Doesn't matter what resolution you have, this works e.g. for top-right corner:

Code: Select all

yad --geometry 200x200-40+40
Or e.g. for bottom-right corner:

Code: Select all

yad --geometry 200x200-40-40
Fred
Ok, thanks ... got it! That would have saved me some time had I known it before! At least I can use it to assign geometry defaults to start with.

cheers
stemsee

stemsee

#63 Post by stemsee »

I figured out a better way to find wireless cards, so no need to show all interfaces when given option to select. When only one card found option to select does not show.

Code: Select all

for i in `ls /sys/class/net`; do yes=`ls /sys/class/net/$i | grep wireless`; [[ "$yes" ]] && echo "$i" >>/tmp/int; done
Geometry is off by default, and this line of code adds a default geometry

Code: Select all

mkdir -p $HOME/.wifi-connect/geometry
for i in Accept~Connection AP-Selector Configuration-n-Connection Connect! Disconnect-Interface \
Interface-Selection IP-Info Keep-Connection license-copyright-info Preview Random-Mac-Generator \
Saved-Profiles Setting-AutoConnect Try-Profiles Wifi-Interface-Selection Wifi-IP-Info Wifi-Scanner \
Wifi-Scanner-Multi-Wifi Wifi-TrayNet-Interfaces wlan0 wlan1
do
	touch $HOME/.wifi-connect/geometry/$i
	echo "-40-40" >$HOME/.wifi-connect/geometry/$i
done
Basic instruction file added.

Single instance code adjusted, seems to work here.
Last edited by stemsee on Wed 04 Jul 2018, 08:58, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#64 Post by fredx181 »

Hi stemsee,
Improvement is the instructions dialog, but for me there's still no profile created in /root/.wifi-connect/profiles (did the same as before by only filling in the password at the profile setting dialog), so could not make wifi connection.

Code: Select all

root@live:~# '/usr/sbin/Wifi-TrayNet' 
no eth1
no usb0
cat: /root/.wifi-connect/geometry/Instructions: No such file or directory
cat: /tmp/Wifi-TrayNet/exip: No such file or directory
cat: /root/.wifi-connect/geometry/Connect: No such file or directory
sed: -e expression #1, char 3: extra characters after command
cat: '/root/.wifi-connect/static/"UPC44685"': No such file or directory
xvkbd: no process found
chmod: cannot access '/tmp/Wifi-TrayNet/netsel': No such file or directory
cp: cannot stat '/tmp/Wifi-TrayNet/netsel': No such file or directory
Successfully initialized wpa_supplicant
Failed to open config file '/tmp/qrc', error: No such file or directory
Failed to read or parse configuration '/tmp/qrc'.
EDIT: Now first time start runs OK, but second time (after quit) doesn't:

Code: Select all

root@live:~# '/usr/sbin/Wifi-TrayNet' 
bash: cleanfinish: command not found
/tmp/traynetm: line 3: kill: (5610) - No such process
root@live:~# Wifi-TrayNet: no process found
There it hangs, after ctlr+c, then running Wifi-TrayNet again it runs ok.

Fred

stemsee

#65 Post by stemsee »

So I believe I have corrected the start stop problem and maintained the single instance only requirement. using

Code: Select all

running=`ps -e | grep Wifi-TrayNet | wc -l` 
[[ "$running" -gt 2 ]] && exit #check if running, one instance only

function cleanfinish (){
	[[ -f $HOME/.wifi-connect/traynetm ]] && exec $HOME/.wifi-connect/traynetm
	kill -HUP -$$
}:export -f cleanfinish
trap cleanfinish EXIT

task='kill $NOTIF_ICON'
echo "#!/bin/sh
NOTIF_ICON=$NOTIF_ICON
$task
sleep 1 && killall -g -ns -9 Wifi-TrayNet &
sleep 1 && rm -rf $HOME/.wifi-connect/Wifi-TrayNet &
sleep 0.5 && rm -f $HOME/.wifi-connect/traynetm &
" > $HOME/.wifi-connect/traynetm
As regards the problem you say you experience with profile creation please watch these videos made with weX. But the only other possibility I could imagine is that the first time I ran BionicDog I noticed no /tmp in / ... so to maintain that condition I moved all /tmp/Wifi-TrayNet to $HOME/.wifi-connect/Wifi-TrayNet ... even so I could not replicate the failure to create profiles.

https://drive.google.com/open?id=1_d_c4 ... 119gm74TT8

https://drive.google.com/open?id=1QLi_n ... XFjN1HTbwP

stemsee

#66 Post by stemsee »

update to v3.7
Last edited by stemsee on Wed 04 Jul 2018, 08:58, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#67 Post by fredx181 »

Hi stemsee, tried your latest 3.7 deb but still no profile is made.
I test always from a pristine Bionicdog install, the (older) previous version (as I see that you use that also (nice video's, btw :) )).
I think I do everything right, first left-click on the icon, wait a while, select my network and then at the profile dialog I only type my password and select busybox udhcpc ....
Output:

Code: Select all

root@live:~# '/usr/sbin/Wifi-TrayNet' 
no eth1
no usb0
Warning: Missing charsets in String to FontSet conversion
sed: -e expression #1, char 3: extra characters after command
cat: '/root/.wifi-connect/static/"UPC44685"': No such file or directory
xvkbd: no process found
chmod: cannot access '/root/.wifi-connect/Wifi-TrayNet/netsel': No such file or directory
cp: cannot stat '/root/.wifi-connect/Wifi-TrayNet/netsel': No such file or directory
Successfully initialized wpa_supplicant
Failed to open config file '/tmp/qrc', error: No such file or directory
Failed to read or parse configuration '/tmp/qrc'.
Tried also "Initiate connection" and set the profile again, same result, no profile in /root/.wifi-connect/profiles .

EDIT: Wifi-Scanner works for me, created profile and connection made.
Just to mention: clicking on "Select Wifi Card" does nothing.

Fred

Fred

stemsee

#68 Post by stemsee »

Hi Fred

So start/stop problem seems resolved satisfactorily for you??

Select Wifi card menu option only works when two or more wireless cards are detected ... your system has only one so that has no effect. To see the wireless card-name being used is in the Configuration-&-Connection gui.

So what could be preventing profile creation for TrayNet but allowing creation for Scanner? and also not even creating netsel, and Scanner also uses netsel. I am baffled, so do you know what it is?

If you have time make a video similar to the one I did.

cheers
stemsee

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#69 Post by fredx181 »

Hi Stemsee,
So start/stop problem seems resolved satisfactorily for you??

Yes.
Select Wifi card menu option only works when two or more wireless cards are detected ... your system has only one so that has no effect
Ah, of course, you said that earlier.
So what could be preventing profile creation for TrayNet but allowing creation for Scanner? and also not even creating netsel, and Scanner also uses netsel. I am baffled, so do you know what it is?
If you have time make a video similar to the one I did.
I have no idea, with one of the earlier versions it worked OK to create profile, apparently you changed something.
I will make video, probably tomorrow.

EDIT: here's video, hopefully you see something wrong I do that explains the problem.
https://drive.google.com/open?id=1UAZ0N ... efd_ueSjMK
Otherwise, can you test on BD install without changes saved, just like I do ?

Fred

stemsee

#70 Post by stemsee »

Hi Fred

I cannot see anything wrong in what you are doing in the video.

I thought I would see a selection including config editor 'geany', because in that case I found I got the same errors you posted. Yesterday I tried without changes and I got the errors too. Today I fixed the error when selecting config editor, and then just now I booted without changes and without installing or uninstalling anything I executed only the script from out of tree on sdb1, and everything worked, except connection, until I copied over hook scripts.

https://drive.google.com/open?id=1JUL_S ... l5La-thJ4x

One thing I notice is that you selected dhc editor for 'busybox udhcpc....' that gets priority over the hardcocded argument, but without altering it it makes no difference and is not necessary.

Another thing is that if the same network name is selected in the tray menu then 'tail -fn0 /file' does not respond and does not get the gui opened, this is why it is necessary to 'initiate connection', I guess tail in aploop function, must be re-initialised after each read. (EDIT: fixed by auto sending a dummy AP, which is excluded, to monitored file after real AP selection activates gui)

Also, tried the same script in BionicPup without problems.

So even though on my system there was no obvious problem, yet it seems the priorities of arguments from the gui caused the errors ... so now the final test is to see if the small changes I made work on your system.

So here is only the script ... which you could run out of tree.
Last edited by stemsee on Wed 04 Jul 2018, 08:59, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#71 Post by fredx181 »

Hi stemsee, sorry, your latest script didn't work either.
But I know now, my ssid "UPC44685" is boycotted by Wifi-Traynet !! :evil: :cry:
No, seriously, I think it has to do with wpa, trying other networks (wpa2) will create a profile just fine, and after that when trying my ssid, the profile is created but with the ssid of the previous network inside profile config, oh well...difficult to explain, see video:
https://drive.google.com/open?id=193itr ... b8rtZXx6Mc

It's not in the video, but just now I tried creating another profile (from my neighbor from which I know he has also wpa) and it didn't work either, so must be a wpa thing, I guess.

EDIT: I tried some earlier versions and with 3.4 it works ok to create a (wpa) profile, and since you implemented the read-only fields the problem began (3.5).

Fred

stemsee

#72 Post by stemsee »

Thanks Fred,

So when I implemented the id:RO field I also implemented network type, eap, wpa2, wpa, wep but I didn't want to get too involved with multitude of possibilities.

After creating the profile did it connect? Maybe should only create profile after successful connection!

FYI
http://www.lsi.upc.edu/lclsi/Manuales/w ... icant.conf

What interests me are the unset defaults ... knowing these can reduce the config entries in the network blocks. So probably just need to reconfigure the network block for wpa.

stemsee

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#73 Post by fredx181 »

stemsee wrote:After creating the profile did it connect?
Not sure what you mean. With the 3.4. version, yes, it did connect.
What you saw on the last screencast was just creating (wpa2) profiles from other networks (not mine) to show that it works for profile creating, but no connection made.
Maybe should only create profile after successful connection!
Yes, maybe good, but if it makes things even more complicated, there's again the risk of creating new bugs, I'd say .

Fred

stemsee

#74 Post by stemsee »

So please run

Code: Select all

iwlist wlan0 scan
and post the output for your network. Le's try see if the ciphers or type are matched with the network block in the wpa profile.

Creating the profile after connection is just a matter of copying either qrc or netsel to profiles/$ssid+$bssid after the icon turns yellow (local connection) or green (internet), instead of after closing the password gui. That actually makes more sense. What could possibly go wrong!? :lol:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#75 Post by fredx181 »

My network:

Code: Select all

          Cell 09 - Address: 00:18:4D:52:54:A2
                    Channel:9
                    Frequency:2.452 GHz (Channel 9)
                    Quality=70/70  Signal level=-32 dBm  
                    Encryption key:on
                    ESSID:"UPC44685"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              12 Mb/s; 24 Mb/s; 36 Mb/s
                    Bit Rates:9 Mb/s; 18 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=00000002d2574d9e
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 00085550433434363835
                    IE: Unknown: 010882848B960C183048
                    IE: Unknown: 030109
                    IE: Unknown: 2A0100
                    IE: Unknown: 32041224606C
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD0900037F0101000CFF7F
                    IE: Unknown: DD0C00037F020101020002534000
                    IE: Unknown: DD1A00037F030100000000184D5254A202184D5254A264002C010C08
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
And this is the other wpa network I mentioned that no profile was created (als wpa version 1, but slightly different)

Code: Select all

          Cell 23 - Address: 54:22:F8:DF:06:4F
                    Channel:13
                    Frequency:2.472 GHz (Channel 13)
                    Quality=18/70  Signal level=-92 dBm  
                    Encryption key:on
                    ESSID:"Sterrenburg"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000032e637d7197
                    Extra: Last beacon: 2464ms ago
                    IE: Unknown: 000B5374657272656E62757267
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010D
                    IE: Unknown: 050400010000
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1A1C181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160D080400000000000000000000000000000000000000
                    IE: Unknown: 4A0E14000A002C01C800140005001900
                    IE: Unknown: 7F0101
                    IE: Unknown: DD0E0050F204104A0001101044000102
                    IE: Unknown: DD090010180201000C0000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
Fred

stemsee

#76 Post by stemsee »

So I see the problem, as i said I could not test on wpa. The script searches for 'IEEE' first then greps for WPA WPA2 WEP 802.1X EAP, but IEEE does not exist for WPA version 1, I see, so it goes through the case via *) .

So basically need more code and might as well get group cipher, pairwise cipher and authentication suites ... at the same time. I have a list of network blocks (32) covering most possible combinations of suites and ciphers, ssid and psk, ascii, numeric passwords. I want to add on an 'expert' panel to the gui allowing drag'n'drop of the network blocks with editing to cover a lot of the possibilities, at least 32 of them anyway! Really this is partly catered for in the gui by having the option to edit config with geany, * etc ... but having drag'n'drop network blocks with variables auto-filled should be a good and easy thing to implement. Especially if they are selected as svg icons .... :wink:

WPA network block for WPA should be generated after pasword gui closes with something like

Code: Select all

	ssid=`echo $details | cut -f3 -d'|' | cut -f2 -d'"'`
	sect=`wpa_passphrase "$ssid" "$password" | grep -v '#' | grep -v -e '}' -e 'network={'`

Code: Select all

network={
$sect
	 proto=WPA
	key_mgmt=WPA-PSK
	pairwise=CCMP TKIP
	group=CCMP TKIP WEP104 WEP40
}

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#77 Post by fredx181 »

Hi stemsee, you have much more knowledge about these matters than I have, but...
Wouldn't it be better to keep things simple, since the 3.4.version works ok (well, at least for wpa), by making it like that with clearly mentioning that the ID field should be empty for wpa ?
Just my 2c

Fred

stemsee

#78 Post by stemsee »

I run on minimum knowledge ... I like options.

Actually I wanted to get the id field greyed out, it is better that way, and helps make the app idiot proof!! But I am not ready to give up yet. So I have added a second case filter, which should catch WPA. So if you are willing to check this next update on your WPA networks, that would be great. If they don't work I will revert to 3.4, if they do work I will progress, but only add network block templates that open when config editor is opened .. for manual copy and paste and edit.

cheers
stemsee
Last edited by stemsee on Wed 04 Jul 2018, 08:50, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#79 Post by fredx181 »

Hi Stemsee, yes, works now, created profile and connected :)
Profile "UPC44685":

Code: Select all

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
update_config=1

network={
		ssid="UPC44685"
	psk=2d11be1fba88e6509bbe0cffbbed025796b776b3bde9ffd455a9c57e2b079bbd
	proto=WPA
	key_mgmt=WPA-PSK
	pairwise=CCMP TKIP
	group=CCMP TKIP WEP104 WEP40
}
Also created profile from the other (wpa) network "Sterrenburg" (just to see if that works):

Code: Select all

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
update_config=1

network={
		ssid="Sterrenburg"
	psk=80cd386b994d7c676dbb1e7f0a1d2feff0f8a835a581aab074c82aa0f3226f85
	proto=WPA
	key_mgmt=WPA-PSK
	pairwise=CCMP TKIP
	group=CCMP TKIP WEP104 WEP40
}
And when I did that, wifi was disconnected of course (filled in wrong password), but a strange thing happened when I again clicked on "UPC44685" (and re-created profile, I think) it did connect fine (to UPC44685), but showing "Sterrenburg" from the tooltip, see screenshot.

EDIT: Can you add also "iw" as dependency in the package?, then it would work also in Stretch.
(Bionic Dog has it already installed by default, but if it was not, the script would fail)

Fred
Attachments
2018-06-28-121820_408x323_scrot.png
Connected to "UPC44685" but showing conected to "Sterrenburg"
(184.02 KiB) Downloaded 402 times

stemsee

#80 Post by stemsee »

Great! Thanks Fred ... your merciless testing and feedback paid-off :twisted: :lol:

The reason your previous connected AP ssid showed was that profile was used to connect after gui closed and variables were not output to */apid which testcon2fn reads. So it read apid from previous connection because it still existed. (fixed)

iw added to deps in control file

Added network blocks list for advanced use when editing/customising saved profiles.

Now that select interface is only available on multi-card setups, I thought it more useful to move profiles to mainmenu and select interface to extrasmenu.

The code is now universal ... same experience on BionicDog, FD, BionicPup, Lighthouse etc!

There is an additional line of code that if dhcpcd5 is installed and dhcpcd is not then it is linked.

Completed!

cheers
stemsee

EDIT: previously the id field in the gui was used to input special commands, but now that is moved over to ssid field: unbreak breakall removedef
breakall simply exports brk=break, this variable is nested in various loops. removedef removes autosconnect features, including default profile and restores peasywifi_auto in ~/Startup
Attachments
2018-06-22-000540_668x351_scrot.png
(52.84 KiB) Downloaded 377 times
2018-06-28-150132_504x910_scrot.png
(80.4 KiB) Downloaded 389 times
2018-06-28-151449_360x623_scrot.png
(63.71 KiB) Downloaded 385 times
2018-06-28-151502_302x333_scrot.png
(35.75 KiB) Downloaded 378 times
Last edited by stemsee on Wed 04 Jul 2018, 08:51, edited 1 time in total.

Post Reply