Wireless USB Dongle Configuration Guide - XBMC Live

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.

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

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>
------------------

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.
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:

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.

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.

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.