This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use my own USB WIFI & USB 3G CARD?

Other Parts Discussed in Thread: AM3517

Hi,

I am testing with am3517evm with "TI Android GingerBread 2.3 DevKit 1.0",  I want to test the wifi and 3g functions in android, so I connect usb wifi card and usb 3g card through usb hub, and the system can recognize wifi card as rausb0 when typing netcfg, but it is down, and android can't reconize it.

So, how to let android recognize my own net card, e.g. USB WIFI CARD or USB 3G CARD?

 

Thanks,

Kevin

  • Hi Kevin,

    you can try with

    # netcfg rausb0 up

    # netcfg rausb0 dhcp ( if dhcp is available for the n/w)

    Also send us logcat....

     

    Note: At preset we do not have support for 3G in our release.

    -

    satish

  • Kevin,

    You can refer to our community forum at http://groups.google.com/group/rowboat to explore this further.

    There is a thread on bringing up a USB based WiFi here http://groups.google.com/group/rowboat/browse_thread/thread/327b53961456eca

     

    -Vishveshwar

  • Hi Satish,

    I currently have a ralink usb card, and it can be recognized as rausb0 under android, I have added the new wifi driver and want to make wifi work in android build 2.3.

    I want to open/close wifi function through android wifi-settings menu,

    I found there are two folders named wpa_supplicant and  and wpa_supplicant_6 in external folder, and there seems to be a ralink driver in wpa_supplicant_6 but not wpa_supplicant.

    And what should I do to let wpa_supplicant recognize my ralink card, and can communicate with the android upper layer app, e.g. wifi-settings.

    I made some changes following the steps at http://www.slatedroid.com/topic/16962-posible-solution-to-wifi-problems/, and now currently access points can be listed, but not work well.

    and my logcat log is attached.

    7840.ralink-logcat.txt

     

     

    Regards,

    Kevin

  • Hi Kevin,

    Could you give more info to analyze the problem ?

    1. Where r u copying your wlan driver.ko file ?

    2. Where r u copying firmware file ?

    3. Also I assume you have done following changes in BoardConfig.mk file and recompile the code

    WPA_SUPPLICANT_VERSION      := VER_0_6_X
    
    
    4. Have u modified anything in init.rc file ?
    
    
    Kindly give this info, meanwhile we also look into the issue.

  •  

    Hi Satish,

    1. I build the wifi driver to the kernel, and the system can recognize the ralink card as rausb0 through netcfg command.

    2. where is the firmware file?  what is it for? I didn't do the copy, because I don't know where to find it.

    3. I backup the wpa_supplicant, and changed wpa_supplicant_6 to wpa_supplicant before compile.

    4. Yes, I did some changes in the file init.rc.

    I attached the steps what I have done to android 2.3-gingerbread,

    3312.integrate-wifi-to-am3517-steps.txt

     

     

    BTW,

    How to just compile wpa_supplicant? in 2.1, I can just type mm in wpa_supplicant dir, but in 2.3, it seems not work as fine as 2.1, I have already execute "source build/.envsetup.sh".

     

    Thanks,

    Kevin

     

     

     

  • Hi Satish,

    when using wpa_supplicant and libwpa_client.so after in BoardConfig.mk I set WPA_SUPPLICANT_VERSION := VER_0_6_X,

    the logcat is like this,

    8688.logcat-wpa_supplicant_6.txt

     

    Thanks,

    Kevin

     

    
    

  • Hi Kevin,

    How to compile wpa_supplicant?
    --> We use wpa_supplicant_6 version. In Boradconfig.mk, you should be doing:

    BOARD_WPA_SUPPLICANT_DRIVER := RALINK
    WPA_SUPPLICANT_VERSION      := VER_0_6_X
    WIFI_DRIVER_MODULE_PATH     := "path_to_wifi_driver_module"
    WIFI_DRIVER_MODULE_ARG       := "OPTIONAL_module_arguments_passed_to_wifi_driver_if_any"
    WIFI_DRIVER_MODULE_NAME     := "driver_module_name"
    WIFI_DRIVER_FW_STA_PATH     := "OPTIONAL_firmware_path_only_if_applicable"
    WIFI_FIRMWARE_LOADER        := "OPTIONAL_external_firmware_loader_only_if_required"

    By default Android expects your WiFi driver to be present as a module and not a built-in kernel driver. There are workarounds available for built-in WiFi drivers as well which I'm not covering here.

    When you enable WiFi from "Settings" then Android insert the driver module from "WIFI_DRIVER_MODULE_PATH". Once the driver module gets loaded Android will load the corresponding Firmware, if any needed, with the help of an optional Firmware loader feature as mentioned above. After all this Android will start wpa_supplicant and dhcpd_rausb0 service as defined in init.rc.

    How to set-up correct init.rc?
    --> In init.rc, you should be:
          --> Setting correct WiFi/wpa_supplicant paths, interface and permission settings.
          --> Starting wpa_supplicant and dhcp services.

    Your init.rc permissions look fine but you are not configuring wpa_supplicant service correctly. You have set wext driver instead of ralink driver.

    You should be configuring it as:
    --> service wpa_supplicant /system/bin/wpa_supplicant -dd -Dralink -irausb0 -c /system/etc/wifi/wpa_supplicant.conf
    instead of:
    --> service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -irausb0 -c /system/etc/wifi/wpa_supplicant.conf

    WPA_SUPPLICANT.CONF:

    You are creating unix based sockets in your wpa_supplicant.conf which is somehow not working. See the following error in your logcat:
    --> ERROR/WifiHW(901): Unable to open connection to supplicant on "/data/system/wpa_supplicant/rausb0": No such file or directory

    Android does have socket creation problem when running over NFS. So make sure you are not running Android over NFS.

    I dont have experience dealing with unix based wpa_supplicant sockets. I suggest you to try the following sample wpa_supplicant.conf which makes use of Android sockets instead:

    ##### wpa_supplicant configuration file template #####
    update_config=1
    ctrl_interface=rausb0
    eapol_version=1
    ap_scan=1
    fast_reauth=1

    Let me know if you have any more concerns.

    Regards,
    Amit Pundir

  • Hi Amit Pundir,

    I think I have done the procedures as you told me, however, some errors were printed on the logcat,
    -----------------------------------------
    01-01 00:42:21.015: DEBUG/Tethering(892): wif0 is not a tetherable iface, ignoring
    01-01 00:42:21.054: DEBUG/Tethering(892): rausb0 is not a tetherable iface, ignoring
    01-01 00:42:22.265: DEBUG/wpa_supplicant(4256): Initializing interface 'rausb0' conf '/system/etc/wifi/wpa_supplicant.conf' driver 'ralink' ctrl_interface 'N/A' bridge 'N/A'
    01-01 00:42:22.265: ERROR/wpa_supplicant(4256): Unsupported driver 'ralink'.
    01-01 00:42:22.265: DEBUG/wpa_supplicant(4256): Failed to add interface rausb0
    01-01 00:42:22.265: DEBUG/wpa_supplicant(4256): Cancelling scan request
    01-01 00:42:22.265: DEBUG/wpa_supplicant(4256): Cancelling authentication timeout
    01-01 00:42:22.273: ERROR/WifiHW(892): Supplicant not running, cannot connect
    01-01 00:42:22.328: DEBUG/WifiStateTracker(892): Reset connections and stopping DHCP
    01-01 00:42:23.335: DEBUG/WifiStateTracker(892): Disabling interface
    01-01 00:42:27.273: ERROR/WifiHW(892): Supplicant not running, cannot connect
    01-01 00:42:32.273: ERROR/WifiHW(892): Supplicant not running, cannot connect
    01-01 00:42:34.375: ERROR/NetworkManagmentService(892): Unexpected response code 600
    01-01 00:42:37.273: ERROR/WifiHW(892): Supplicant not running, cannot connect
    01-01 00:42:37.273: VERBOSE/WifiStateTracker(892): Supplicant died unexpectedly
    01-01 00:42:37.273: DEBUG/WifiStateTracker(892): Reset connections and stopping DHCP
    01-01 00:42:38.281: DEBUG/WifiStateTracker(892): Disabling interface
    01-01 00:42:38.367: DEBUG/WifiStateTracker(892): Reset connections and stopping DHCP
    01-01 00:42:39.375: DEBUG/WifiStateTracker(892): Disabling interface
    01-01 00:42:39.406: WARN/ProcessStats(892): Skipping unknown process pid 4288
    01-01 00:42:39.406: WARN/ProcessStats(892): Skipping unknown process pid 4298
    01-01 00:42:40.039: ERROR/Tethering(892): attempting to remove unknown iface (rausb0), ignoring
    01-01 00:42:40.296: ERROR/Tethering(892): attempting to remove unknown iface (wif0), ignoring
    --------------------------------------------------------

    Then, I found there is a line #CONFIG_DRIVER_RALINK=y in wpa_supplicant/.config file,  so I uncomment it, then the logcat is :
    -------------------------
    01-01 00:28:28.867: DEBUG/Tethering(895): wif0 is not a tetherable iface, ignoring
    01-01 00:28:28.945: DEBUG/Tethering(895): rausb0 is not a tetherable iface, ignoring
    01-01 00:28:31.250: ERROR/Tethering(895): attempting to remove unknown iface (rausb0), ignoring
    01-01 00:28:31.515: ERROR/Tethering(895): attempting to remove unknown iface (wif0), ignoring
    01-01 00:28:31.773: ERROR/WifiService(895): Failed to start supplicant daemon.
    01-01 00:29:06.757: ERROR/NetworkManagmentService(895): Unexpected response code 600
    -------------------------

    I don't know what is the problem, do you know anything about it.

    I have another question:
    each time after I make changes, I have to build by typing "make TARGET_PRODUCT=am3517evm OMAPES=3.x" on source root dir,  but it will rebuild all, and takes a long period, almost one hour on my poor pc,
    how can I just compile one module, e.g. wpa_supplicant? I tried mm or mmm wpa_supplicant, but it doesn't compile the module at all.

    Regards,

    Kevin

     

  • Hi Kevin,

    From the log it looks like your wpa_supplicant_6 is not built with Ralink driver support.

    Please make sure you have set "BOARD_WPA_SUPPLICANT_DRIVER := RALINK" in your BoardConfig.mk. Because one this is set then "CONFIG_DRIVER_RALINK" will automatically get defined and you don't need to enable it manually. See "external/wpa_supplicant_6/wpa_supplicant/Android.mk" for more details.

     

    To build only the specific module of AOSP.

    --> Go to the top level directory and run the following command.

    $ source build/envsetup.sh

    --> Now go to that module directory and run following command:

    $ mm TARGET_PRODUCT=am3517evm

    --> Copy the resultant binary/library to corresponding directory in your Android Rootfs

     

    For example, to build wpa_supplicant_6 module. Do the following:

    $ source build/envsetup.sh
    $ cd external/wpa_supplicant_6
    $ mm TARGET_PRODUCT=am3517evm
    ============================================
    PLATFORM_VERSION_CODENAME=REL
    PLATFORM_VERSION=2.3.4
    TARGET_PRODUCT=am3517evm
    TARGET_BUILD_VARIANT=eng
    TARGET_SIMULATOR=
    TARGET_BUILD_TYPE=release
    TARGET_BUILD_APPS=
    TARGET_ARCH=arm
    HOST_ARCH=x86
    HOST_OS=linux
    HOST_BUILD_TYPE=release
    BUILD_ID=GRJ22
    ============================================
    make: Entering directory `/datalocal/psp/amit/rowboat-2.3.4'
    target xxxx
    target xxxx
    target xxxx
    target xxxx
    Install: out/target/product/omap3evm/system/bin/wpa_supplicant
    make: Leaving directory `/datalocal/psp/amit/rowboat-2.3.4'

    Now copy the target binary i.e. out/target/product/am3517evm/system/bin/wpa_supplicant to your Android Rootfs' /system/bin directory.

     

    Regards,
    Amit Pundir

     

  • Hi Amit Pundir,

    1. My PLATFORM_VERSION is 2.3, not 2.3.4, I don't know why after "$source build/envsetup.sh", "$cd external/wpa_supplicant_6" "$mm TARGET_PRODUCT=am3517evm" still do not work even after I changed wpa_supplicant codes, the way works on my 2.1 version.

    it prints on the screen:

    ============================================
    PLATFORM_VERSION_CODENAME=REL
    PLATFORM_VERSION=2.3
    TARGET_PRODUCT=generic
    TARGET_BUILD_VARIANT=eng
    TARGET_SIMULATOR=
    TARGET_BUILD_TYPE=release
    TARGET_BUILD_APPS=
    TARGET_ARCH=arm
    HOST_ARCH=x86
    HOST_OS=linux
    HOST_BUILD_TYPE=release
    BUILD_ID=GRH55
    ============================================
    make:Entering Directory '/android/TI_Android_GingerBread_2_3_Sources'
    make: Nothing to be done for `all_modules'。
    make:Leaving Directory “/android/TI_Android_GingerBread_2_3_Sources”

     

    2. I recompile again, when using the new wpa_supplicant, the logcat is:

    ------------------------------------

    01-01 05:52:21.937: DEBUG/wpa_supplicant(1227): ralink_set_oid: oid=0x620 len (8) failed
    01-01 05:52:21.937: DEBUG/wpa_supplicant(1227): ralink_set_oid: oid=0x621 len (1) failed
    01-01 05:52:21.937: DEBUG/wpa_supplicant(1227): RALINK: Failed to set RT_OID_WPA_SUPPLICANT_SUPPORT(1)
    01-01 05:52:21.937: ERROR/wpa_supplicant(1227): RALINK: Driver does not support wpa_supplicant
    01-01 05:52:21.937: ERROR/wpa_supplicant(1227): Failed to initialize driver interface
    01-01 05:52:21.937: DEBUG/wpa_supplicant(1227): Failed to add interface rausb0
    01-01 05:52:21.945: DEBUG/wpa_supplicant(1227): Cancelling scan request
    01-01 05:52:21.945: DEBUG/wpa_supplicant(1227): Cancelling authentication timeout
    01-01 05:52:23.656: ERROR/Tethering(895): attempting to remove unknown iface (rausb0), ignoring
    01-01 05:52:23.914: ERROR/Tethering(895): attempting to remove unknown iface (wif0), ignoring
    01-01 05:52:24.171: ERROR/WifiService(895): Failed to start supplicant daemon.
    01-01 05:53:12.031: ERROR/NetworkManagmentService(895): Unexpected response code 600

    ---------------------------------------

    I am trying to find what the problem is.

     

    Thanks,

    Kevin

     

     

     

  • Hi Kevin,

    Please make sure that you are passing "TARGET_PRODUCT=am3517evm". Because your build log prints "TARGET_PRODUCT=generic" on screen.

    Regards,
    Amit Pundir

  • Hi Amit Pundir,

    Sorry for my last typing mistake, and I found first remove last built files (wpa_supplicant, libwpa_client.so) manually, then mm TARGET_PRODUCT=am3517evm will work, and generate new files.

    Using the new wpa_supplicant and libwpa_client.so, I still got the error messages as below,
    ------------------------------------
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): Initializing interface 'rausb0' conf '/system/etc/wifi/wpa_supplicant.conf' driver 'ralink' ctrl_interface 'N/A' bridge 'N/A'
    01-03 23:34:06.742: INFO/wpa_supplicant(2513): driver[0]->name= 'ralink'.
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): Configuration file '/system/etc/wifi/wpa_supplicant.conf' -> '/system/etc/wifi/wpa_supplicant.conf'
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): Reading configuration file '/system/etc/wifi/wpa_supplicant.conf'
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): update_config=1
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ctrl_interface='rausb0'
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): eapol_version=1
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ap_scan=1
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): fast_reauth=1
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): Initializing interface (2) 'rausb0'
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): wpa_driver_ralink_init
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ralink_set_iface_flags
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ralink_get_we_version_compiled: failed
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): wpa_driver_ralink_flush_pmkid
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ralink_set_oid: oid=0x620 len (8) failed
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): ralink_set_oid: oid=0x621 len (1) failed
    01-03 23:34:06.742: DEBUG/wpa_supplicant(2513): RALINK: Failed to set RT_OID_WPA_SUPPLICANT_SUPPORT(1)
    01-03 23:34:06.742: ERROR/wpa_supplicant(2513): RALINK: Driver does not support wpa_supplicant
    01-03 23:34:06.750: ERROR/wpa_supplicant(2513): Failed to initialize driver interface
    01-03 23:34:06.750: DEBUG/wpa_supplicant(2513): Failed to add interface rausb0
    01-03 23:34:06.750: DEBUG/wpa_supplicant(2513): Cancelling scan request
    01-03 23:34:06.750: DEBUG/wpa_supplicant(2513): Cancelling authentication timeout
    01-03 23:34:06.757: ERROR/WifiHW(913): Supplicant not running, cannot connect
    01-03 23:34:06.812: DEBUG/WifiStateTracker(913): Reset connections and stopping DHCP
    01-03 23:34:07.820: DEBUG/WifiStateTracker(913): Disabling interface
    01-03 23:34:11.757: ERROR/WifiHW(913): Supplicant not running, cannot connect
    01-03 23:34:16.757: ERROR/WifiHW(913): Supplicant not running, cannot connect
    01-03 23:34:21.757: ERROR/WifiHW(913): Supplicant not running, cannot connect
    01-03 23:34:21.757: VERBOSE/WifiStateTracker(913): Supplicant died unexpectedly
    01-03 23:34:21.757: DEBUG/WifiStateTracker(913): Reset connections and stopping DHCP
    01-03 23:34:22.765: DEBUG/WifiStateTracker(913): Disabling interface
    01-03 23:34:22.796: DEBUG/WifiStateTracker(913): Reset connections and stopping DHCP
    01-03 23:34:23.804: DEBUG/WifiStateTracker(913): Disabling interface
    ------------------------------------

    I checked my files this time as below,
    @device/ti/am3517evm/BoardConfig.mk
    BOARD_WPA_SUPPLICANT_DRIVER := RALINK   
    WPA_SUPPLICANT_VERSION      := VER_0_6_X

    @system/etc/wifi/wpa_supplicant.conf
    update_config=1
    ctrl_interface=rausb0
    eapol_version=1
    ap_scan=1
    fast_reauth=1

    @/init.rc
    service wpa_supplicant /system/bin/wpa_supplicant -dd -Dralink -irausb0 -c /system/etc/wifi/wpa_supplicant.conf
        group system wifi inet root
        disabled
        oneshot
    service dhcpcd /system/bin/dhcpcd rausb0
        group system dhcp
        disabled
        oneshot

     

    Thanks,

    Kevin

     

  • Hi Amit Pundir,

    If the usb wifi-card is not ralink type, I should also using wext, is that right. because my  comrade told me the  usb card I am using is ralink, and I am not sure about it.

    When using wext, some access points will be listed, so I think wext maybe more fit for my usb wifi card, I will do more tests and try to understand how the codes work.

     

    Thanks,

    Kevin

  • Hi Amit Pundir,

     

    My usb wifi card is of type "CEC Huada Electronic", so I think I should use wext driver, right?

    My current progress is:

    the wifi-setting screen can list all available access points, but the summary of the wifi menu is alway "scanning...", and if I click on one access point, and connect, the summary will show "obtaining IP address from TP-LINK_70BF04", then "scaning ..." again, and the status of the access point  TP-LINK_70BF0 is "Disabled".

     

    I am not sure why the wifi-setting menu is so unstable.

     

    Thanks,

    Kevin

  • I would suggest first trying out your modem with a linux system before moving on to Android. With linux you may find it easier to debug and perhaps have/get more support from the vendor.

  • Hi, 

    Is there anybody using external usb wifi card with am3517, under TI-Android-GingerBread-2.3-DevKit-1.0 environment?

    How to let the usb wifi card works, and enable/disable it through android setting menu?

     

    Thanks,

    Kevin

     

  • The following thread may perhaps be of help to you, it is for USB wifi on beagle, however, I believe, a similar process applies to AM35x too.

    http://groups.google.com/group/rowboat/browse_thread/thread/327b53961456eca

  • Finally, I found the problem. my wifi works fine now. I am testing with "TI Android GingerBread 2.3 DevKit 1.0", I am not sure this will apply to other devkits.

    @frameworks/base/wifi/java/android/net/wifi/WifiStateTracker.java

    @line 396

    -----------------------------------from-----------------------------------

     mInterfaceName = SystemProperties.get("wifi.interface", "tiwlan0");

    ------------------------------------to-------------------------------------

     mInterfaceName = SystemProperties.get("wifi.interface", "wlan0");

     

    Note:

    wlan0 is your interface's name, which is defined in init.rc, you should change it in your case.

    @init.rc

     

    setprop wifi.interface "wlan0"
    setprop wlan.driver.status "ok"

    # wifi
    # wpa_supplicant and dhcp daemon
    service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c /system/etc/wifi/wpa_supplicant.conf -dd
    socket wlan0 dgram 660 wifi wifi
    user root
    group system wifi inet
    disabled
    oneshot
    #service dhcpcd
    service dhcpcd /system/bin/dhcpcd -d -AKL wlan0
    group system dhcp wifi
    disabled
    oneshot
    Thanks,