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.

CC3220SF-LAUNCHXL: wi-fi direct

Part Number: CC3220SF-LAUNCHXL

Tool/software:

Hello!
I've been trying to get wifi-direct to work the way I need it for some time now, but I'm not having success, what I'm doing is the following:
- Configuring the CC3220 to work as a station/P2P only as a client and passive when negotiating a connection.
- I am carrying out tests using two cell phones, first I enable wifi-direct on cell 1 and I see through the debug that the CC3220 finds it through the SL_WLAN_EVENT_P2P_DEVFOUND event, then I enable wifi-direct on cell 2, but it is not found by the CC3220.
- If I reverse the order of enabling wifi-direct on cell phones, cell phone 2 is found and cell phone 1 is not.
- If I leave the wifi-direct of both cell phones enabled before initializing the CC3220, both will be found.
I tried changing the network scanning time using SL_WLAN_POLICY_SCAN and searching the list of available networks using the sl_WlanGetNetworkList function, but nothing changed.
Anyway, I need the CC3220 to be able to find new wifi-direct devices within its reach, can anyone help me with this problem?
Thank you very much in advance!

  • So looks like the P2P discovery is only performed until the 1st connection gets established.

    I'll need to check about this and see if there is a way to enable this (other than occasional disconnection).

    I'll update once i find more details.

  • Hello Kobi!

    Firstly thanks for the help.

    If P2P finds devices even after the first connection, it will be great, as I don't make any connections and the CC3220 doesn't find other Wi-Fi Direct devices. It finds it when it starts up, I don't make any connection, I enable the cell phone's Wi-Fi direct and the CC3220 doesn't find it.

  • I see. how much time did you wait for the 2nd device to be found? 

    Have you tried resetting the p2p mode?

    e.g. (tbd: check statuses):

    sl_WlanSetMode(ROLE_STA); 
    sl_Stop(0); 
    sl_Start(NULL,NULL,NULL);
    sl_WlanSetMode(ROLE_P2P); 
    sl_Stop(0); 
    sl_Start(NULL,NULL,NULL);

  • or even just resetting the NWP (staying in P2P mode):

    sl_Stop(0); 
    sl_Start(NULL,NULL,NULL);

  • I ended up doing this, resetting the NWP every 5 seconds, and in my case I'm having to restart the http server too, which after restarting ~10 times stopped working, I tried different ways to restart but was unsuccessful, so I had to abandon the idea.

  • I'm not using P2P, now everything is like a station (STA), but even so, the only way I was able to find other wifi direct networks was by resetting the NWP (which I can't do due to a problem with the http server).
    In the last test I set it to reconfigure the scanning policy and search the list of networks every 10 seconds.

    uint32_t intervalScanInSeconds = 10;
    sl_WlanPolicySet(SL_WLAN_POLICY_SCAN, SL_WLAN_SCAN_POLICY(1, 0), (_u8 *)&intervalScanInSeconds, sizeof(intervalScanInSeconds));
    
    sl_WlanGetNetworkList(0, numNetworks, netEntries);

    *The above code is not complete.

    It didn't work either, I waited 20 seconds to enable wifi direct on cell phone 1, which was found quickly, I waited another 20 seconds and turned on cell phone 2, which was not found, then I turned off cell phone 1, but its network continued to be found by the function sl_WlanGetNetworkList for approximately 6 minutes, no other networks were found.

    Note: The cell phone always finds the CC3220 network, if I try to connect I see the REQUEST reach the CC3220 through debug, but it does not connect.

  • what do you mean by "cell phone always finds the CC3220 network"? This means the CC3220 is in P2P mode.

    P2P discovery shouldn't work with STA mode. The discovery method is a different process than the station scanning.

    Please describe exactly sequence (of sl commands) that you are using.

  • Sorry, I had changed the syscfg files and forgot that there was a setting for P2P in the code.

  • As I want to select the CC3220 with which I want to connect via cell phone, the way I have the greatest chance of success is as an AP, correct? Because I don't know how I can do it by configuring the CC3220 as an STA, would you have any suggestions?

  • what is the nature of the connection? is it for provisioning? have you checked our provisioning docs? (AP mode is used temporarily for the provisioning)

    As a station connected to the same network as the phone - you can use MDNS (fo example) so the devices will find each other and then you can use any IP protocol to connect between them (e.g. HTTP).

    You can also use cc3220 as AP and let the phone connect to it for the communication but it means that the phone will get disconnected from the local network (and the internet) during this time. 

  • Yes, it is for provisioning. I am currently looking at the Application Report SimpleLinkTm Wi-Fi® CC3x20, CC3x3x Device Provisioning document to try a way to use AP mode temporarily to receive network configurations and then connect to this network as an STA.