FORUMS
Remove All Ads from XDA

[GUIDE] Using external USB wifi

107 posts
Thanks Meter: 60
 
By infernix, Senior Member on 7th February 2012, 01:12 AM
Post Reply Email Thread
I got fed up with crappy wireless reception in a hotel and decided to use my RTL8187 based Alfa USB wireless adapter with my Prime. Here's how it works, pretty rough and open to improvement but it works.
  1. Set up a chroot (ubuntu/debian will work); everything is done within that chroot
  2. Compile and install the drivers for your usb adapter (see the Kernel modules thread for instructions)
  3. apt-get install wicd-curses (or wicd-cli if you prefer), wpasupplicant and dbus plus any of its dependancies
  4. Turn off the broadcom wifi that's controlled by android
  5. insmod your modules (in my case eeprom_93cx6.ko, mac80211.ko, rtl8187)
  6. start dbus and wicd (/etc/init.d/dbus start; /etc/init.d/wicd start)
  7. run wicd-curses (or wicd-cli), refresh the network list and connect to your network
  8. configure dns for android to your dns or to googles (setprop net.dns1 8.8.8.8)
  9. ???
  10. Profit

To stop using external usb wifi, reverse the steps; basically:
  1. stop wicd and dbus (/etc/init.d/wicd stop; /etc/init.d/dbus stop)
  2. kill any running dhcp clients (killall dhclient)
  3. rmmod your modules (in my case eeprom_93cx6.ko, mac80211.ko, rtl8187)

To be able to insert mac80211 without it complaining about missing symbols for ewma_init and ewma_add, I had to add lib/average.c to the mac80211 module; it's pretty simple, here's how i did that:
  1. Go to your prime kernel source tree (e.g. /usr/src/linux)
  2. cp lib/average.c net/mac80211/
  3. Edit net/mac80211/Makefile and add average.o to the list of objects for mac80211-y (don't miss the trailing backslash if you add it halfway)

For simplicity sake I've added the modules for an rtl8187 based usb nic to this post. These are built against the 9.4.2.7 kernel source, and work fine for the 9.4.2.11 release (current ICS release as of Feb 07 2012).

Oh and I don't recommend doing this with androids wifi turned on, it kind of breaks it until you reboot your tab. So if you're smart you'll script the above and spit out a nice warning that your broadcom module is still loaded and then exit. I had no problems switching between external USB wifi and built-in wifi as long as I only turned one of them on exclusively.

Enjoy solid wifi on your prime
Attached Files
File Type: zip rtl8187mods.zip - [Click for QR Code] (2.29 MB, 9905 views)
The Following 14 Users Say Thank You to infernix For This Useful Post: [ View ] Gift infernix Ad-Free
7th February 2012, 01:33 AM |#2  
demandarin's Avatar
Senior Member
Flag Alexandria, Va
Thanks Meter: 2,049
 
More
,can you show screenshots of how much of an improvement it was using a USB wifi device vs. Stock wifi. You should relay this info in the kernel modules thread n SaturnDe can probably clean it up or simplify more or make it easier to implement. He could add it to his driver packs and make a new ATP tweaks version. For quick app enabling of this USB wifi method. This is very cool. I really would like to see how much of an improvement in reception thisngives.
The Following User Says Thank You to demandarin For This Useful Post: [ View ] Gift demandarin Ad-Free
7th February 2012, 07:21 AM |#3  
OP Senior Member
Thanks Meter: 60
 
More
You can't use the external wifi together with the android wifi control, it isn't compatible. So screenshots make no sense. This is why you need the chroot and wicd-curses; that's where you configure your wifi connection, not in android.

As for the increase in reception, it depends on your usb adapter. If you have one with an external antenna that is 6 feet long, you can figure out how much of an improvement that would be. Nothing is stopping you from connecting an even bigger wifi antenna if you want. So, reception increase could be anywhere from a few dB up to long range 5km wifi using powerful long range antennas.
The Following User Says Thank You to infernix For This Useful Post: [ View ] Gift infernix Ad-Free
7th February 2012, 04:51 PM |#4  
buxtahuda's Avatar
Senior Member
Flag Cleveland, MS
Thanks Meter: 162
 
More
Quote:
Originally Posted by infernix

You can't use the external wifi together with the android wifi control, it isn't compatible. So screenshots make no sense. This is why you need the chroot and wicd-curses; that's where you configure your wifi connection, not in android.

As for the increase in reception, it depends on your usb adapter. If you have one with an external antenna that is 6 feet long, you can figure out how much of an improvement that would be. Nothing is stopping you from connecting an even bigger wifi antenna if you want. So, reception increase could be anywhere from a few dB up to long range 5km wifi using powerful long range antennas.

Lol, I believe you're being told to do it yourself 'darin. I have a nice little wifi usb adapter, I'll give this all a whirl later on after work.

Certainly not a solution for myself, but a simple workaround for those uncomfortable with modding and who don't mind annoying sticks coming from their tablets/laptops. Not saying anything against this, I just always hated using older laptops with usb adapters and don't see me liking it more on a smaller, more stream-lined device.
8th February 2012, 01:01 AM |#5  
OP Senior Member
Thanks Meter: 60
 
More
Quote:
Originally Posted by buxtahuda

Certainly not a solution for myself, but a simple workaround for those uncomfortable with modding and who don't mind annoying sticks coming from their tablets/laptops. Not saying anything against this, I just always hated using older laptops with usb adapters and don't see me liking it more on a smaller, more stream-lined device.


FWIW, this can also be used to run aircrack or other wifi security analysis tools with, which aren't able to ever run with the builtin broadcom adapter. So it has other uses too
9th February 2012, 01:00 AM |#6  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by infernix

FWIW, this can also be used to run aircrack or other wifi security analysis tools with, which aren't able to ever run with the builtin broadcom adapter. So it has other uses too

Has anyone tried doing so with their ATP? I'd be very interested to know. I've had a bunch of problems with the build-in card in terms of using the bt5 pentest suite so this might potentially solve some of those problems
15th February 2012, 07:20 PM |#7  
Junior Member
Thanks Meter: 4
 
More
Yeap, done with BT5 for arm and ALFA AWUS036H (Rtl8187), apt-get the aircrack tool and bang! : monitoring mode enables



Thanks a lot to the OP for the modules !
The Following User Says Thank You to BiboTheClown For This Useful Post: [ View ] Gift BiboTheClown Ad-Free
20th February 2012, 06:27 PM |#8  
Senior Member
Thanks Meter: 32
 
More
what version of linux are you guys using? I was trying to install wicd-cli and wicd-curses through my bt5 and had no success. wicd-curses just can't install on arm bt5 for some reason stating that some dependant libraries are incompatible. wicd-cli gives me an fopen error during install and then craps out when I try to run it.
The Following User Says Thank You to foboi1122 For This Useful Post: [ View ] Gift foboi1122 Ad-Free
22nd February 2012, 10:28 AM |#9  
Member
Thanks Meter: 37
 
Donate to Me
More
Thanks for the info, one question tho.
Did you have to do anything special to get the wicd client to run, I get the error 'cannot connect to dbus socket' or something to that effect..

I have tried wicd-cli, -curses, and -gtk

Any help would be appreciated.
The Following User Says Thank You to ryun33 For This Useful Post: [ View ] Gift ryun33 Ad-Free
12th May 2012, 05:39 PM |#10  
michaelmotes's Avatar
Senior Member
Thanks Meter: 73
 
More
Dear Sirs,

This may be newbish, but where can I get the source for the kernel modules the op mentioned. I have obtained my kernel source for my phone, but can't seem to find the source I actually need to compile, rtl8187, etc.

Update:
Alright, I found them, they are part of the compat-wireless package. http://www.aircrack-ng.org/doku.php?id=compat-wireless

I still can get it to compile, but I guess I need to learn a little about cross compiling.

I did find a kernel for my device with the modules already built in, used and voila. Cracked a wep key in about 5-10 minutes. I was happy, happy, happy. Then, a ruinous moment occurred. Almost the very second aircrack-ng finished cracking the key, my phone came up with a low battery warning, I was using a awus036h wifi adapter and it was draining my battery fast, I had about 50% to begin and had the 14% warning hit me about 10 minutes in, funny thing is the warning is usually 14%, but this time was 13%, go figure? Anyway seconds after the warning my phone just blanks, turns off. I plug it in and reboot and the battery is at 0% and stuck there, so a word of warning:

An external wifi adapter my require more usb host juice then the battery can safely supply. I have seen people using powered hubs to circumvent draining the phone battery, I would defintiely recommend the practice.
16th May 2012, 11:58 PM |#11  
Senior Member
Thanks Meter: 207
 
Donate to Me
More
Ok, if the last poster was noobish then i dont even know where i would be because i need help just deciphering wtf OP said.

I realize the drivers for each wireless adapter are going to be a little different... because each wireless adapter is different, but can someone translate this into non geek? I dont even know where to begin.

Can this work using the ubuntu/backtrack/linux installers from the market? Ive muddled my way through that and got linux working that way, or is this completely different?
Post Reply Subscribe to Thread

Tags
usb prime, wifi

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes