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.

Linux: P2P GO on TiWi-BLE goes offline

Tool/software: Linux

I've been trying to get P2P GO running stable for more than a week now and I've pretty much run out of things to try on my end.

The platform is a Technology Systems TS-7970 SBC with an LSR TiWi-BLE module on it.  The kernel version is 4.1.15.

I have WPA Supplicant version 2.7 installed with the P2P features active. 

I've also managed to locate the following ti-connectivity firmware versions: For regular wifi the driver loads 6.3.10.0.142.  When I create a P2P GO, it switches to firmware 6.5.7.0.50.

There are really three situations defined by the contents of the wpa_supplicant configuration file.

1) No network blocks are present in the configuration file.  When this is the case, the Wifi Direct network will appear to a laptop or mobile phone and I can connect to it and ping it without any problems.

2) A network block exists in the wpa_supplicant configuration file and the wifi access point specified there is up and running.  In this case, wlan0 is indeed connected to the router and I can also connect to the Wifi Direct network created by P2P GO.  There a no problems here either.

3) A network block exists in the wpa_supplicant configuration file but that router is not turned on.  In this case, the P2P GO network appears for a short time but then it mysteriously goes away.  I have gone so far as to turn on verbose debugging in wpa_supplicant and "excessive" log output in wpa-cli.  The really weird thing is that when the P2P GO network disappears, there is absolutely no notification in any of the debugging output.  There is also no warning or error in the system console output given by dmesg.

I'm at my wits end here trying to figure out why this happens.  There's no set time period when the network goes away.  Sometimes it stays up for several minutes.  Sometimes it goes away within a few seconds.  Once it lasted almost an hour.  It's almost as though the driver is cleaning up some information and happens to kill off the P2P GO network in the process.  But without any notification, I'm totally in the dark about this.

  • Hi,

    Is this a wl127x device? why are you using such an old device for a new design?

    Anyway, have you tried following the examples for wl12xx in this wiki?
    processors.wiki.ti.com/.../OMAP_Wireless_Connectivity_NLCP_Multi_Role_Configuration

    It might be a bit outdated in terms firmware version etc, but the concept should be the sane.

    BR,
    Eyal
  • Unfortunately, the choice of device isn't up to me.  Technologic Systems designed their TS-7970 using this device and they aren't going to change it.  So I'm stuck with this.

    That said, I started fresh and following the exact procedures in the link but I still run into the same problem.  The Wifi Direct SSID appears to other computers for a while and then mysteriously vanishes.  I tried twice just now.  The first time, it stayed visible for about 2 minutes.  The second time, I noticed that I hadn't turned off power_save but sadly, the SSID was visible for about 10 minutes.

    Here's my wpa_supplicant.conf file:

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    network={
        ssid="Linksys14627"
        priority=1
        #psk="tsndyvjfsz"
        psk=2362f2fccf873f665b66bd96d5c1fc070d472a87bebff9615e3469ef260c14b1
    }

    Here's my p2p.conf file:

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

    device_name=TI-WILINK-P2P
    device_type=1-0050F204-1
    sec_device_type=1-0050F204-1
    #p2p_listen_reg_class=81
    #p2p_listen_channel=1
    p2p_oper_reg_class=81
    p2p_oper_channel=8
    p2p_go_intent=15
    p2p_go_max_inactivity=18000

    network={
        ssid="DIRECT-FOOBAR"
            psk="12345678"
            proto=RSN
            key_mgmt=WPA-PSK
            pairwise=CCMP
            auth_alg=OPEN
            mode=3
        disabled=2
    }

    Here's the dmseg output:

    [  218.225493] wlcore: down
    [  232.889492] wlcore: firmware booted (Rev 6.3.10.0.142)
    [  232.925090] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    [  336.078925] wlcore: down
    [  336.083491] ieee80211 phy0: Hardware restart was requested
    [  336.624159] wlcore: firmware booted (Rev 6.5.7.0.50)

    Here's my command sequence:
    ***In an ssh session via ethernet:

    nano nano /etc/wpa_supplicant/p2p.conf
    ifconfig wlan0 down
    ifconfig wlan0 hw ether 08:00:28:34:56:22
    ifconfig wlan0 10.2.30.34 netmask 255.255.255.0 up
    iw wlan0 set power_save off
    iw phy0 interface add wlan1 type managed
    ifconfig wlan1 hw ether 08:00:28:44:56:83
    iw wlan1 set power_save off
    wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211 -dd -t

    **** In another ssh session via ethernet
    wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/p2p.conf -Dnl80211 -dd -t

    *** In a third ssh session via ethernet:

    wpa_cli -iwlan1 p2p_group_add freq=2462

    I can post the output of the debug but the important point is that when the SSID vanishes, there is nothing being output by either wpa_supplicant session.  Furthermore, there's no console dmesg indicating that there's anything happening when the SSID vanishes.

    wpa_cli status gives me the following:

    bssid=de:ad:be:ef:00:01
    freq=2462
    ssid=DIRECT-uh
    id=0
    mode=P2P GO
    pairwise_cipher=CCMP
    group_cipher=CCMP
    key_mgmt=WPA2-PSK
    wpa_state=COMPLETED
    p2p_device_address=08:00:28:44:56:83
    address=de:ad:be:ef:00:01
    uuid=eec69801-1168-5d09-8bb9-df1479f8aaa2

    switching wpa_cli to wlan1 and checking status gives me:
    wpa_state=DISCONNECTED
    p2p_device_address=08:00:28:44:56:83
    address=08:00:28:44:56:83
    uuid=eec69801-1168-5d09-8bb9-df1479f8aaa2


    Basically, the wiki procedure hasn't gotten me any further.  Got any other suggestions?

  • Hi ,
    I see you are already using latest wl127x fwr version . You mentioned that system switched to .50 firmware when you start P2P connection. This I believe is multirole fwr. Are you running other roles apart from P2P role ? station role may be ? Can you try disabling other role (sta/ap) by bringing down the interface and check if the fwr switch still happens ?

    Unfortunately there is little we can do to help you with this since wl127x is a very old device and there is no active development/support on this.

    Thanks
    Saurabh
  • Yes, I am running the station role and that's the whole point.  I need to be able to run both roles simultaneously.  Here's the scenario:  The computer is a headless system.  You want to be able to configure the station wifi to connect to a router but how do you add that network block to the configuration file?  One way would be to use a static IP ethernet port and cable.  That I can do but it would be far superior to have a wifi direct P2P GO running that you could connect to to do the configuration.

    Now, the above works as long as there is no network block in the wpa_supplicant config file for the station role interface OR if there is a network block, the router specified there is visible and connected.

    What I'm seeing is that the P2P SSID stops being broadcast after several minutes.  Often two but sometimes ten or more.  There is no notice from either wpa_supplicant debug output or from the driver to the system console that the P2P GO has been stopped.

    FYI, if I try to bring down wlan0 and back uponce everything is up, the following happens:

    ifconfig wlan0 down
    [  440.747867] wlcore: down
    [  440.753361] wlcore: down
    [  440.762939] ieee80211 phy0: Hardware restart was requested
    [  441.287528] wlcore: firmware booted (Rev 6.3.10.0.142)

    ifconfig wlan0 up
    [  452.284605] wlcore: down
    [  452.289910] ieee80211 phy0: Hardware restart was requested
    [  452.306646] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    [  452.790195] wlcore: firmware booted (Rev 6.5.7.0.50)

    So it looks like it's booting the right firmware but perhaps it should always load it.  Is there a way to force it to use this firmware even in the single role?
    My next question is who might be responsible for the loss of the P2P SSID? The firmware or the wl12xx driver?  Would putting the kernel in to debug log level help see more information from the driver?

  • The Multi-Role Support for wl12xx has limitations.
    It can only work on the same channel on different roles.
    This could be your issue?

    For example, if you are connected to AP on channel 1 i.e. freq=2412 from your Station role i.e. wlan0 interface,
    You need to start the P2P-GO on other interface( i.e. wlan1 in ur case) in the same channel.

    Please start the station first and connect to an AP of your choice. Check the frequency in which you are connected to using "wpa_cli -iwlan0 signal_poll"
    Now use that frequency to start the P2P-GO.

    BR,
    Eyal
  • Actually, the problem is when the Station role isn't connected to any AP but there are one or more network blocks for APs in the wpa_supplicant configuration file.  For example, you've added a network block for a lab router but now you're in the field and that lab router isn't there (out of range, turned off, etc).  What's weird is that if there are no network blocks in the configuration file, P2P works just fine.

    I'm wondering if it's a driver problem.  I've been perusing the git change history for wl12xx as well as wlcore since April 2015 and I see things like the firmware might not load if the power isn't cycled.  There are also references to P2P Device mode in later releases of the drivers.  At the moment, I'm trying to figure out how to use backports to build current driver sources against the 4.1.15 kernel.  This is not a well-documented process particularly when something doesn't go right.

  • Hi,
    unfortunately we won't be able to debug this issue since wl127x is a very old product and there is no active ongoing development / support on this. As for backports , you can refer to wl18xx build utilities : processors.wiki.ti.com/.../WL18xx_System_Build_Scripts . We haven't tested wl127x with this backport , but it might port those drivers too (cannot confirm )

    Thanks
    Saurabh
  • Yes, I'm well aware of the fact that this is an old device.  Unfortunately, I don't have a choice here unless TI sells a pin-compatible current device.

    I've managed to get Backports to cooperate and compile new drivers.  I will be testing out later today.

    Nobody seems to be answering the question though.  Why would the device appear to be no longer sending beacon frames, which, as I understand it, are what the system uses to announce itself to the world?