LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices

Reply
 
Search this Thread
Old 09-09-2005, 10:00 PM   #1
lethargic1
LQ Newbie
 
Registered: Aug 2005
Location: middle of nowhere (really)
Posts: 18

Rep: Reputation: 0
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?
 
Old 09-09-2005, 10:07 PM   #2
lethargic1
LQ Newbie
 
Registered: Aug 2005
Location: middle of nowhere (really)
Posts: 18

Original Poster
Rep: Reputation: 0
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...

Last edited by lethargic1; 09-09-2005 at 10:08 PM.
 
Old 09-10-2005, 08:39 AM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,781
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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;
}
 
Old 09-11-2005, 06:29 PM   #4
lethargic1
LQ Newbie
 
Registered: Aug 2005
Location: middle of nowhere (really)
Posts: 18

Original Poster
Rep: Reputation: 0
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...

Last edited by lethargic1; 09-11-2005 at 06:33 PM.
 
Old 09-12-2005, 06:58 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,781
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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.
 
Old 01-13-2007, 05:23 PM   #6
dan_slack
Member
 
Registered: May 2004
Location: Bucharest - Romania
Distribution: Slackware 12
Posts: 57

Rep: Reputation: 15
Smile 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

Last edited by dan_slack; 01-13-2007 at 05:46 PM.
 
Old 01-14-2007, 07:33 AM   #7
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,781
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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.
 
  


Reply

Tags
wireless


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ndiswrapper worked fine "ESSID:off/any" ??? cant put in an ssid?? fatrandy13 Linux - Wireless Networking 12 08-21-2011 11:32 PM
WG311v3 thru ndiswrapper - essid resetting+ SaxyWeed Linux - Wireless Networking 0 11-11-2005 01:18 AM
Setting essid on DWL510 with ndiswrapper 0.10 lberger Linux - Wireless Networking 5 12-09-2004 03:16 AM
suspicion about scanning for wireless (ndiswrapper) and router with hide essid on darkleaf Linux - Wireless Networking 6 10-18-2004 01:07 PM
ndiswrapper, linksys 802.11g, essid not "sticking" bishiraver Linux - Wireless Networking 4 07-18-2004 03:48 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration