Wifi port issue (all works except the backend)

by brucelee » Sat, 19 Mar 2011 08:36:41 GMT

Sponsored Links
 hey, am having a small problem with porting wifi to a my device.

This is my config:

wifi.c (in libhardware_legacy)
    static const char IFACE_DIR[]           = "/data/misc/wifi/
    static const char SUPP_CONFIG_TEMPLATE[]= "/system/etc/wifi/
    static const char SUPP_CONFIG_FILE[]    = "/data/misc/wifi/


    mkdir /data/misc/wifi 0770 wifi wifi
    chmod 0770 /data/misc/wifi
    chmod 0660 /data/misc/wifi/wpa_supplicant.conf
    chown wifi wifi /data/misc/wifi/wpa_supplicant.conf

    mkdir /system/etc/wifi 0770 wifi wifi
    chmod 0770 /system/etc/wifi
    chmod 0660 /system/etc/wifi/wpa_supplicant.conf
    chown wifi wifi /system/etc/wifi/wpa_supplicant.conf

    # wpa_supplicant socket (unix socket mode)
    mkdir /data/misc/wifi/wpa_supplicant 0771 wifi wifi
    chmod 0771 /data/misc/wifi/wpa_supplicant
    chown wifi wifi /data/misc/wifi/wpa_supplicant

    service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -
ieth0 -c /system/etc/wifi/wpa_supplicant.conf
    group system wifi inet


- Wifi driver/module loads properly (wifi.c, dmesg, iwconfig say so)
- Logcat reports:
    WifiHW: Unable to open connection to supplicant on "eth0": No such
file or directory (~ 4 times then unloads wifi)
- Manually loading the driver/module and
    > running wpa_supplicant (as the service above) gives not errors &
proper logcat
        although it does make this dmesg entry:
            <4>[735, wpa_supplicant] [ 1479.081526] Enter
            <4>[735, wpa_supplicant] [ 1479.081567] Exited

    > running 'wpa_cli -p /data/misc/wifi/wpa_supplicant' gives
        Selected interface 'eth0'
        Could not connect to wpa_supplicant - re-trying
    and forever remains this way

    > running 'iwlist scan' works and shows wi-fi networks

My guess would be that my permissions are wrong, but i have been
double checking with 'ls -l' and they seem ok.
The wpa_supplimentary socket 'eth0' does get created so it exists.
My guess would be that the android wifi backend runs as a specific
user other than wifi!?


Other Threads

1. Why ADB and DDMS cannot recognize my phone in Ubuntu?

I am trying to connect my Acer Liquid with ADB and DDMS under Ubuntu
I read some posts and already add the VID (0502) and PID(3202) in /etc/
but adb devices still list my phone's name as question mark

When I try DDMS, I got the following error:
E/DDMS: device (????????????) request rejected: device not found

Is there something I missed?


2. Determine in browser whether app is installed

An intent filter in my app handles a certain MIME type to start the
application from the browser with certain arguments.  I have this
working perfectly.

Currently I have a Javascript confirm that pops up to ask the user
whether the app is installed.  The OK button runs the app by launching
with an intent.  The Cancel action sends the user to the APK file to
download.  Both work just fine.

I would like to get rid of the Javascript confirm and automatically
detect whether my app is installed.

I was hoping I could instantiate the package manager, or something
like it, in Javascript so that I could check if my app is installed.
This doesn't seem possible.

Alternatively, I was hoping the installation of my app could alter the
browser's user agent string to indicate that my app is installed.  If
seen several Firefox add-ons that do this.  This doesn't seem possible

I don't want to start my own WebView or anything.  I want it to be
launchable through anywhere in android.

Any ideas?

I found a similar question here, but it got no response:

3. binding widgets with AppWidgetManager.bindAppWidgetId

4. Wevservices (WS-*) with Android using DPWS

5. Android Browser Application Server Connectivity

6. startActivityForResult error

7. Can't Use Color Resource Element!