Enable wpa_supplicant in the build

Add the following lines into BoardConfig.mk for the device and rebuild it.(http://review.android.git.linaro.org/#patch,unified,175,4,BoardConfig.mk)

WPA_SUPPLICANT_VERSION := VER_0_6_X

BOARD_WPA_SUPPLICANT_DRIVER := WEXT

WIFI_DRIVER_MODULE_PATH := "/system/modules/modulename.ko"

WIFI_DRIVER_MODULE_NAME := "modulename"

NOTE: Firmware needed by the driver should be placed at /system/etc/firmware/

Boot the device with the above build and then the wpa_supplicant and wpa_cli tools will be available from command line.

The procedures given below are steps how I verified wifi driver on Linaro Android build with wpa_supplicant from command line on Panda board and Samsung Origen board.

# mkdir /data/system/wpa_supplicant

# mkdir /data/misc/wifi/

# chown wifi.wifi /data/system/wpa_supplicant

# chown wifi.wifi /data/misc/wifi/

# mkdir /data/misc/wifi/sockets

# chown wifi.wifi //data/misc/wifi/sockets

# echo "ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi" > /data/misc/wifi/wpa_supplicant.conf

# echo "update_config=1" >> /data/misc/wifi/wpa_supplicant.conf

# echo "ap_scan=1" >> /data/misc/wifi/wpa_supplicant.conf

#chown wifi.wifi /data/misc/wifi/wpa_supplicant.conf

# insmod /system/modules/wl12xx_s* (Insert all the modules needed by wifi)

# wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd &

# wpa_cli -p/data/system/wpa_supplicant/

wpa_cli v0.6.10

Copyright (c) 2004-2009, Jouni Malinen < j@w1.fi > 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

OK

> scan_result

bssid / frequency / signal level / flags / ssid

a0:21:b7:a8:33:b6 2412 211 [WPA-PSK-TKIP][WPS] NETGEAR

>

>

> add_n

1

> remove_n 1

OK

> set_n 0 ssid "NETGEAR"

OK

> set_n 0 key_mgmt WPA-PSK

OK

> set_n 0 psk "simplepassword"

OK

> enable_n 0

OK

>

> status

bssid=a0:21:b7:a8:33:b6

ssid=NETGEAR

id=0

pairwise_cipher=TKIP

group_cipher=TKIP

key_mgmt=WPA-PSK

wpa_state=COMPLETED

> q

#

#

# netcfg

lo UP 127.0.0.1 255.0.0.0 0x00000049

eth0 UP 0.0.0.0 0.0.0.0 0x00001043

wlan0 UP 0.0.0.0 0.0.0.0 0x00001043

# netcfg wlan0 dhcp

# netcfg

lo UP 127.0.0.1 255.0.0.0 0x00000049

eth0 UP 0.0.0.0 0.0.0.0 0x00001043

wlan0 UP 10.0.0.3 255.255.255.0 0x00001043

#

Integration of Wifi into Android HAL

Once wifi is verified from Command prompt .The above changes need to reflect in the init.<board>.rc.

Steps listed Below .

  1. Enable wpa_supplicant in the build.Please note ${WIFI_DRIVER_MODULE_PATH} and ${WIFI_DRIVER_MODULE_NAME} should be set correctly for android HAL to load and unload the driver when wifi is turned on and off respectively (http://review.android.git.linaro.org/#patch,unified,175,4,BoardConfig.mk).This should be already done while testin wifi on command line.

  2. Build should copy a refernce wpa_supplicant.conf file into /system/etc/wifi/ .This conf file taken as reference for creating a wpa_supplicant.conf at /data/misc/wifi/.(http://review.android.git.linaro.org/#patch,unified,175,4,AndroidBoard.mk)

  3. Place a reference wpa_supplicant.conf file which whould get copied by above step.(http://review.android.git.linaro.org/#patch,unified,175,4,wpa_supplicant.conf)

  4. Moify the init.<board>.rc file to create the directories needed by wpa_supplicant and set the wifi.interface property correctly else wifi operations will fail .(http://review.android.git.linaro.org/#patch,unified,175,4,init.omap4430.rc and http://review.android.git.linaro.org/204 )


CategoryAndroidTips

Platform/Android/WifiIntegration (last modified 2013-08-29 09:13:15)