persistant wireless


Forum: Networking
Topic: persistant wireless
started by: geomort

Posted by geomort on Jan. 18 2008,00:48
I can get my wireless card running fairly easily with ndiswrapper in 4.2.  The 128 bit wep works too.
However, getting it to work without a line by line configuration has illuded me.
I have pasted the lines of my /opt/bootlocal.sh one at a time into a user terminal and they work just fine and load the wlan adaptor with ndiswrapper.

But if I try and automate the configuration with a script it fails.

Maybe I need a delay, or pause after the "sudo ndiswrapper -i /mnt/hda2/bcmwl5.inf" line.  Don't know how to do that maybe "sleep 5" or such?

Here is a close copy of my /opt/bootlocal.sh
have I made a syntax error?

#!/bin/bash
# file to configure DSL with ndiswrapper

sudo mount /dev/hda2 /mnt/hda2

sudo ndiswrapper -i /mnt/hda2/bcmwl5.inf

sudo modprobe ndiswrapper

sudo umount /mnt/hda2

sudo iwconfig wlan0 essid mynetwork

sudo iwconfig wlan0 key open "my128bitasciwepkey"

sudo ifconfig wlan0 up

sudo pump -i wlan0

sudo iwconfig

I'm out of ideas to make this work.

Thanks

Posted by lucky13 on Jan. 18 2008,01:42
You need a delay between the  modprobe and iwconfig commands (you can put those all on one line) so the module has time to load; you might also add one after the ndiswrapper -i command. The script called by the ndiswrapper GUI has a sleep 5, which has been adequate for me.
(/usr/local/bin/ndiswrapper.sh)
Code Sample
#!/bin/bash
ndiswrapper -i "$1"
modprobe ndiswrapper
sleep 5
iwconfig "$2" essid "$3"
if [ -n "$4" ]; then
  iwconfig "$2" enc "$4"
fi
pump -i "$2"

Posted by Juanito on Jan. 18 2008,04:02
You can call the ndiswrapper script with one line in bootlocal.sh using the form "ndiswrapper.sh /path-to-file/*.inf essid wep"
Posted by geomort on Jan. 18 2008,20:43
Thanks, for the help.  It was the delay I needed.  Inserting sleep 5 after ndiswrapper -i and after modprobe ndiswrapper did the trick.  My wireless card comes up with each boot.  Had trouble trying to use the canned myndis script.  Maybe I needed to mount hda2 or had the true path wrong or forgot sudo. The Broadcom Chip cards are all working on boot up.  I'll work on the Atheros chip cards next and then the Zydas.  Loading a kernel module should be interesting.
Posted by stevesr0 on June 12 2008,01:03
Does this work with a live CD using backup or only with an install?

Steve

Posted by stevesr0 on June 14 2008,20:35
I added the commands I was manually using to configure wireless with each boot from my Live CD (V 4.4) with modifications in accord with geomort's post and lucky13 comment) to my bootlocal.sh.

On reboot, ping didn't work, but did after I entered a pump -i wlan0 command in a root shell.

Since I had a pump -i wlan0 line in my bootlocal.sh, I am puzzled why it didn't work.

My bootlocal.sh is:
#!/bin/bash
# put other system startup command here
sudo pump -k
sudo mount /dev/hda1 /mnt/hda1
sudo ndiswrapper -i /mnt/hda1/Drivers/Wireless/bcmwl5a.inf
sudo sleep 5
sudo modprobe ndiswrapper
sudo sleep 5
sudo umount /mnt/hda1
sudo iwconfig wlan0 essid blackriver
sudo iwconfig wlan0 key F2EA328E4F6FA8805CBBE45DD0
sudo ifconfig wlan0 up
sudo pump -i wlan0
sudo iwconfig

Appreciate help; thanks in advance.

Steve

Posted by stevesr0 on June 14 2008,22:29
Found my error, by searching the forum archives some more and found a comment by (dread pirate) Roberts that the boot code nodhcp should be used in conjunction with the wireless configuration in bootlocal.sh.

I added nodhcp at boot and DSL comes up connected!

Thanks all.

Steve

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.