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.

Could not get ip address in p2p mode

Hi,

Followed the below steps to connect a tablet and my device

iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

wpa_supplicant -B -u -iwlan0 -c/etc/wpa_supplicant.conf -N -ip2p0 -c/etc/p2p_supplicant.conf -u

wpa_cli -ip2p0
p2p_group_add

Quit and follow below steps in the device
echo 1 > /proc/sys/net/ipv4/ip_forward
ip addr add 192.168.0.1/24 dev p2p-p2p0-0
udhcpd /etc/udhcpd.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Now i am connecting the tablet with the ssid and passphrase which is displayed along with p2p_group_add. The connection is successful but it doesnt get
IP address. The tablet keeps displaying the optaining ip address.

What would be the problem? It was working fine till yesterday but today I updated the software and it stopped working.

wpa_supplicant.conf
##### wpa_supplicant configuration file template #####
#
# This option can be used to allow wpa_supplicant to overwrite configuration
# file whenever configuration is changed (e.g., new network block is added with
# wpa_cli or wpa_gui, or a password is changed). This is required for
# wpa_cli/wpa_gui to be able to store the configuration changes permanently.
# Please note that overwriting configuration file will remove the comments from
# it.
update_config=1
ctrl_interface=/var/run/wpa_supplicant
# IEEE 802.1X/EAPOL version
# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines
# EAPOL version 2. However, there are many APs that do not handle the new
# version number correctly (they seem to drop the frames completely). In order
# to make wpa_supplicant interoperate with these APs, the version number is set
# to 1 by default. This configuration value can be used to set it to the new
# version (2).
eapol_version=1
# AP scanning/selection
# By default, wpa_supplicant requests driver to perform AP scanning and then
# uses the scan results to select a suitable AP. Another alternative is to
# allow the driver to take care of AP scanning and selection and use
# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
# information from the driver.
# 1: wpa_supplicant initiates scanning and AP selection; if no APs matching to
#    the currently enabled networks are found, a new network (IBSS or AP mode
#    operation) may be initialized (if configured) (default)
# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
#    parameters (e.g., WPA IE generation); this mode can also be used with
#    non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
#    APs (i.e., external program needs to control association). This mode must
#    also be used when using wired Ethernet drivers.
# 2: like 0, but associate with APs using security policy and SSID (but not
#    BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to
#    enable operation with hidden SSIDs and optimized roaming; in this mode,
#    the network blocks in the configuration file are tried one by one until
#    the driver reports successful association; each network block should have
#    explicit security policy (i.e., only one option in the lists) for
#    key_mgmt, pairwise, group, proto variables
# When using IBSS or AP mode, ap_scan=2 mode can force the new network to be
# created immediately regardless of scan results. ap_scan=1 mode will first try
# to scan for existing networks and only if no matches with the enabled
# networks are found, a new IBSS or AP mode network is created.
ap_scan=1
# EAP fast re-authentication
# By default, fast re-authentication is enabled for all EAP methods that
# support it. This variable can be used to disable fast re-authentication.
# Normally, there is no need to disable this.
fast_reauth=1
device_name=Blaze
manufacturer=TI
model_name=Wilink
model_number=wl18xx
serial_number=12345
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
# Timeout in seconds to detect STA inactivity (default: 300 seconds)
#
# This timeout value is used in P2P GO mode to clean up
# inactive stations.
p2p_go_max_inactivity=60
p2p_go_ht40=1
disassoc_low_ack=1
concurrent_sched_scan=1
p2p_disabled=1

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
##p2p_pref_chan=115:36 115:40
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
p2p_go_max_inactivity=60
p2p_go_ht40=1
disassoc_low_ack=1
concurrent_sched_scan=1


Regards,
Johncy.
  • Hi Johncy,

    Do you mean you updated the software on the tablet and it is not working?
    If so, it would suggest that the DHCP Client on the tablet is not running.

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    I updated the Root file system in my device and updated the p2p_supplicant.conf and udhcpd.conf as given in

    processors.wiki.ti.com/.../WiFi_Direct_Configuration_Scripts

    Regards,

    Johncy

  • Hi Johncy,

    Can you execute the commands exactly as mentioned in the wiki page and see if it makes any difference?

    ***
    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

    Note:- The IP address assigned for 'p2p-p2p0-0' interface (ifconfig p2p-p2p0-0 192.168.0.1) should match the "router" field IP in the udhcpd.conf file.
    ***

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    I followed the same sequence but still no success.

    It looks like it gets the IP address but the connection is inconsistent.

    I could see the below messages.

    <3>AP-STA-DISCONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-CONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-DISCONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-CONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-DISCONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-CONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-DISCONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-CONNECTED c4:43:8f:5b:58:98
    <3>AP-STA-DISCONNECTED c4:43:8f:5b:58:98

    Regards,
    Johncy.
  • My ping shows,

    ping 192.168.0.20
    PING 192.168.0.20 (192.168.0.20): 56 data bytes
    64 bytes from 192.168.0.20: seq=26 ttl=64 time=42.203 ms
    64 bytes from 192.168.0.20: seq=27 ttl=64 time=869.986 ms
    64 bytes from 192.168.0.20: seq=28 ttl=64 time=269.329 ms
    64 bytes from 192.168.0.20: seq=29 ttl=64 time=232.418 ms
    64 bytes from 192.168.0.20: seq=30 ttl=64 time=3.438 ms
    64 bytes from 192.168.0.20: seq=31 ttl=64 time=20.776 ms
    64 bytes from 192.168.0.20: seq=32 ttl=64 time=159.612 ms
    64 bytes from 192.168.0.20: seq=40 ttl=64 time=788.545 ms
    64 bytes from 192.168.0.20: seq=41 ttl=64 time=14.006 ms
    64 bytes from 192.168.0.20: seq=52 ttl=64 time=35.173 ms
    64 bytes from 192.168.0.20: seq=53 ttl=64 time=34.349 ms
    64 bytes from 192.168.0.20: seq=54 ttl=64 time=95.819 ms
    ^C
    --- 192.168.0.20 ping statistics ---
    63 packets transmitted, 12 packets received, 80% packet loss
    round-trip min/avg/max = 3.438/213.804/869.986 ms

    Regards,
    Johncy.
  • Hi Johncy,

    Please confirm if this can be closed.

    Regards,
    Gigi Joseph.
  • Yes this can be closed.

    Regards,
    Johncy.