LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   slackware, ndiswrapper, and essid?! (https://www.linuxquestions.org/questions/linux-wireless-networking-41/slackware-ndiswrapper-and-essid-361936/)

lethargic1 09-09-2005 10:00 PM

slackware, ndiswrapper, and essid?!
 
m'kaay...

a while back, i installed ndiswrapper on my slackware laptop and was able to get my netgear ma521 wireless card up and running on it. well...almost running...

you see, every time i need to connect i have to start out by entering the commands:

modprobe ndiswrapper
iwconfig wlan0 essid phar66
ifconfig wlan0 up
dhcpcdwlan0

and then everything's up and running. i know there's a configuration file that i need to edit, but i'm still not quite sure which one or how.

last time i tried to edit a file like that i had to reformat :(.

anyway, this problem isn't so bad. i can actually get used to it.

the main problem is that i'm not always able to connect this way. sometimes, when i enter "iwconfig wlan0 essid phar66", nothing happens. normally when i press enter on that command my network card's link light comes on. when it doesn't, i try typing in "iwconfig", but it still shows the essid as off/any. and if i type in "iwlist wlan0 scan" i get a list of networks which consists of my parents', my neighbors, and...what i think is city hall (not too far from where i live).

i've also been monkeying around with something on the kdesktop called "kwifimanager". when i scan for networks using that i see the same networks and also that their signal strength is pretty good.

i've been playing around with other iwconfig commands. i tried "iwconfig wlan0 mode ad-hoc" which, if i understand right, will allow me to communicate with other wireless computers and devices in the area(?). it makes that link light come on and when i use "iwconfig" it shows that i'm connected to phar66. but when i change the mode back to "managed" the light goes out and i lose that essid again.

i also tried "iwconfig wlan0 ap" along with the address i see when i use iwlist. oh, and "iwconfig wlan0 commit". neither of those seem to do anything for me.

well...perhaps they just silently laugh at me...

so...as far as i can tell, my laptop is seeing the network i'm trying to connect to, but...just won't let me? is there a way i can force it to accept the essid that i'm trying to connect to. or what about off/any? why can't i just connect to whatever network happens to be around?

i don't know. when i'm able to get on the interweb, my connection is flawless. my brain hurts.:(

any idears?

pretty please?:cry:

lethargic1 09-09-2005 10:07 PM

one more thing...

i don't know if it will help, but i posted this in the slack forum a couple of weeks ago.

http://tinyurl.com/b88sf

jackson1995 did a pretty good job of getting everything up and running and i still owe him my firstborn son or something. nobody there seemed to have an answer for this one, though...

Hangdog42 09-10-2005 08:39 AM

Quote:

the main problem is that i'm not always able to connect this way.
It's not just you. For reasons I don't really understand, if I try to configure my card after booting I occaisionally see the same sort of behavior you do. You have to enter commands multiple times for them to take. I've never seen either an explanation or a way around it although I suspect it is something in the difference between logging in as root and accessing root through su. What I've done however is to write a couple of scripts. My first one I called from /etc/rc.d/rc.inet1 and it set up the card for my home network. It always worked when I set up the card at boot.

Code:

#!/bin/sh
  #
  # rc.wlan0
  #

  #CHANNEL=_
  ESSID="YourSSIDHERE"
  INTERFACE="wlan0"
  KEY="YourHEX_WEPKEY_Here"
  MODE="Managed"
  NETMASK="255.255.255.0"

  #Load the module
  echo "Loading NDISWRAPPER"
  /sbin/modprobe ndiswrapper

  # Set up the WiFi card

  echo "Configuring ${INTERFACE}:"
  /usr/sbin/iwconfig ${INTERFACE} essid ${ESSID}
  #/usr/sbin/iwconfig ${INTERFACE} channel ${CHANNEL}
  /usr/sbin/iwconfig ${INTERFACE} mode ${MODE}
  /usr/sbin/iwconfig ${INTERFACE} key ${KEY}

  # Get IP address from dhcp

  /sbin/dhcpcd -t 10 -d wlan0

  # Bring up interface - I'm not sure if this is necessary,
  # but it doesn't hurt

  ifconfig wlan0 up

However, I got tired of this because if I moved, I had to re-configure the card by hand and ran into the same problems that you're seeing. So I now use a perl script I wrote that scans for available networks then presents me with a list of SSIDs to choose from. If it doesn't find any other networks, it defaults to installing my home network. The only thing this doesn't handle is if the non-home networks require a WEP key. But for open access points, it works just fine. I replaced the call in rc.inet1 to the previous script with a call to this one.

Code:

#!/usr/bin/perl
$Interface = "wlan0";
$HomeESSID = "Your_SSID_HERE";
$WEP = "Your_HEX_WEP_Key_Here";
$Mode = "Managed";
$IWCONFIG = "/sbin/iwconfig";
$DHCP = "/sbin/dhcpcd -t 10 -d";
@APList = ();
#First load the ndiswrapper module
print("Loading ndiswrapper\n");
system("/sbin/modprobe ndiswrapper");
print("Scanning for wireless access points\n");
@ScanList = qx/iwlist wlan0 scan/;
foreach $a (@ScanList){
        if($a =~m/No scan results/){
                print("No networks detected, enabling home network\n");
                &homeNet;
        }
        if($a =~ m/$HomeESSID/){
                print("Home network detected\n");
                &homeNet;
        }
        if ($a =~m/ESSID/){
                @Temp = split(/"/,$a);
                push(@APList,$Temp[1]);
                for($x=0;$x<=$#APList;$x++){
                        print("At $x is $APList[$x]\n");
                }
        }
}
&selectFrom;
sub homeNet{
        print("Setting up wlan0\n");
        system("$IWCONFIG $Interface essid $HomeESSID");
        system("$IWCONFIG $Interface mode $Mode");
        system('/sbin/iwconfig wlan0 key 62112EBE2AB9DBBD6D043650AD');
        print("Requesting IP from $HomeESSID\n");
        system("$DHCP $Interface");
        system ("ifconfig $Interface up");
        print("Configuration done\n");
        exit;
}
sub selectFrom{
        print("Select one of the following AP points\n");
        for($x=0;$x<=$#APList;$x++){
                print("$x - $APList[$x]\n");
        }
        print("Select by number: ");
        $SelectAP = <STDIN>;
        if((0 <= $SelectAP) and ($SelectAP<=$#APList)){
                print("Using $APList[$SelectAP]\n");
                system("$IWCONFIG $Interface essid $APList[$SelectAP]");
                print("Requesting IP from $APList[$SelectAP]");
                system("$DHCP $Interface");
                system("ifconfig $Interface up");
                exit;
        }
        else{
                print("Please select an acceptable number\n");
                &selectFrom;
        }
        exit;
}


lethargic1 09-11-2005 06:29 PM

thanks, but how do i use that script?

do i need to enter it into /etc/rc.d/rc.inet1 or rc.inet1.conf? or is this a seperate file that i need to make and somehow link in one of these files? i guess i'm still learning what these things all do.

like i said, last time i screwed with one of these files many many bad things happened.:(

edit: if it helps, my laptop's online at the moment. my connection just came up last night and it's been working flawlessly. dunno how long it'll last though...

Hangdog42 09-12-2005 06:58 AM

I have each of those files saved as their own executable file. They're not integrated into anything else. I then edited my rc.inet1 file and simply included the path and name of the file. So the first one I posted I save as rc.wlan0, so in my rc.inet1 I have the line

/etc/rc.d/rc.wlan0


And then it runs during boot. A more traditional way to do this would be to add the call to the file to your /etc/rc.d/rc.local file, which Slackware intends to be customized by the user. I'd try it from rc.local first since that precludes any real problems from happening and then as you get more comfortable with Slackware, you can change it to suit your tastes. And only use one of the scripts at any one time.

dan_slack 01-13-2007 05:23 PM

Thank you!
 
After two days of hard work, I managed to get my new Trendnet TEW-424UB USB wireless card workin' on my slack 11 machine.
I get the ndiswrapper slack pkg from:
http://www.slackware.com/~alien/slac...pper/pkg/11.0/

I have a single related problem:
The shutdown freazes after
'Unmounting remote file system'.
I've tried to put "ifconfig wlan0 down" in the shutdown script, but the same...
Any sugestions, please?

Tks to all of you here.

Dan

Hangdog42 01-14-2007 07:33 AM

I would suggest compiling your own ndiswrapper rather than using a slackware package. Unless it was compiled against the same kernel version and configuration you're running, it could cause problems.


All times are GMT -5. The time now is 06:25 AM.