G'day 'stu',
Thanks for your continued advice.
I did have another play last night trying wlan0 in place of rausb0 but got much the same result with your original code lines.
An extra Blinky appeared (eth0 is there and OK) but nothing wifi actually working.

However while later adding an sfs to my frugal /mnt/home, I noticed the 'system start' tool for doing this also has a black-listing capability for 'de-fault' drivers that are not suitable (= "the-fault drivers"??). So, using this, I stopped rt2570 from loading and added "ndiswrapper" as a to-be-loaded driver. On re-starting the 'puter, and then the network wizard, there was no pre-loaded default wifi network driver and I was able to click the ndiswrapper tab and link to my XP rt2500 inf file without error messages, or 'no new network' boxes when then testing with the wizard. So I had a working WPA wireless network. And it was registering on RutilT which I had thought was only for WEP systems.

The big test was this morning with a cold re-start. Having two minutes** before fleeing to work, had time to start-up, see the two network blinkies, use RutilT to check the wireless blinky was my network (and not one of the neighbours' open systems), check my email, then close down. So, success!

I edited /etc/wpa_supplicant.conf and followed the commands in Part 2 and did get WPA working with my DLink WPA-PSK router but I had to start another terminal session to enter the dhcpcd command as the wpa_supplicant command never successfully returned to the command prompt (although it obviously did its work as the encryption was setup). When I entered the dhcpcd command in the second terminal, I successfully got an IP address and I could browse the Internet. This was with a DLink Atheros based card using the ath_pci driver.

Posted: Mon 07 Jan 2008, 12:04 Post subject:
Re: excellentSubject description: slap me up the side of the head but...

Hi,

I'm still a linux command line newbie. I can follow the command line stuff here but I'm not sure I quite understand what to do with a script. Where does the following script go? Is it just a file in /root? Do you call it anything special? Or, do I add it to one of the files?

Yorkiesnorkie

edit: I'm reading stuff on bash scripting...

raffy wrote:

Thanks! An excellent HowTo from an esteemed developer for Puppy Linux. This will be useful for inclusion in Puppy Linux manuals.

Recently, I experimented with a simple user-editable script for activating wifi in a simple network setup using only ESSID. The example device is D-Link USB DWL-G122 with driver rt2570.

The only important thing is that you set it executable. You could right-click it and go to properties or permissions to do it, or from the commandline run
chmod 755 script_name
(if you aren't in the same directory as it, you need to include the path to the script rather than just its name)

As for naming, scripts sometimes end with a .sh extension, but that's optional. Very few scripts in Puppy use that. You can pretty much name them whatever you want, but it's best to choose something unique, especially if you put it in the path.

Where you put it is up to you. If it's something to run each boot, you might want to put it in /etc/rc.d/ and maybe name it starting in rc.<whatever> (but that doesn't affect anything).

One thing to keep in mind with placement is that if you put it in the path (/bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, etcetera) you can run it by just typing it's name in the commandline, just like it's another application. Otherwise, you need to include the path to run it.

If you want it run every boot, you could add a line in /etc/rc.d/rc.local to run it (just type the name or path as appropriate on a blank line). Another method is to add an
if [ "$1" = "start" ]; then
to the beginning (after the #!/bin/sh part though), and a
fi
to the end, then place it in /etc/init.d. Then it will be automatically run every time Puppy boots. (The reason for the changes is because Puppy runs ever executable file in that directory with the "start" parameter on boot, and with the "stop" parameter on shutdown. As it was, it would run the same no matter what parameters were passed in. For booting, that's fine. But you don't really want it getting run again when you try to shut down. You could actually add another section to bring down the wireless interface, but that's not necessary (might be handy if you needed to disable it though, like to unplug the USB dongle without locking up the machine).

Code:

if [ "$1" = "stop" ]; then
ifconfig rausb0 down
rmmod rt2570
fi

_________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Thanks for the detailed reply. Its awesome! That's exactly the information I was looking for to connect the dots. This stuff is very interesting I might add. While not a programming expert, I can see the potential to tinker with the inner workings and get it working the way I want.

So now I have to edit Raffy's script to fit my situation. I also have a choice to make, whether to run it myself whenever I want it to connect, or to have it run automatically. Hmmm... Well I'll definitely take a run at this because it would be nice to have it work on startup since the first thing I do usually is check the mail.

I followed the instructions at the beginning of this thread to set up a WEP connection - let's call this location A - and it works perfectly, although it slows my startup by about 30 seconds. I'm now at location B where I have a WPA network - the wizard connected to that first time, no problems, and I know I could script this using wpa_supplicant, but how can I get Puppy to work out which network is visible (the two locations are ~150 miles apart) and then choose WEP (i.e. iwconfig) or WPA (i.e. wpa_supplicant) as the connection method? In addition, I also have access to an unsecured network (my University's - there is no encryption but you have to log on over the web to access the internet) which I would like to be able to connect to automatically, although this is not so important.

Theoretically, you can save the settings for more than one network in wpa_supplicant.conf, and then the wpa_supplicant program is supposed to automagically choose which one to connect to. It's also supposed to be able to handle WEP networks. I don't know how to do that though.

A less elegant method would be to set it up to configure everything for the WEP network up to just before it runs dhcpcd. Then use iwlist to see if the network is available (pipe it into grep, and probably try it a couple times in case the card has trouble seeing it). If the network isn't available, switch to the WPA method._________________Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Ok, it seems that WPA supplicant solves all my problems - apparently I can just create a single configuration file listing my three networks and it will automatically choose the best one. It even prefers better security, all other things being equal! Brilliant

Thanks!

Update:

I now have it automatically connecting to my WPA network by manually calling wpa_supplicant from rc.local with my new wpa_supplicant.conf! All I now have is four lines:

Don't know if this public thanks fits the subject, but, by having my wireless pen SMC WUSB-G (ndiswrapper) working flawlessly with WPA2 I really feel I must thank everyone here, specially tempestuous and Pizzasgood. Thanks a lot.

Puppy 3.01 loads the bcm43xx module on my Dell D620. Both the network wizard and the command line tricks in the post fail every time on both dhcp and static ip. RutilT works perfectly tho, if you don't mind entering the key each time. Good enough for me, I can't fight this any more.

I just added a new section "PART 4: Troubleshooting, encryption problems" to an earlier post, to avoid the extra information being spread throughout this thread.
http://www.murga-linux.com/puppy/viewtopic.php?p=159339#159339

After quite a bit of messing around, I managed to get auto DHCP from startup on this Dell Vostro 1000 with Broadcom 43xx card. The bcm43xx driver seems to work fine for me, whereas I could not get the windows driver bcmwl5.inf to work at all through ndiswrapper.
I think the DHCP problem is it trying to log-in the card immediately after turning it on, as someone else suggested. I therefore added this to rc.local and now I'm on the net as soon puppy starts and I click on Firefox. eth0wireless & eth0mode files can be deleted, which will stop the network card being booted twice at startup. Basically it's putting a delay in the initialisation of the card, but why it won't work if you put the same script into eth0wireless I'm unsure.

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