How to add wireless interface on Android

I’m configuring Android to add support to wireless adapter. Unfortunately it is not easy as it is on Linux. Let walk through the process:

I started compiling Linux kernel with support to my wireless adapter RT73, basically my kernel has:


Other big mistake was the firmware path, in Linux kernel it is placed at /lib/firmware. I lost some time to figure out the right place it /etc/firmware:

$ adb push rt73.bin /etc/firmware/

After than I try to start-up wifi on Android shell this way:

# netcfg wlan0 up

Arggg, “no donuts for you” 😩

Finally I found more some nice tips here:

Again, more issues, wpa_supplicant binary doesn’t exist. After a little more researches I found the problem: I need to inform to it be build: Edit external/wpa_supplicant/ and modify:


Compile Android again.

Create a wpa_supplicant.conf (in fact just modify the ti_wlan0 one) adding your wireless interface (wlan0 in my case):


Connect in your AP:

# wpa_cli ... set_network 0 ssid "your_ap_name"
#wpa_cli ... set_network 0 key_mgmt WPA-PSK
#wpa_cli ... set_network 0 pairwise CCMP TKIP
#wpa_cli ... set_network 0 psk "makemeveryverysecret"

Configure route and DNS:

# route add default gw dev wlan0
# setprop net.dns1

An useful thread about this topic is here:


When trying to turn Wi-Fi ON using Android setting, I was getting this error message:

"unable to start Wi-Fi"

Then using “adb logcat” I can see the error:

"E/WifiService( 1935): Failed to load Wi-Fi driver"

Then I figured out the issue, Android wants loads the driver by itself, because I place the driver built-in into kernel, it will work at console, but will not work on graphic mode.

I saw some people suggesting adding it on init.rc:

setprop wlan.driver.status "ok"
setprop init.svc.wpa_supplicant "running"

Unfortunately it didn’t worked to me.

Then I changed the wifi driver to module on Linux kernel and modified “hardware/libhardware_legacy/wifi/wifi.c” to load that driver for me:

#define WIFI_DRIVER_MODULE_PATH         "/system/lib/modules/rt73usb.ko"
#define WIFI_DRIVER_MODULE_NAME         "rt73usb"

Also I copied the modules files (rt2x00lib.ko, rt2x00usb.ko, rt73usb.ko) to “/system/lib/modules” and called insmod to them in init.rc

UPDATE: Nicu Pavel created a great tutorial explaining more about Wireless on Android:

7 thoughts on “How to add wireless interface on Android

  1. Hi,
    I am trying to do something similar to you, in that I am trying to port the p54 drivers over to Android. I am using a USB dongle, so in the kernel I enabled the appropriate driver. I have 2 questions.

    1.) why did you include the rt200xx driver in the kernel configuration? is this required for all usb dongles, or just specifically for the driver you are using?

    2.) you mentioned that you pushed the “rt73usb.ko” file to the android filesystem using adb. where did the rt73usb.ko file reside on your computer? i did a search for all files with a .ko extension but I couldn’t find p54usb.ko


  2. Hi Kiran,

    You need to include RT2X00 driver because it is prerequisite to RT73. I did a mistake, I need to select RT73 as module (CONFIG_RT73USB=m) instead of built-in.

    In you case you need put P54 as module in order to generate .ko.



    1. Hi Alan,
      Thanks for responding so quickly. I compiled the kernel w/ p54 as a module (it shows M instead of *), and in the help option in the kernel, it says that the module will be called p54usb. I can’t find the p54usb.ko file though… Is it bundled inside the uImage?

      Thanks again!

      1. Hi Kiran,

        I reproduced it here and I found the module file at:


        Make sure you select these items are selected in your .config:

        Best Regards,


  3. Hey Alan,
    Thanks again for helping out. I had a mistake in my kernel configuration, as I was trying to build P54_COMMON as a module as well the P54_USB. I changed P54_COMMON from ‘m’ to ‘y’. I tried recompiling, and didn’t notice the kernel modules.

    I then decided to compile the kernel without the uImage option at the end. By default, the makefile is creating a zImage, and when I checked the drivers/net/wireless/p54 folder, i saw the p54usb.ko file. I tried investigating in the makefile, but am relatively new to makefiles and linux in general so I didn’t understand too much.

    Finally, I decided to make the kernel with the uImage option as:
    make ARCH=arm CROSS_COMPILE=arm-eabi- -j8 uImage
    After this, I found the make modules command on the internet and did that:
    make ARCH=arm CROSS_COMPILE=arm-eabi- j8 modules

    This created all the kernel modules.

    Anyways, thanks a lot for helping me out. Hopefully I can get this wifi off the ground soon!

  4. I want to connect to my smartphone und an wifi sensor node.(using an App).
    i want to read data from sensor node.
    do you have any idea how to find/connect other devices on a WiFi network ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s