# ndiswrapper, iwconfig and wireless extensions

## m0rd0

I've been battling with my Acer Aspire 1522 WLMi for some time now, originally installing the Gentoo 2005 64bit release only to find it causing too many problems with wireless cards and bespoke software I have to run.  So I decided to move to 32bit.  I'm running the latest 2005.1 build and I've hit a wall in trying to resolve a wireless issue once again.

The 'net gateway here is running a custom build of linux and has a prism based wireless card acting as an access point for all wireless devices.  It works fine as I can boot my laptop into WindowsXP and surf away.  I downloaded the latest 32bit drives from the acer support site for my laptop, installed ndiswapper and thats about as far as I've got.  For some reason whenever I ask iwlist to scan using device wlan0 it comes back with no scan results.  I can see the cards found using lspci and I've set the wireless card to always be on during boot up, so the system discovers it nice and early.

After surfing the forums and googling the days away I can't think of anything else to try.  So far I've tried different versions of drivers, updated portage and re-emerged wireless-tools and ndiswrapper.  Any advice would be very welcome.  Rather than posting all my ifconfig, iwconfig, and dmesg entries I'll just say that the card is found when checking dmesg, I can change the Mode of the wireless card in iwconfig and I can bring the device up and down in ifconfig.  If anyone does want to see specifics, let me know.

I don't think its the cause of the issue but when I run iwlist wlan0 scan it throws up a warning about wlan0 recommending version 18 of Wireless Extension but has been compiled with version 17.  Anyone know what to do about this?

Thanks in advance!

- Nate

----------

## kabage

Did you do the /etc/conf.d/wireless ?   If not do that there may be a conflict there including, (in the wireless.example some documentation on how some wifi's need to scan in Ad-hoc mode before going managed) any way check it out.

Somethings I found it IS possibe to bring a connection up with ifconfig (and not be connected)  if ifconfig is showing your wlan0 and got a dhcp address then it should be working for instance here is mine at the moment

```
wlan0     Link encap:Ethernet  HWaddr 00:14:A5:06:5F:9A

          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::214:a5ff:fe06:5f9a/64 Scope:Link

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1061 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1036 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:937020 (915.0 Kb)  TX bytes:157255 (153.5 Kb)

          Memory:c0200000-c0201fff

```

The inet addr: is the key to my connection if it doesnt have that  check your access point and turn on dhcp 

server or do the manuel setup to give your laptop an address (of course that would screw up scanning 

for hotspots I believe.)

I hope you find the answer here. Good luck 

PS I am using 64bit ndiswrapper with an acer driver for my gateway broadcom 4318

I get the same thing about wireless extentions but there doesnt seem to be anything newer for amd64 in portage, maybe a latest vanilla kernel with cvs wireless-tools would bring it up to date

----------

## m0rd0

I did take a look at conf.d/wireless but i basically left it alone as I wanted to make sure all the settings i used were correct.  Here's what I've been doing to get it all up and running.  I don't bother with a DHCP server at home there arn't enough PC's to make it worth my while, and its easier on the firewall script to keep specific IP addy's.

1) After a clean boot I modprobe ndiswrapper and check to see it is indeed listed using lsmod

2) Using iwconfig I check to see if the card has an entry:

wlan0 IEEE 802.g  ESSID:off/any

Mode: Managed    Frequency:2.437 GHz  Access point:  00:00:00:00:00:00

Bit Rate: 1Mb/s

RTS thr:2347 B  Fragment thr:2346 B

Encryption key: off

Power Management:off

Link Quality:100/100  Signal level:56/154  Noise level:0/154

Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

Tx excessive retries:0  Invalid misc:0  Missed beacon:0

I know the access point is transmitting an SSID 'cos I can just turn the wireless on in windows with a static IP address and gateway info and away it goes.  If I try to do that with the laptop I get nada.

3) I make sure the card isn't listed in ifconfig and then type iwlist wlan0 scan.  Which gets me:

Warning:  Drive for device wlan0 recommended version 18 of Wireless Extension, but has been compiled with version 17, therefore some driver features may not be available...

wlan0    No scan results

And thats about as far as I can ever get.  If I manually assign an IP address using ifconfig and set the default gateway it still isn't able to connect.  I'm sure I'm just screwing up here but I can't see quite what it is.  Even if I take it into work and use dhcpcd to try to assign an IP address I get jack.

I really need some help with this.  I've read so many wireless how-to's and forum posts I've completely lost count.

----------

## kabage

*actually try bring it up using 

```
/etc/init.d/net.wlan0 start
```

 first (just a copy of net.eth0)

There are parameters that may need altering in /etc/wireless like scanning in ad-hoc mode before going to 

managed -- setting all the defaults.  I think it should be named to match the above /etc/conf.d/net.wlan0

so the above loads the matching configuration file. 

you might try setting that parameter.  

/etc/init.d/net.wlan0 start   

which at least does whatever configurations, loads the ndis module,  starts dhcpcd if needed

and dhcpcd adjusts the /etc/resolv.conf along with bringingup the device; you did configure that resolv.conf I assume (thats critical) yes?

By the way the only way mine actually connected is with /etc/init.d/net.wlan0 ,  I never could manually turn everything on and get my configured.  Just now I did a ifconfig wlan0 down  then up and though it looked running I had no access, I actually had to net.wlan0 restart  (clever little file there)

----------

## m0rd0

Sorry I've not posted anything since Thursday.  Been caught up with work.  I gave your net.wlan0 suggestion a go and it did seem to do a lot more than playing with iwconfig itself, setting a nickname, etc.  I'll give it a proper go later today and let you know what happens.  

Thanks for your help so far!

----------

## Letharion

My problem is very similiar, however I had no problems using my broadcom bcm4318 with ndiswrapper until a few days ago. When I get home, I see I have forgotten to plug the laptop in to AC, so while I've been gone, the computer has died.

Starting it up again I can't get an ip anymore from the router, nor can I scan.

I get the same error message while scanning. "Driver for device wlan0 recommend version 18........." and then no scan results.

```
Ifconfig wlan0 up
```

doesn't really make anything happen

```
dhcpcd -d wlan0
```

gives

```
dhcpcd: MAC address = 00:0e:9b:c5:c9:00
```

and after a minute or so it exits.

I tried to cp net.eth0 and I do

/etc/init.d/net.wlan0 start

```

*Starting wlan0

*  Configuring wireless network for wlan0

*  Failed to configure wireless for wlan0

```

I have set up /etc/conf.d/wireless, however I didn't use this before I got the problem, and it doesn't seem to make a difference.

I have had this problem before, when I accidently have pressed the button at the front of the computer which have turned the card off, but not on. This however has always for some reason solved itself within a day or two, now it's been almost a week. I read this topic about the button, but I don't quite understand it.

----------

## Letharion

bump...  :Smile: 

----------

## UberLord

 *Letharion wrote:*   

> 
> 
> Starting it up again I can't get an ip anymore from the router, nor can I scan.
> 
> I get the same error message while scanning. "Driver for device wlan0 recommend version 18........." and then no scan results.

 

You'll probably need to resolve that issue before things work again.

Try re-emerging wireless-tools

----------

## Letharion

 *UberLord wrote:*   

>  *Letharion wrote:*   
> 
> Starting it up again I can't get an ip anymore from the router, nor can I scan.
> 
> I get the same error message while scanning. "Driver for device wlan0 recommend version 18........." and then no scan results. 
> ...

 

Don't understand what the "driver for device wlan0" is then..,.

I tried re-emerging wireless-tools, first x86, and then ~x86, same error message, back to stable again, no change. 

But isn't it odd that it worked for weeks with this problem, and now doesn't?

I'm beginning to wonder if my card might be broken, would it still show up in lspci then? Cause it's there.

----------

## UberLord

Also try re-emerging your wireless driver

----------

## Letharion

I removed the driver installed with ndiswrapper, re-emerged ndiswrapper, re-downloaded the driver and installed it again. Same error message and no scan results.....

I'm beginning to fear that for some extremely unlikely reason my card is dead.

----------

## metalhedd

same error here  (the Version 17/18 thing) after upgrading ndiswrapper to 1.2 (from 1.1-r1). I can't revert as there are no ebuilds for 1.1-r1 anymore.

The connection seems to be alot slower now too. I can't prove it, but it takes a long time to look up hostnames and it never did before.

----------

## m0rd0

Hi,

Sorry for the lack of updates, work's been keeping me busy.  However as of 10 minutes ago I have wireless working!

First of all, the error message stating an issue with version 17 instead of 18, doesn't cause any problems with me.  It still appears but as I've got wireless working (I'm using it right now!) I'm guessing its just a verbose warning with no real impact.

I think the problem's I've encountered all stem from the fact there is plenty of documentation on how to get your system to recognise your wireless card, and how to battle through the ndiswrapper issues, but almost nothing on configuring it.  I have an LFS (Linux From Scratch) box running as my access point and that took me all of 5 minutes to configure, the config files were straight forward and easy to get through.  Ok, so I set it up over a year ago with the minimum of attention i needed to get it running, but the config files were nothing like I'm seeing with the Gentoo packages.  The one's that came with Gentoo were just too much data and not enough explanation, which is rare for Gentoo.  Normally you can guarantee that there will be a Gentoo document on pretty much any setup / problem / issue / hardware conflict you'll ever come across.  Maybe everyone else found the wireless setup a breeze?

Anyway, here are the very minor changes I made to finally get it all working.

conf.d/wireless - I just added the line :

preferred_aps=("rio.net") - rio.net being the essid for my box here.

conf.d/net.wlan0 - I added two lines here : 

config_wlan0=("192.168.1.51 netmask 255.255.255.0")

and

routes_wlan0=("default gw 192.168.1.99")

The wireless entry allowed me to change the ESSID.  Why I can't do this from the command line with iwconfig wlan0 essid rio.net is beyond me.  The net.wlan0 entries are fairly obvious and very easy for me as everything on my wireless network uses static IP's, the real test will come tomorrow when I try to access the wireless network from my desk.  HP like to keep their networks majorly locked down, so if I can get it all working with DHCP and get it through any connection problems I'm golden.

One last thing, obviously I have literally just got this working so its pretty much held together by sticky tape and string....in a config file sense, so the last line from net.wlan0 didn't seem to set the gateway properly, I had to manually set the gw with route add default gw 192.168.1.99.  After that I could access the internet perfectly.

Well I hope that helps someone.  I'll tidy it all up, try to make sense of some of the entries I've thrown into various files and weed out the useful one's (No easy task after months of 5 minute efforts).  I'll post an update tomorrow after/if I've got it working from my desk.

- m0rd0

----------

