Ubuntu, wireless, ndiswrapper

  • Thread starter Fredrik
  • Start date
  • #1
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
412
I decided to use an older computer that's been collecting dust for a few years to learn some Linux, so I wiped the drive and installed Ubuntu. I recently bought a new wireless network card with a USB connection, and I decided to use it with this computer. I found some instructions online and followed them. Short version:

1. Install ndiswrapper.
2. Tell ndiswrapper to use the Windows XP driver for the network interface card.
3. Tell the Linux kernel to use ndiswrapper.

This worked out great, but when I rebooted I no longer had a wlan0 interface. The only solution I've found is to physically disconnect the network card and then plug it back into the USB port. Is there anything I can do to not have to do that every time I start up the computer? Maybe I can tell Ubuntu to "forget" the hardware attached to that USB port and then rediscover it?

I'm writing this on my laptop. I will go to the other computer and add a few more details from there.


Edit: OK, this is weird. I was sure that I tried this yesterday and it didn't work, but now I'm starting to doubt that. When I had started up the computer and logged in, lsmod | grep ndis gave me no hits, so ndiswrapper wasn't installed in the kernel. So I ran sudo modprobe ndiswrapper, and the network started working immediately. I must have tried that several times yesterday. Maybe I'm just going crazy.

OK, let's assume for the moment that all I have to do is to make sure that the linux kernel uses ndiswrapper even after reboots. How do I do that? Do I have to run sudo modprobe ndiswrapper (and somehow provide my password) from a script, or is there a better way?
 
Last edited:

Answers and Replies

  • #2
trollcast
Gold Member
280
13
Edit /etc/modules and add ndiswrapper on a newline at the end of the list of modules. Whenever the computer boots it should then load ndiswrapper by default.
 
  • Like
Likes 1 person
  • #3
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
412
Thanks. I just tried it, and it works like a charm. The message that said that I was connected to the network showed up before I even logged in.

Unfortunately there's another problem. A few hours ago I noticed that wlan0 seemed to think that it was still connected to the network, but the router disagreed (and no communication was possible). Maybe the driver or the card isn't working as well as I thought. I guess I'll see if this problem comes back.
 
  • #4
trollcast
Gold Member
280
13
Try
Code:
lshw -C Network
That will display the configuration of your network interface. One of the lines should start with "configuration:" on that line look for the "driver=" and "module=". If theres a driver and module listed thats not ndiswrapper then another driver might be trying to control the card.

If there is another driver trying to claim the card then you need to blacklist it. Open /etc/modprobe.d/blacklist and add a new line to the bottom of the file like:

Code:
blacklist modname
where modname is the name of the driver.

Then restart your computer and see if thats fixed it.
 
  • #5
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
412
Great tips. I'm learning some useful stuff here. There's nothing funny in the output now (except that the card is running 802.11g, even though it's supposed to support 802.11n), but everything is working fine at the moment. I'll check again if things stop working.
 
  • #6
trollcast
Gold Member
280
13
EDIT: I didn't read your last post carefully enough. If the card is in 802.11g then this method probably won't work since the highest speed it'll support is 54Mb/s

Try using
Code:
iwlist wlan 0 bitrate
to show the supported rates for your adapter. If the current rate is less than the supported use
Code:
iwconfig wlan0 XM auto
where X is the new speed in megabits. auto means the card will use the highest possible rate up to X (this means the rate can lower if your signal quality decreases) Then reboot your computer.
 
  • Like
Likes 1 person
  • #7
Fredrik
Staff Emeritus
Science Advisor
Gold Member
10,851
412
The card is supposed to support speeds up to 300 Mbit/s. These are the relevant parts of the output of some of the commands you mentioned: (several lines omitted from each output)
Code:
sudo lshw -C Network

       configuration: broadcast=yes driver=ndiswrapper+bcmwlhigh5 driverversion=1.59+Cisco Consumer Products LLC ip=192.168.1.196 link=yes multicast=yes wireless=IEEE 802.11g


iwlist wlan0 bitrate

wlan0     4 available bit-rates :
	  6 Mb/s
	  9 Mb/s
	  12 Mb/s
	  18 Mb/s
          Current Bit Rate:78 Mb/s [B]<--- LOL[/B]
It's not super important that we settle the g/n issue right now. On the other hand, if it's super easy for you, I don't mind being told the solution, or just what's going on here. (The card appears to be working in 802.11g mode, which only supports 54 Mbits/s, and is still set to 78 Mbits/s...I don't get that at all).

I have two networks configured on the router. The "foo" network is advertised and supports 802.11 n,g and b. The "bar" network is not advertised and supports only 802.11n. I will try to figure out how to connect to "bar" instead of "foo".

Edit: It was easy to figure out how to connect to it. I just had to click on the network symbol at the top and choose "connect to hidden wi-fi network". But it failed. Then I checked the router configuration. It turned out that the network wasn't hidden. I remembered that wrong. It's marked as "visible", just as the "foo" network. So it should show up in the list of networks, but it doesn't. No time to think about that now. I have to go to bed.
 
Last edited:

Related Threads on Ubuntu, wireless, ndiswrapper

  • Last Post
Replies
5
Views
11K
Replies
6
Views
3K
  • Last Post
Replies
17
Views
2K
  • Last Post
Replies
10
Views
1K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
12
Views
27K
Replies
5
Views
1K
  • Last Post
Replies
10
Views
2K
Top