Wi-Fi porting issue

320 views
Skip to first unread message

Marlon Smith

unread,
Oct 17, 2014, 6:27:50 PM10/17/14
to android...@googlegroups.com
Hi everyone,

I'm trying to get Wi-Fi working on a custom board running an i.MX6 processor and Android KK.  The driver I need to use is rt2800usb.  I've gotten to the point where I can connect to an access point manually using wpa_cli, but the Android GUI will not list networks or let me connect to any.  Here's what I've done:

BoardConfig.mk:

BOARD_WLAN_DEVICE               := wlan0
WPA_SUPPLICANT_VERSION               := VER_0_8_UNITE
WIFI_DRIVER_MODULE_PATH               := "/system/bin/wifi/rt2800usb.ko"
WIFI_DRIVER_MODULE_NAME               := "rt2800usb"
WIFI_DRIVER_MODULE_ARG                := ""
TARGET_KERNEL_MODULES := \
   kernel_imx/net/wireless/cfg80211.ko:system/lib/modules/cfg80211.ko \
   kernel_imx/net/mac80211/mac80211.ko:system/bin/wifi/mac80211.ko \
   kernel_imx/drivers/net/wireless/rt2x00/rt2x00lib.ko:system/bin/wifi/rt2x00lib.ko \
   kernel_imx/drivers/net/wireless/rt2x00/rt2800lib.ko:system/bin/wifi/rt2800lib.ko \
   kernel_imx/drivers/net/wireless/rt2x00/rt2x00usb.ko:system/bin/wifi/rt2x00usb.ko \
   kernel_imx/drivers/net/wireless/rt2x00/rt2800usb.ko:system/bin/wifi/rt2800usb.ko
BOARD_WPA_SUPPLICANT_DRIVER           := WEXT

init.rc:

service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -d -B wlan0
    group system dhcp
    disabled
    oneshot

service wpa_supplicant /system/bin/wpa_supplicant \
    -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
    class main
    group system wifi inet dhcp
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

I saw someone comment in another post that they needed to modify wifi.c so that Android could talk to the drivers/wpa_supplicant properly, but they didn't include any details.

Does anyone know why Android can't tell that Wi-Fi is actually working?

Thanks

Marlon

Andrew Esh

unread,
Oct 20, 2014, 1:47:09 PM10/20/14
to android...@googlegroups.com
I use wpa_supplicant a lot to connect with Android, and I'm doing development, so I monitor what the Android side is doing over Wifi. For IP address assignment on the Linux testbed I am using, I use dhclient, only because it came with Ubuntu 12.10. (I have used dhcpcd on other Linux distros.) On the Android side I use everything stock KitKat 4.4.1, and I regularly monitor wpa_supplicant with wpa_cli to see the discovery state and P2P peers list.

Are you using stock Android outside of the addition of your device driver, or did you also supply your own version of wpa_supplicant? You showed init.rc below. Are those changes you made, or is the setup of wpa_supplicant and dhcpcd set as it is within stock Android? Did you make any changes to wpa_supplicant.conf? Do you see the devices you expect to in the output of "p2p_peers" in wpa_cli?

Marlon Smith

unread,
Nov 4, 2014, 6:06:15 PM11/4/14
to android...@googlegroups.com
Thanks for the reply Andrew.  I got pulled off this project and am just getting back to it now.

I added some debug output in wifi.c, and it looks like it's able to open a connection to wpa_supplicant, although it seems to fail once and succeed the second time.

To answer your questions:

- I'm using the version of wpa_supplicant that came with Android (I'm using the Wandboard SDK 4.4.2).
- I added the dhcpcd section in init.rc.  I also changed the wpa_supplicant section to use wext instead of nl80211.
- I haven't made any changes to wpa_supplicant.conf as it looked correct for my use
- I'm not using p2p.  But I can run scan and scan_results in wpa_cli and they both work correctly.

Marlon
Reply all
Reply to author
Forward
0 new messages