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.

Wifi direct - Ping not succesful - (AM335x + WL18xx + linux)

Hi,

I am following the instruction in the below site to connect to Wifi direct.

http://processors.wiki.ti.com/index.php/WiFi_Direct_Configuration_Scripts#p2p_find

I have a AM335x evaluation module with WL18xx WiFi module and OS is linux.

Since i dont have 2 EVM, I configure my EVM 1 as per the instruction in the web page. I have a android tablet which has wifi direct.

So in my android tablet i enable wifi direct. In EVM 1, p2p_find finds the device android device information. p2p_peers gives the MAC address of the tablet. When I give connect, (p2p_connect) the connect is successful on both the EVM #1 and the tablet.

But when I assign the static ip address, I couldnt set ip address in my android device using the p2p0 interface. So ping is not successful.

I tried DHCP also and I coudnt get the ip address set in my android device. Any thoughts is highly appreciated.

Regards,

Johncy. 

  • Hi Johncy,

    The IP Address should be assigned to the "p2p-p2p0-0" interface.

    Regards,
    Gigi Joseph.

  • Hi Joseph,

    Thanks for the response. I tried giving ifconfig p2p-p2p-0 192.168.3.4 But it complained error: SIOCSIFADDR (operation not permitted).

    On giving netcfg command information related to my MAC accdress showed as,

    wlan0 up 10.1.167.179/24

    p2p0 UP 0.0.0.0

    p2p-wlan0-0 UP 192.168.49.1/24

    Thanks,

    Johncy.

  • Hi Johncy,

    Which release are you using? You don't seem to have the p2p-p2p0-0 interface. The interface created for you seems to be "p2p-wlan0-0".

    Are you entering the wpa_cli using the p2p0 interface ("wpa_cli -ip2p0")?

    Regards,
    Gigi Joseph.

  • Hi.

    I am having android 4.4.2 in my device.

    In the tablet I am not running wpa_cli but using the wifi-direct feature in Connections menu. I give p2p_connect with the mac address of the android device from the EVM board in PBC mode. Then a pop up is dispalyed in my tablet to connect. Once I connect, the connection is succesful. But after that how to assign ip address to the tablet is not known still.

    Regards,

    Johncy.

  • Hi Johncy,

    Please confirm if you are starting the DHCP Server in the EVM board.

    root@am335x-evm:~# echo 1 > /proc/sys/net/ipv4/ip_forward
    root@am335x-evm:~# ifconfig p2p-p2p0-0 192.168.0.1
    root@am335x-evm:~# udhcpd /etc/udhcpd.conf

    Regards,
    Gigi Joseph.

  • Hi Gigi,

    I tried in both ways of assigning the ip address as static and using DHCP.

    Steps I followed for static ip configuration is:

    In EVM #1,

    1) Created the p2p0 interface using the below command:
    iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

    2) Changed /etc/p2p_supplicant.conf as below
    ctrl_interface=/var/run/wpa_supplicant
    update_config=0
    device_name=TI-SITARA-P2P
    device_type=1-0050F204-1
    config_methods=virtual_push_button physical_display keypad
    p2p_go_intent=0
    country=US
    driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
    p2p_go_max_inactivity=60
    p2p_go_ht40=1
    p2p_multi_chan=1
    disassoc_low_ack=1
    concurrent_sched_scan=1

    3) Ran the wpa_supplicant as below:
    wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &

    4) Sent wpa_cli -ip2p0
    a) p2p_find
    b) p2p_peers
    c) p2p_connect <MAC address of Android tablet> pbc freq=2412
    d) q to quit the interactive mode

    5) At step 4c, a popup is displayed on the android tablet asking to connect. Gave connect and in a while
    tablet shows connected and EVM #1 shows connect success in the putty terminal.

    6) Set ip address in EVM #1 as below,
    ifconfig p2p-p2p0-0 192.168.3.3

    7) In android tablet I can find only p2p0/p2p-wlan0-0 is shown. So couldn't set the IP address for p2p-p2p0-0 interface
    in tablet.


    Steps I followed for DHCP is:

    In EVM #1,

    1) Created the p2p0 interface using the below command:
    iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

    2) Changed /etc/p2p_supplicant.conf as below
    ctrl_interface=/var/run/wpa_supplicant
    update_config=0
    device_name=TI-SITARA-P2P
    device_type=1-0050F204-1
    config_methods=virtual_push_button physical_display keypad
    p2p_go_intent=0
    country=US
    driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
    p2p_go_max_inactivity=60
    p2p_go_ht40=1
    p2p_multi_chan=1
    disassoc_low_ack=1
    concurrent_sched_scan=1

    3) Ran the wpa_supplicant as below:
    wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &

    4) Sent wpa_cli -ip2p0
    a) p2p_find
    b) p2p_peers
    c) p2p_connect <MAC address of Android tablet> pbc freq=2412
    d) q to quit the interactive mode

    5) At step 4c, a popup is displayed on the android tablet asking to connect. Gave connect and in a while
    tablet shows connected and EVM #1 shows connect success in the putty terminal.

    6) In EVM #1, Changed udhcpd.conf as
    # Sample udhcpd configuration file (/etc/udhcpd.conf)
    # The start and end of the IP lease block
    start 		192.168.0.20	#default: 192.168.0.20
    end		192.168.0.254	#default: 192.168.0.254
    # The interface that udhcpd will use
    interface   p2p-p2p0-0		#default: eth0
    #Examles
    opt	dns	8.8.8.8  8.8.4.4 # public google dns servers
    option	subnet	255.255.255.0
    opt	router	192.168.0.1
    option	lease	864000		# 10 days of

    7) Sent the below commands in EVM #1,
    echo 1 > /proc/sys/net/ipv4/ip_forward
    ifconfig p2p-p2p0-0 192.168.0.1
    udhcpd /etc/udhcpd.conf
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    8) In android tablet I couldnt run the udhcpc -i p2p-p2p0-0

    Thanks,
    Johncy.

  • Hi Johncy,

    The DHCP Client should already be running on the Android tablet - so you wouldn't need to set the IP address specifically to the android tablets 'p2p-wlan0-0' interface.
    Which IP address are you trying to ping? Based on your configuration, the ip address of the tablet should be "192.168.0.20"

    Regards,
    Gigi Joseph.

  • Yes I ping 192.168.0.20 from the EVM board.

    If i run the dhcpc -ip2p-p2p0-0 in my EVM board then ping is successful on both sides.

    Thanks,
    Johncy.

  • Hi Johncy,

    Thanks for the update.
    Please let me know if I can close this thread.

    Regards,
    Gigi Joseph.

  • Yes please close the thread.