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.

wlan_cu gets can't connect the socket

Other Parts Discussed in Thread: DM3730

 

i worked on dm3730 EVM with Android 2.2, As the prebuilt filesystem of DM37X doesn't supports wifi an bluetooth, i tried to add. But when i tried to configure wlan using wlan_cu, i got errors:

# wlan_cu -itiwlan0

ERROR - IpcWpa_Sockets_Open - can't connect the socket

******************************************************

Connection to supplicant failed

******************************************************

user_main, start

\> Driver/, Connection/, Management/, Show/, Privacy/, scAn/, roaminG/, qOs/, poWer/, eVents/, Bt coexsistance/, Report/, dEbug/, biT/, aboUt, Quit

 

the GUI off Android setting also didn't work.

what i did befor wlan_cu is:
# insmod /system/etc/wifi/tiwlan_drv.ko
# wlan_loader -e /system/etc/wifi/nvs_map.bin -f /system/etc/wifi/firmware.bin -i /system/etc/wifi/tiwlan.ini
# start wpa_supplicant
and my service wpa_supplicant in init.rc is:
service wpa_supplicant /system/bin/wpa_supplicant -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd
    socket wpa_tiwlan0 dgram 660 wifi wifi
    disabled
    oneshot
anyone can help me ?
thanks in advance

 

  • Hi,

    could ypu please let me know which version are you using?

    for linux the bringup sequence is:

    insmode sdio.ko (that not always needed - depends on the verion you use)

    insmode bmtrace.ko (that not always needed - depends on the verion you use)

    insmode tiwlan_drv.ko

    ./tiwlan_loader

    ifconfig tiwlan0 192.168.1.10 netmask 255.255.255.0 up

    Now the Driver will come up and then operate the supplicant by:

    ./wpa_supplicant -Dwext -itiwlan0 -c wpa_supplicant.txt &

    ./wlan_cu

    Regards,

    Eyal

     

  • Hi Eyal,

    i'm using prebuilt filesystem of DM37x from TI_Android_FroYo_DevKit-V2.2.tar.gz.

    i found that there is no need to(and cann't) insmod sdio.ko: 

    # insmod  /system/etc/wifi/sdio.ko 

    # insmod  /system/etc/wifi/bmtrace.ko 

    # insmod  /system/etc/wifi/tiwlan_drv.ko 

    tiwlan_drv: exports duplicate symbol g_sdio_debug_level (owned by sdio)

    insmod: init_module '/system/etc/wifi/tiwlan_drv.ko' failed (Exec format error)

    # rmmod sdio

    # insmod  /system/etc/wifi/tiwlan_drv.ko 

    TIWLAN: driver init

    #

     

    And i cann't start wpa_supplicant by directly run the command(why?), but only start it as a service:

    # wpa_supplicant -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd &

    # TIWLAN: 1832.439290: wlanDrvIf_Open()

    mkdir[ctrl_interface]: Permission denied

    TIWLAN: 1833.460099: wlanDrvIf_Release()

    [1]+  Done(255)                  wpa_supplicant -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd

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

    # TIWLAN: 1850.805135: wlanDrvIf_Open()

    mkdir[ctrl_interface]: Permission denied

    TIWLAN: 1851.820972: wlanDrvIf_Release()

    [1]+  Done(255)                  wpa_supplicant -Dwext -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd

    # start wpa_supplicant 

    # TIWLAN: 1875.506002: wlanDrvIf_Open()

    #

    another thing, can you tell me what does the option -D mean? my netcfg outputs:

    # netcfg

    lo       UP    127.0.0.1       255.0.0.0       0x00000049

    eth0     UP    192.168.0.110   255.255.255.0   0x00001043

    tiwlan0  UP    0.0.0.0         0.0.0.0         0x00001043

    shoud i use -Dtiwlan0 or -Dwext?
    Finally i got the error again after ismod bmtrace.ko:
    # wlan_cu -itiwlan0 
    ERROR - IpcWpa_Sockets_Open - can't connect the socket
    ******************************************************
    Connection to supplicant failed
    ******************************************************
    user_main, start
    \> Driver/, Connection/, Management/, Show/, Privacy/, scAn/, roaminG/, qOs/, poWer/, eVents/, Bt coexsistance/, Report/, dEbug/, biT/, aboUt, Quit
    thanks.

  • Hi,

    I requested someone that has more experience with Android to answer, so you should get a follow-up answer early this week

    Regards,

    Eyal

     

  • Now there is something that got me more confused. ddms show the following messages:

    01-01 01:39:31.437: ERROR/WifiHW(969): Cannot access "/data/misc/wifi/wpa_supplicant.conf": Permission denied

    01-01 01:39:31.437: ERROR/WifiHW(969): Wi-Fi will not be enabled

    while my /data/misc/wifi/wpa_supplicant.conf is:

    # ls -l /data/misc/wifi/

    drwxrwx--- wifi     wifi              2011-04-19 09:46 sockets

    -rwxrwx--- wifi     wifi          134 2011-04-20 08:48 wpa_supplicant.conf

    and sometimes it is possibe to enable Wi-Fi. but got another issue:

    01-01 05:48:29.781: ERROR/WifiHW(1009): Unable to open connection to supplicant on "tiwlan0": Permission denied

    01-01 05:48:34.781: ERROR/WifiHW(1009): Unable to open connection to supplicant on "tiwlan0": Permission denied

    01-01 05:48:39.789: ERROR/WifiHW(1009): Unable to open connection to supplicant on "tiwlan0": Permission denied

    01-01 05:48:44.796: ERROR/WifiHW(1009): Unable to open connection to supplicant on "tiwlan0": Permission denied

    while /dev/socket/wpa_tiwlan0 shows:

    # ls -l /dev/socket/wpa_tiwlan0

    srwxrwxrwx wifi     wifi              2000-01-01 02:54 wpa_tiwlan0

     

    can anyone help me????????

     

  • puyou lu

    Please try changing the permissions for wpa_supplicant.conf and wpa_supplicant

    cd /data/misc/wifi

    chmod 777 wpa_supplicant.conf

    cd /system/bin

    chmod 777 wpa_supplicant

    Thanks

    Saurabh


  •  

    Hi Saurabh,

    I changed permissions of everything asosiated to 777 in init.rc and reboot it:

        chmod 0777 /system/etc/wifi

        chmod 0777 /system/etc/wifi/wpa_supplicant.conf

        chown wifi wifi /system/etc/wifi/wpa_supplicant.conf

        mkdir /data/misc/wifi 0777 wifi wifi

        mkdir /data/misc/wifi/sockets 0777 wifi wifi

        chmod 0777 /data/misc/wifi

        chmod 0777 /data/misc/wifi/wpa_supplicant.conf

        chown wifi wifi /data/misc/wifi

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

    service wpa_supplicant /system/bin/wpa_supplicant -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd

        socket wpa_tiwlan0 dgram 777 wifi wifi

        disabled

        oneshot

    But it still says "Unable to open connection to supplicant on "tiwlan0": Permission denied"! what else can i do?

     

    BTW, at first I'm using prebuild filesystem of DM37X of Android froyo, and then i build android gingerbread myself. I download and build Android filesystem using rowboat-gingerbread-dsp.xml and did no change to the source code. They all have this issue. 

    I know it's unbelievable, but I suggest you do this youself and you'll know how strange it is.

     

     

  • puyou lu

    There are lot of variables here. Please run he following commands and let me know the ouput -

    cd /system/etc/wifi
    insmod tiwlan_drv.ko
    start wlan_loader
    ifconfig tiwlan0 192.168.0.101 netmask 255.255.255.0 up
    start wpa_supplicant
    wlan_cu -itiwlan0

    Please let me know the output for each step.

    Thanks

    Saurabh

     

     

  • Hi Saurabh,

    I think I've followed your steps everytime!

    I just do this again, here is the outputs:

     

    # cd /system/etc/wifi

    # insmod tiwlan_drv.ko

    TIWLAN: driver init

     

    # start wlan_loader

    # init: starting 'wlan_loader'

    init: waitpid returned pid 994, status = 00000000

    init: process 'wlan_loader', pid 994 exited

     

    # ifconfig tiwlan0 192.168.0.101 netmask 255.255.255.0 up

    TIWLAN: 3982.666463: wlanDrvIf_Open()

    TIWLAN: 3982.902547: pInitParams->RoamingScanning_2_4G_enable 0 

    SDIO clock Configuration is now set to 24Mhz

    TIWLAN: 3983.119099: CHIP VERSION... set 1273 chip top registers

    TIWLAN: 3983.125752: Working on a 1273 PG 2.0 board.

    TIWLAN: 3983.130513: Starting to process NVS...

    TIWLAN: 3983.134847: NVS found, EEPROM Image addr=0xcca94400, EEPROM Len=0x0x1d4

    TIWLAN: 3983.148610: Chip ID is 0x4030111.

    TIWLAN: 3983.152913: FEM Type 1 

    TIWLAN: 3983.156209: Starting to download firmware...

    TIWLAN: 3983.267964: Starting to download firmware...

    TIWLAN: 3983.299794: Starting to download firmware...

    TIWLAN: 3983.313710: Starting to download firmware...

    TIWLAN: 3983.322560: Starting to download firmware...

    TIWLAN: 3983.329793: Starting to download firmware...

    TIWLAN: 3983.341023: Finished downloading firmware.

    TIWLAN: 3983.347279: Firmware running.

    TIWLAN: 3983.367024: 

    TIWLAN: 3983.369130: --------------------------------------------------------------------

    TIWLAN: 3983.377156: Driver Version  : WiLink_Driver_6.1.0.0.144

    TIWLAN: 3983.382985: Firmware Version: Rev 6.1.0.0.335

    TIWLAN: 3983.387929: Station ID      : 08-00-28-12-34-56

    TIWLAN: 3983.393056: --------------------------------------------------------------------

    TIWLAN: 3983.401051: 

    TIWLAN: 3983.423787: Interrogate TX/RX parameters

     

    # start wpa_supplicant

    # init: starting 'wpa_supplicant'

    init: Created socket '/dev/socket/wpa_tiwlan0' with mode '777', user '1010', group '1010'

     

    # wlan_cu -itiwlan0

    ERROR - IpcWpa_Sockets_Open - can't connect the socket

    ******************************************************

    Connection to supplicant failed

    ******************************************************

    user_main, start

    \> Driver/, Connection/, Management/, Show/, Privacy/, scAn/, roaminG/, qOs/, poWer/, eVents/, Bt coexsistance/, Report/, dEbug/, biT/, aboUt, Quit

  • puyou lu,

    Seems like you do not have root access on the shell. Try command "su" or any root access command that your platform supports. Thanks

    Saurabh