PDA

View Full Version : Automatic wireless setup



nnigam
07-13-2007, 02:10 PM
I use an IBM A31p laptop that works beatuifully with Knoppix 5.1.1. However, whenever I boot my laptop with knoppix, I have to manually start my wireless network connection. Is there any configuration file that I can change so that wireless starts automatically, and connects to any available wireless network from a list of preferred wireless networks?

I know that Knoppix now is very configurable, I just do not know enough about where to make the change.

I use the knoppix dvd iso file on my ntfs c: drive to boot with the bootfrom cheatcode so that my cd/dvd drive is free and the system runs a whole lot faster. I have my configuration saved on a 512 mb persistent image on my fat32 d: drive. I store most of my data on my D drive so that it is available from both knoppix as well as xp.

Thanks
Neeraj

chip.ling
08-04-2007, 05:08 AM
I use an IBM A31p laptop that works beatuifully with Knoppix 5.1.1. However, whenever I boot my laptop with knoppix, I have to manually start my wireless network connection. Is there any configuration file that I can change so that wireless starts automatically, and connects to any available wireless network from a list of preferred wireless networks?

I know that Knoppix now is very configurable, I just do not know enough about where to make the change.

I use the knoppix dvd iso file on my ntfs c: drive to boot with the bootfrom cheatcode so that my cd/dvd drive is free and the system runs a whole lot faster. I have my configuration saved on a 512 mb persistent image on my fat32 d: drive. I store most of my data on my D drive so that it is available from both knoppix as well as xp.

Thanks
Neeraj

I put up something on the Document ==> FAQ ==> Network FAQ

In your case, just copy the wireless driver files to your fat32 d: drive (on step 2)

Then append the code to your knoppix.sh file. You do not need that line modprobe -r bcm43xx.

Rgds,
Chip

chip.ling
08-04-2007, 08:40 PM
Is there any configuration file that I can change so that wireless starts automatically, and connects to any available wireless network from a list of preferred wireless networks?


Sorry, didn't see this part on my last reply.

Bascially, after the step iwconfig wlan0 essid xxxx channel xxxx, check the result with iwconfig. If it is not connected, go to connect to essid yyyy etc, etc.

You need to play around with the knoppix.sh and make your change.

Rgds,
Chip

chip.ling
08-05-2007, 05:17 AM
Is there any configuration file that I can change so that wireless starts automatically, and connects to any available wireless network from a list of preferred wireless networks?


Sorry, didn't see this part on my last reply.

Bascially, after the step iwconfig wlan0 essid xxxx channel xxxx, check the result with iwconfig. If it is not connected, go to connect to essid yyyy etc, etc.

You need to play around with the knoppix.sh and make your change.

Rgds,
Chip

Check the Document => FAQ => Network FAQ again. I put up another code there that will work for your case.

Rgds,
Chip

nnigam
08-06-2007, 02:00 PM
Thanks

I will certainly check out the faq and give this a try. Knoppix has beeng great, and I love using it.

Neeraj

nnigam
08-21-2007, 03:10 PM
Dear Chip

Sorry about the delay in posting my results. Got busy at work and family stuff.

I read the FAQ, and I remember reading it earlier, but had not paid too much attention since everything my laptop needed was already on the live CD/DVD. I had made seperate individual scripts using commands similar to yours for each of my network connections, and they were working. I incorporated your suggestions above and from the faq to create a single shell script with all my network connections.

The problem that I found with this was that it found the last used connection even if I am at a location later in the script and then fails to connect to it. I do not know how it found it, maybe because I use a persistent disk image. What would be ideal if there was somewhere I could put all my scripts and they are tried one after the other untill a connection is made, similar to what happens in XP maybe a startup folder with a master script that pings a location and exits on success.

Thanks
Neeraj

chip.ling
08-22-2007, 07:04 AM
I read the FAQ, and I remember reading it earlier, but had not paid too much attention since everything my laptop needed was already on the live CD/DVD.

That's alright. I added the FAQ there after I saw your post so you could not find it on your last visit.



I had made seperate individual scripts using commands similar to yours for each of my network connections, and they were working. I incorporated your suggestions above and from the faq to create a single shell script with all my network connections.

The problem that I found with this was that it found the last used connection even if I am at a location later in the script and then fails to connect to it. I do not know how it found it, maybe because I use a persistent disk image. What would be ideal if there was somewhere I could put all my scripts and they are tried one after the other untill a connection is made, similar to what happens in XP maybe a startup folder with a master script that pings a location and exits on success.

Thanks
Neeraj

I do not use persistent disk image. But what is your cheat code when you start Knoppix?

Rgds,
Chip

chip.ling
08-22-2007, 08:05 AM
The problem that I found with this was that it found the last used connection even if I am at a location later in the script and then fails to connect to it. I do not know how it found it, maybe because I use a persistent disk image. What would be ideal if there was somewhere I could put all my scripts and they are tried one after the other untill a connection is made, similar to what happens in XP maybe a startup folder with a master script that pings a location and exits on success.

Thanks
Neeraj

Just did a quick test on my wireless connection. It seems to me it is unlikely the situation you mentioned will happen. Can you show me your script? I suspect there might be some typo in the code.

Rgds,
Chip

nnigam
08-24-2007, 05:41 PM
Dear Chip

The boot cheatcode that I use is "knoppix bootfrom=/dev/hda1/k511.iso" so that I boot from the iso image freeing up my dvd drive for other purposes, and is a lot faster since running from hd. This is an NTFS partition to hold the 4.1 gig dvd iso file.

During boot up, I get the prompt for knoppix persistent disk image found, and I select yes. After the boot up, I run the boot.sh file below

for i in OFFICE HOME; do
sleep 5
if [ "$i" = "OFFICE" ]; then
es="Testing"
ky="mysecretpassphraseforwork"
channel=10
elif [ "$i" = "HOME" ]; then
es="HomeNetwork"
ky="mysecretpassphrasefor home"
channel=9
else
echo "Error on searching network"
fi
echo "Searching for network $es with channel $channel"
#iwconfig eth1 essid $i channel $channel
iwconfig wlan0 essid $es key $ky channel $channel
sleep 5
result=$( iwconfig wlan0 | grep $es )
if [ "$result" = "" ]; then
echo "Network $i channel $channel not found"
echo "Now check for the next network on the list..."
else
echo "Network $i channel $channel found"
break
fi
done

ifconfig wlan0 up
iwconfig wlan0 mode Managed
iwconfig wlan0 ap any
pump -i wlan0


Say I run the script at my office. It works perfectly. Then I go home, and run the script. I get a message that OFFICE network found, but since the essid and passphrase are different, connection fails.

Thanks
Neeraj

chip.ling
08-28-2007, 02:59 AM
Your shell script seems ok to me. So I suspect it is the persistent home or some of your setting remembers the network information.

Try this:

Before the statement


for i in OFFICE HOME; do

add another statement:


iwconfig wlan0 essid any

The objective of this statement is to reset the essid so as the for-loop next to it may yield a real result.

Rgds,
Chip

nnigam
08-28-2007, 02:28 PM
Thanks, I should have thought of that. This does the trick for me.

maestrobwh1
10-18-2007, 11:00 PM
so... I took it a step further (see end), so that any user would have to do nothing in order to have a connection.

I created this simple script and placed it in /home/knoppix/ and called it .network so it would be hidden.
After saving (show hidden files), make it executable.

#!/bin/bash
echo "Wireless is now starting!"
echo "Please wait until this shell closes"
echo "before launching other programs..."
sleep 5
echo "Setup the ESSID and channel..."
sudo iwconfig ath0 essid linksys channel 6
sleep 5
echo "Starting wireless... allow a few seconds..."
sudo ifconfig ath0 up
echo "Get IP address... allow a few more seconds..."
sleep 5
sudo pump -i ath0
sleep 1
echo "Wireless should be connected"
echo "The kwifimanager tray icon should now be green..."
echo "This shell will now exit ..."
sleep 3

Then I went to home/knoppix.kde/Auotstart/ right clicked --> create new --> link to application and browsed (show hidden files) to /home/knoppix/.network I also used the advanced and told it to use the terminal so that it would be "verbose" to the user... that way if anyone else boots it, they won't be trying to suddenly open the internet and start fussing around because it didn't have time to configure. I use kwifimanager and since it saves with my settings, it is automatically in my tray now.

bada bing... works every time.