Wireless USB Dongle Configuration Guide - XBMC Live

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
elitegm Offline
Junior Member
Posts: 22
Joined: Jun 2009
Reputation: 11
Post: #1
About 6 months ago I spent hours researching how to do this and got it working 100% stable. Luckily I created this guide soon after. If you have a usb wifi adapter and want to get it working with xbmc live, this should work for you. I recently had to reinstall my entire xbmc live and I followed my guide step by step and it worked without a hitch (but this time I changed from WEP to WPA2). I was sooo glad I made the guide, otherwise this would have been a pita. With this setup I have no issue whatsoever playing full 720 mkv's over the wireless.

Feel free to contribute into making this guide better or add comments. And please definitely let me know if it helped you. I would love to hear that this saved someone else a lot of time.

-------------------------------------------------------
My XBMC Live Setup: Acer Revo 1600 with DLink USB WiFi Dongle (WUA2340)

You must get ndiswrapper installed first:

1. Get XBMC to a terminal (Alt+Cntrl+F1)
2. Make sure you have a hard wired connection to the xbmc live box.
3. From the command prompt type these commands:
sudo apt-get update
sudo apt-get install wicd
sudo wicd-curses

If you get a list of networks, great you should be able to take it from here...

If not (usually the case with a usb dongle), keep going..

4. Install ndiswrapper. ndiswrapper allows you to install windows drivers for a device
running linux. In this case, we want to install windows drivers for our usb dongle on to our xbmc live box.

To install ndiswrapper: sudo apt-get install ndisgtk

5. Download the windows drivers for your device. In my case, it was for my DLink WUA2340

6. You must find a way to get the drivers on to your xbmc box. In my case, I transferred the drivers on to a usb stick and navigated my way to that drive within xbmc terminal (ubuntu terminal) using dir, cd, etc...

Once you are in the directory of your driver files. In my case Drivers/WinXP_2K/
the driver file we are interested in is netA5AGU.inf

Here is an example:
Run command 'sudo fdisk -l' to print the disks and partitions. You should see one that is your USB drive. It will probably be something like /dev/sdb. There may or may not be partition table on the device. If so, you will have a /dev/sdb1 or something like that.

Once you know the device name, you can mount it:

sudo mkdir /mnt/usbdisk
sudo mount /dev/sdb1 /mnt/usbdisk

At that point your files will be in /mnt/usbdisk

navigate to the directory with your drivers in it by typing "cd dir", "cd dir" etc until you are there.
You can always get a list of the files in your current directory by typing "ls".


7. So within that directory we will type: sudo ndiswrapper -i netA5AGU.inf

This will install the drivers on the machine.

Typing sudo ndiswrapper -l should list your driver

8. Reboot

9. Add wlan0 interface:

sudo apt-get install wireless-tools
sudo apt-get install wpasupplicant

then go edit the /etc/network/interfaces

command: sudo nano /etc/network/interfaces

comment out the ethernet so that it reads out like this

#auto eth0
#iface eth0 inet dhcp

and then type

If you are using WEP, do the following (everything in between -----)
------------------
auto wlan0
iface wlan0 inet dhcp
wireless-essid <wireless SSID/ESSID>
wireless-key <your wep key>
------------------

If you are using WPA2 do the following:
------------------
auto wlan0
iface wlan0 inet dhcp
wpa-driver wext
wpa-ssid <your_essid>
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk <your_hex_key>

------------------

To get the wpa-psk, att prompt you need to do: wpa_passphrase <your_essid> <your_ascii_key>

It will give you a long key, you use this key in place of <your_hex_key> above


9. A useful command to see your devices is: lsusb

10. See if you can

11. Check whether ndiswrapper recognizes your wireless card

ndiswrapper won't work until it thinks that your Windows drivers have been properly installed and that they are the appropriate ones for your wireless card. You can run the command:

sudo ndiswrapper -l
..should show something like this:

netwg111 : driver installed
device (0846:4240) present (alternate driver: p54usb)

then ndiswrapper detects your card correctly and believes that you have installed the appropriate Windows drivers for it.

12. Check Machine Architecture: An important caveat to ndiswrapper, and one that many tutorials fail to mention, is that the architecture of the Windows drivers that you use with ndiswrapper needs to match that of your Linux kernel--no exceptions. In other words, if you're running 64-bit Ubuntu, the Windows drivers that you use need to be built for 64-bit Windows. If ndiswrapper -l reports "device present" but you still can't get your wireless card to work, this is the likely culprit--ndiswrapper will still report "device present" even if the Windows drivers are not the right architecture.

If you don't know whether your kernel is 32 or 64-bit, run the command:

Code:
uname -m

13. If the output is 'i686' (or possibly 'i586' or 'i486' on older machines), you have a 32-bit kernel; if it's 'x86_64,' you're using 64-bit. If the output is anything else, you don't have an x86-compatible processor and you can't use ndiswrapper (because Windows doesn't support platforms other than x86).

If you installed Windows drivers built for the wrong architecture, find the appropriate ones and install them (you will need to remove the bad ones first with the sudo ndiswrapper -r driver-name command). Refer to check #1 above for information on locating good Windows drivers.

Keep in mind that for some wireless cards, 64-bit Windows drivers were never released. If this is the case for your device and you want to use a 64-bit Linux kernel, you're probably out of luck. You could complain to your wireless-card vendor and demand 64-bit Windows drivers, or you could check to see if any native Linux driver will support your card. Otherwise, your only option is to switch to a 32-bit kernel.


14. If at this step your wireless is not working, it is okay. It should be, but mine was not either.
So this is what did the trick...

To check whether it's present, run the command:

Code:
lsmod | grep ndis

If the output returns nothing, the ndiswrapper module is not being loaded for some reason. Try running this command to load it:

sudo modprobe ndiswrapper

Then wait a few seconds and see if your wireless card is detected. If so, great; keep reading for steps on making the system load ndiswrapper automatically.

15. Loading ndiswrapper automatically at boot (Only if step 14 is what got it working for you):

In modern versions of Ubuntu, ndiswrapper is supposed to be loaded automatically at boot. Sometimes for various reasons that fails to happen, however. If this appears to be your problem, run this command:


Code:
echo 'ndiswrapper' | sudo tee -a /etc/modulesand the problem should be resolved. This command tells the system explicitly to load the ndiswrapper module while booting, no matter what.


Final Notes: Step 14 and 15 were crucial for me to get this working. Now, it works all the time no problems whatsoever and I am streaming 720p video through my wifi without a hitch. Smile
And this little revo is barely stressed running that. cpu never goes above 50%.

check dmesg output

dmesg prints messages from the kernel. If you've run through all of the stuff above but still can't get ndiswrapper to work, it may be because something weird is going on (e.g., a bug in ndiswrapper or the Windows driver); dmesg should provide some insight into the problem. You can get dmesg information related to ndiswrapper with the command:

Code:
dmesg | grep -e ndis -e wlanNormal output for a working ndiswrapper configuration should look similar to:

Code:
[ 507.517874] ndiswrapper version 1.52 loaded (smp=yes, preempt=no)
[ 507.555668] ndiswrapper: driver net5211 (,05/02/2007,5.3.0.45) loaded
[ 507.969072] ndiswrapper: using IRQ 20
[ 508.055020] wlan0: ethernet device 00:1f:3a:8f:13:96 using serialized NDIS driver: net5211, version: 0x50003, NDIS version: 0x501, vendor: 'NDIS Network Adapter', 168C:001C.5.conf
[ 508.060224] wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK
[ 508.060642] usbcore: registered new interface driver ndiswrapper
[ 508.139154] ADDRCONF(NETDEV_UP): wlan0: link is not ready

Sources:

http://forum.xbmc.org/showpost.php?p=468527&postcount=7
http://ubuntuforums.org/showthread.php?t=885847
http://ubuntuforums.org/showthread.php?t=1425727
http://georgia.ubuntuforums.org/showthre...855&page=3
http://forum.xbmc.org/archive/index.php/t-58975.html

------------------------------------------------------------------

2001 Corvette Z06 Supercharged and self tuned - 638rwhp @ 10psi
(This post was last modified: 2011-02-13 01:03 by elitegm.)
find quote
FishOil Offline
Posting Freak
Posts: 994
Joined: May 2009
Reputation: 14
Post: #2
$9 and 3 min can save you all that headache.
find quote
elitegm Offline
Junior Member
Posts: 22
Joined: Jun 2009
Reputation: 11
Post: #3
FishOil Wrote:$9 and 3 min can save you all that headache.

$9 for ?
find quote
FishOil Offline
Posting Freak
Posts: 994
Joined: May 2009
Reputation: 14
Post: #4
elitegm Wrote:$9 for ?

An inexpensive out of the box supported USB Wireless N 300Mbps adapter.
find quote
elitegm Offline
Junior Member
Posts: 22
Joined: Jun 2009
Reputation: 11
Post: #5
FishOil Wrote:An inexpensive out of the box supported USB Wireless N 300Mbps adapter.

Well you're right, $9 would be well worth not having to do this, but I happened to have this particular usb dongle laying around the house so I set it up and for anyone else who happens to be in the same situation, this guide will get you there with 10 minutes of work.
find quote
X3lectric Offline
Closed Account
Posts: 1,756
Joined: Feb 2006
Location: in a Dropbox
Post: #6
elitegm Wrote:Well you're right, $9 would be well worth not having to do this, but I happened to have this particular usb dongle laying around the house so I set it up and for anyone else who happens to be in the same situation, this guide will get you there with 10 minutes of work.

Never mind about comments from ppl which mainly leech and dont contribute anything worth a read, good post. Othes should follow your lead instead of talking crap.

Continue with good work.
find quote
elitegm Offline
Junior Member
Posts: 22
Joined: Jun 2009
Reputation: 11
Post: #7
X3lectric Wrote:Never mind about comments from ppl which mainly leech and dont contribute anything worth a read, good post. Othes should follow your lead instead of talking crap.

Continue with good work.

Thanks!

2001 Corvette Z06 Supercharged and self tuned - 638rwhp @ 10psi
find quote
sam.vw Offline
Junior Member
Posts: 9
Joined: Dec 2010
Reputation: 0
Post: #8
Thanks for this guide. I will try it out tonight and let you know the results.

My XBMC Live Setup: Acer Revo 1600 with Hercules Wireless N USB Mini (HWNUm-300)
find quote
SpectreX Offline
Senior Member
Posts: 278
Joined: Oct 2010
Reputation: 0
Post: #9
There is a wireless linux manager addon for XBMC in the plugins section of the forum, that can help you out a lot for configuring you WiFi.
find quote
stiggs Offline
Member
Posts: 59
Joined: Sep 2010
Reputation: 0
Post: #10
just used this guide, very helpful thank you
find quote
TDX11 Offline
Junior Member
Posts: 3
Joined: Jun 2011
Reputation: 0
Question   
Post: #11
I'm abhorrently new to Linux, but I think I'm starting to get the hang of it after 8 hours of frustration.

However, I've hit a snag in two places so far.

Firstly, wicd seemed to install perfectly, but the command to run it (sudo wicd-curses) just returned some BS about the command not existing.

I chose to overlook this error and moved on until point 9. The "GNU nano 2.2.2" editor won't let me save. Returns "No such file or directory", which makes no scene to me. How could I be editing something that doesn't exist?

The machine is an HP Presario a420a (AMD Athlon XP) and I'm stuck with an Astone AP-N290 WiFi Dongle.

Advice would be greatly appreciated Smile
find quote
roby1972 Offline
Junior Member
Posts: 2
Joined: Oct 2013
Reputation: 0
Post: #12
hi this guide is workong also for install TP-Link TL-WN823N Mini on xbmcubuntu?
find quote