site  contact  subhomenews

Pwireless2 now in Quirky

February 16, 2010 — BarryK
I have put Jemimah's superb Pwireless2 into Quirky and also had a first stab at integrating it with the "old" Network Wizard created by me and Dougal's "new" Network Wizard, in the Woof scripts.

I have compiled the latest dhcpcd 5.1.5 and wpa_supplicant 0.6.10 packages, also have gtrayicon 1.1-1 package, and have taken those packages out of Jemimah's Pwireless2 package. Jemimah's package now has no binary executables and is architecture-independent.

Woof bootup
The boot script /etc/rc.d/rc.sysinit now has this code:

#v411 can use old network wizard (from 403, based on 400)...

CHECKOLDWIZ="`ls -1 /etc/*[0-9]mode 2>/dev/null`" #ex: eth0mode, wlan0mode.
if [ "$CHECKOLDWIZ" != "" -a -d /usr/local/net_setup ];then
chmod 644 /etc/init.d/Pwireless2 #prevent jemimah's script from running.
#note, old wizard is located in /usr/local/net_setup.
/usr/local/net_setup/etc/rc.d/rc.network &
else
#100216 choose between Dougal's Network Wizard and jemimah's Pwireless2...
CHECKNEWWIZ="`ls -1 /etc/network-wizard/network/interfaces 2>/dev/null`"
if [ "$CHECKNEWWIZ" != "" ];then
chmod 644 /etc/init.d/Pwireless2 #prevent jemimah's script from running.
/etc/rc.d/rc.network &
else
#this only sets up interface 'lo'...
/etc/rc.d/rc.network_basic &
#jemimah's script is in /etc/init.d/Pwireless2
chmod 755 /etc/init.d/Pwireless2 #make executable so it will run.
fi
fi


rc.network_basic:

#!/bin/sh


#echo "Setting up interface lo..."
ifconfig lo 127.0.0.1
route add -net 127.0.0.0 netmask 255.0.0.0 lo

#begin rerwin
if [ -f /root/.dhcpcd.duid ];then #Using a DUID in client ID
#If running from pup_save file and no common DHCP Unique Identifier (DUID) present and partition has a full-install or partition-save and a duid file, make that file the common duid.
[ ! -s /mnt/home/.common.duid -a ! "`ls -l /mnt/home | cut -f 11 -d ' '`" = "/" -a -s /mnt/home/root/.dhcpcd.duid ] && cp /mnt/home/root/.dhcpcd.duid /mnt/home/.common.duid
#Ensure that any local duid matches the common duid or will force new duid.
[ -s /mnt/home/.common.duid ] && cp /mnt/home/.common.duid /root/.dhcpcd.duid || cp /dev/null /root/.dhcpcd.duid
if [ -s /root/.dhcpcd.duid ];then #duid info for DHCP request.
[ ! -d /var/lib/dhcpcd ] && mkdir /var/lib/dhcpcd
cp /root/.dhcpcd.duid /var/lib/dhcpcd/dhcpcd.duid
else #Force new DUID
[ -f /var/lib/dhcpcd/dhcpcd.duid ] && rm /var/lib/dhcpcd/dhcpcd.duid
fi
fi
#end rerwin


...that will need further refinement. The code checks to see if the "old" Network Wizard is installed and executed as far as creating profiles. If not, it checks to see if the "new" Network Wizard was taken as far as creating a profile. If not falls back to Jemimah's script. The main problem with this code is it is a one-way street. Really need some kind of GUI to choose which one to use and set as default.

Pwireless2 modifications
I have also modified /root/Startup/pwireless2-tray:

[ ! -f /usr/local/Pwireless2/interface ] && exit #BK

[ ! -x /etc/init.d/Pwireless2 ] && exit #BK

gtrayicon --activate="/usr/local/Pwireless2/connect" --activate-icon=/usr/share/pixmaps/network-offline.png --deactivate="/usr/local/Pwireless2/disconnect" --deactivate-icon=/usr/share/pixmaps/network-transmit-receive.png --menu-file=/usr/local/Pwireless2/network.menu --tooltip='Click to connect or disconnect Pwireless2'&

sleep 1
. /usr/local/Pwireless2/config
INTERFACE=`cat /usr/local/Pwireless2/interface`

$WPA_CLI -i $INTERFACE status |grep ip_address

if [[ $? == 0 ]] ; then
killall -SIGCONT gtrayicon
fi


dhcpcd 5.1.5
How it was configured:
# ./configure --libexecdir=/lib/dhcpcd --dbdir=/var/lib/dhcpcd --sysconfdir=/etc

wpa_supplicant 0.6.10
My '.config' file is a bit different from Jemimah's. I didn't really know what I was doing, but I changed it anyway...

http:/bkhome.org/sources/alphabetical/w/DOTconfig-wpa_supplicant-0.6.10-quirky007

Further integration
I have not yet integrated Pwireless2 into the 'connect' desktop icon, that is, the "Internet Connection Wizard". For now, you have to go to the "Network" menu and choose "Pwireless2 wireless scanner".
Firstly, need to get some hands-on experience with how it is all currently setup, which will be in the upcoming Quirky 007.

Testing
I did a build of Quirky 007-preview and installed to a USB stick. Pwireless2 is working, but there are a couple of problems:

1.
I clicked 'connect' button in Pwireless2, it connected, but there was no message about success.
2.
The icon in the tray applet does not change, stays with "disabled" icon.
3.
Not getting any yaf-splash messages, although Quirky does have yaf-splash.

Rebooted, the network connection worked automatically, but again no yaf-splash messages and the tray icon remains disabled. Both of those worked before, so it seems that I have left something out.

Comments

network popup
Username: DC
Hi Barry, A small request while you are playing with the networks scripts. When using the existing network wizard to DHCP a wired connection. A popup window with eth0 and the ip address appears and disappears very quickly. Then you get the popup window saying "Network configuration successful" Would it be possible to either put these two popups together as one popup or put the ip address in the "Network configuration successful" popup so as to have time to see the ip address many thanks for Puppy David

upgrades
Username: x
"pwireless2 is a definite improvement for holding fragile connections. the upgraded 3G connect is still to make an appearance in a standard release, how is that coming along. ready for prime time yet?

network connection
Username: bruce
"I travel all the time. My connections to the internet are via wired ethernet or wireless wifi. The wifi may be Open, WEP, or WPA. Pwireless only supports wifi and not wired ethernet. So I have to use the connection-wizard to connect to the wired network. My next connection will be wireless I expect so I want to use Pwireless. I ask that the system allow using the tool most appropriate deactivating whatever would block it from working. So if one tries one the other two are deactivated. The user chooses which to use that is appropriate. Checking profiles wont work in my case because I have a Connection-Wizard profile for my wired connection. My next connection may need Pwireless for wifi and use a Pwireless profile. I establish 1-3 unique connections a week: wired, wifi, Open, WEP, or WPA. I use puppy because it is flexible. I like Pwireless because it does not try to make a connection until I ask it to. Why have my computer try to connect when I start it when I know the old profile wont work. Thank you for your great work and all those who contribute as well!!! bruce.

Pwireless2
Username: BarryK
"bruce, Pwireless2 is totally different from Pwireless. Jemimah has added support for ethernet wired connection to Pwireless2.

Pwireless2 now works
Username: BarryK
"I sent a pm to Jemimah asking if she had any particular thought what I might have overlooked, that was causing no yaf-splash messages and the tray icon did not change. Jemimah knew exactly what the problem was! I had left out some scripts that dhcpcd needs. I'm running Quirky 007-pre right now and Pwireless2 is working beautifully. Now I'm going to think a bit more about my attempt at integrating with the rest of the network connection stuff in Puppy...


Tags: quirky