This document provides helpful tips for enabling WLAN in Android ICS of Samsung LT Origen board. Android ICS started to support SoftAP, WIFI Direct (WLAN P2P), but the open source driver of AR6003 revison 2 used in Origen does not support this features. I am not sure whether AR6003 supports those features

Android WLAN Configuration

There are two stepss to configure Android WLAN for both static (compiling time) and runtime

Android init script (static)

Prepare filesystem for WIFI with “init.rc”

# give system access to wpa_supplicant.conf for backup and restore

  mkdir /data/misc/wifi 0770 wifi wifi
  mkdir /data/misc/wifi/sockets 0770 wifi wifi
  mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
  chmod 0660 /data/misc/wifi/wpa_supplicant.conf
  mkdir /data/misc/dhcp 0770 dhcp dhcp
  mkdir /data/misc/wifi/hostapd 0770 wifi wifi

Declare interface name for WIFI on boot

# for Wi-Fi

 setprop wifi.interface wlan0

Register service of Supplicant

service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf

service dhcpcd /system/bin/dhcpcd -BKL wlan0

Run insmod wlan at booting time (Optinal)

If you plan to execute wlan at booting time,

Please keep mind that you should comment out WIFI_DRIVER_MODULE_PATH in

  • hardware/libhardware_legacy_wifi/wifi.c

and then add

  insmod /system/wifi/ath6kl.ko

Supplicant Configuration (static)

if you run "cat wpa_supplicant.conf", you can see

ctrl_interface=DIR=/data/misc/wifi GROUP=wifi

Operation of Supplicant (runtime)

Control interface to wpa_supplicant

wpa_supplicants uses socket based communications; Unix Domain Sockets and UDP sockets. So always make sure that there are sockets necessary to communicate between wpa_supplicant and Android or wpa_cli.

socket creation by Android

ctrl_interface is the directory path which will have socket under itself. If it has no absolute path, it will be based on current directory of wpa_supplicant.conf file at the runtime. R

socket made by wpa_supplicant

Pleae pay attention to "wlan0" srwxrwx , which "s" means socket.

#Directory: /data/misc/wifi

drwxrwx--- wifi     wifi              2012-01-04 09:33 sockets
drwxrwx--- wifi     wifi              2007-01-01 01:02 wpa_supplicant
drwxrwx--- wifi     wifi              2007-01-01 01:02 hostapd
-rw-rw---- system   wifi              933 2011-12-31 12:50 wpa_supplicant.conf
-rw-rw---- system   wifi              132 2011-09-09 00:40 hostapd.conf
srwxrwx--- wifi     wifi              2012-01-04 09:33 wlan0

sockets made by Android wifi layer

You can see control and monitor sockets, which is made by Android

#Directory:  /data/misc/wifi/sockets

srw-rw----system   wifi              2012-01-04 09:33 wpa_ctrl_161-5
srw-rw----system   wifi              2012-01-04 09:33 wpa_ctrl_161-6

How to debug Android

Android provides DDMS (Dalvik Debug Monitor Service). so we can use DDMS to filter out WIFI related debug message.

Using DDMS

The following sections describe how to use DDMS to get WIFI debuggin information.

  • Please pay attention to filter window :tag:wifi or tag:wlan

  • ddms_wifi.png

How to debug WIFI JAVA class

If you are not sure which JAVA class want to see log message,

In any WIFI JAVA class of the following files, Please enable the following variable:

private static final boolean DBG = true;

Android WLAN Files Please have a look at WLAN in Android ICS:

-frameworks/base/services/java/ base/wifi/java/android/net/wifi/

How to debug Supplicant

In order to verify whether Supplicant works or not , sometime you need to run Supplicant manually.

Please delete old /data/misc/wifi/wpa_supplicant.conf. This is becasue the configuration file will be freshly copied into this directory again by the name of Android file “wifi.c”. Supplicant will call internally ‘ifconfig wlan0 up’ and then make socket

Check permission about the file wpa_supplicant.conf

$ chmod 0771 wpa_supplicant.conf
$ chown wifi.wifi wpa_suppicatn.conf

Run Supplicant manually

$ /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd &

Please do check whether you have a proper main socket for WLAN driver.

 $ ls -l /data/misc/wifi/wlan0

Run wpa_cli to verify Supplicant

Once you run Supplicant, then you can execute ‘wpa_cli’ Option to -p is directory not socket $wpa_cli -p /data/misc/wifi

## if you have socket under the directory "/data/system/wpa_supplicant"
##   root@android:/ # wpa_cli -p /data/system/wpa_supplicant

root@android:/ # wpa_cli -p /data/misc/wifi/
wpa_cli v0.6.10
Copyright (c) 2004-2009, Jouni Malinen <> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.

Selected interface 'wlan0'

Interactive mode

> scan

<2>CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00
<2>CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00
> scan_results
bssid / frequency / signal level / flags / ssid
e0:91:f5:71:31:86       2412    217     [WPA2-PSK-CCMP][WPS]    Linaro
e0:46:9a:82:69:b9       2412    211     [WPA2-PSK-CCMP][WPS]    LAVA
00:26:5a:83:65:ad       2437    169     [WPA2-PSK-TKIP-preauth] metropolis
b0:e7:54:4f:6d:59       2462    192     [WEP]           BTBusinessHub-096
98:fc:11:84:27:1d       2462    233     [WPS]           Cisco10772
b0:e7:54:4f:6d:5c       2462    192                     BTOpenzone
<2>CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00

Update hardware control file:wifi.c

"wifi.c" is the key file which is in charge of

  • Load/Unload WLAN driver
  • Start/Stop Supplicant
  • Make sockets for monitor or control

You should update this file based on your own configuration

# Open hardware/libhardware_legacy/wifi/wifi.c

#define WIFI_TEST_INTERFACE                      "wlan0"
static const char IFACE_DIR[]           = "";
static const char SUPP_CONFIG_TEMPLATE[]= "/data/misc/wifi/wpa_supplicant.conf";
static const char SUPP_CONFIG_FILE[]    = "/etc/wifi/wpa_supplicant.conf";
  • WIFI_TEST_INTERFACE : The interface name between wpa_supplicant and upper JAVA layer.
  • SUPP_CONFIG_TEMPLATE : The template file of wpa_supplicant config.
  • SUPP_CONFIG_FILE : The wpa_supplicant configuration file which will be used while wpa_supplicant is running and all runtime configuration will be saved to this place.


Creating socket at Android Init

You can create socket at Android init with service class. Please pay attention to the below socket in th

service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd
    socket wpa_wlan0 dgram 660 wifi wifi

wpa_wlan0 is a unix domain socket and and named /dev/socket/wpa_wlan0 and pass its fd to wpa_supplicant.

$ ls -al /dev/sockets/wpa_wlan0

Launch shell application

How to run SETTINGS menu

Sometimes, you need to lauch application in adb shell. Please take a look at the following example.

adb shell> am start -a android.settings.SETTINGS

How to use Wireless Tools

You can use precompiled binary for Android ICS 4.0 :

Please click here !! iwconfig, iwlist, libiw.a

or you can use to compile Wireless Tools


OS Kernel: Linaro Linux® 3.0.2

Android: Linaro Android ICS 4.0

WLAN Driver Version: ath6kl open source

Hardware: Samsung Exynos Cortext A9 Dual Core


Linaro Samsung Landing Team


-Init: 06/01/2012, Sangwook


Resources/HowTo/SamsungWlanInOrigenAndroid (last modified 2012-01-06 17:17:42)