Networking :: persistant wireless



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

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"

You can call the ndiswrapper script with one line in bootlocal.sh using the form "ndiswrapper.sh /path-to-file/*.inf essid wep"
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.
Does this work with a live CD using backup or only with an install?

Steve

Next Page...
original here.