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

Other Parts Discussed in Thread: CC3200

Hi,

I'm running the P2P application on the CC3200 with no results. I am using the android SDK example (http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html import from the SDK in Android Studio or Eclipse). To reproduce:

  1. Turn off wifi on Nexus 3 or 5
  2. Turn on wifi
  3. Run Android WiFi Direct application and begin search
  4. run p2p application on CC3200
  5. After terminal attached to CC3200 shows "Connect to cc3200-p2p-device"
  6. In p2p application the STATUS_BIT_P2P_DEV_FOUND goes true
  7. shows up as Peer under Android application
  8. Hit connect on the Android device
  9. Everything hangs here

The simple link layer never sets the STATUS_BIT_P2P_REQ_RECEIVED.

Does anyone have a list of devices that the p2p program proved stable on? Can anyone provide more information on debugging the P2P portion using a debuggable Android platform?

Thanks,

j

  • Hi Jeff,

    I just tried the SDK application multiple times with a nexus 4 mobile and was successfully able to connect every time.

    When you initiate the connection from the android side application should receive 'SL_WLAN_P2P_NEG_REQ_RECEIVED_EVENT' event.

    Can you check if this event is getting triggered?

    Where exactly the application is stuck? Can you pause and check?

    Regards,

    Ankur

  • It stops waiting at:

    line 556 of main.c in the WlanConnect() function:

    while (!IS_P2P_REQ_RCVD(g_ulStatus)) {

  • Can you try connecting using the in build wifi direct feature of you mobile (option available under settings)?

    Regards,

    Ankur

  • Hi Ankur,

    I have with the Nexus 5 and 3 with the same negative results. I went with the Android sample app so I could get to debug. On device detection I get all the information I expect:

    DeviceName: cc3200-p2p-device

    Device Address: 78:XX:XX:XX:XX:XX:XX

    Lots of ancillary info too . . .

    The CC3200 never comes back with negotiation though. What can I look for in the CC3200 p2p application to debug the connection negotiation? Is there a P2P setup (whether it's client/master . . .) that might solve the problem? Are there any suggestions that TI could give that would debug this. I appreciate that a lot of time has gone into making these sample applications just work.

    Can a non-TI employee give a suggestion of a device that the p2p application worked with and if there are any quirks like timing? 

    Thanks,

    jeff

  • Hi Jeff,

    Can you try making the following change in code? This will initiate the connection request from the CC3200 side without waiting for mobile to initiate.

    Inside function definition WlanConnect()

    Before:

        SlSecParams_t secParams = {0};
        long lRetVal = 0;
    
        secParams.Key = (signed char *)P2P_SECURITY_KEY;
        secParams.KeyLen = strlen(P2P_SECURITY_KEY);
        secParams.Type = P2P_SECURITY_TYPE;
    
        lRetVal = sl_WlanConnect((signed char *)P2P_REMOTE_DEVICE,
                                strlen((const char *)P2P_REMOTE_DEVICE), 0,
                                &secParams, 0);
        ASSERT_ON_ERROR(lRetVal);
    
        // Wait till Device acquired an IP in P2P mode
        while(! IS_P2P_REQ_RCVD(g_ulStatus))
        { 
            _SlNonOsMainLoopTask();
        }
    
        // Connect with the device requesting the connection
        lRetVal = sl_WlanConnect((signed char *)g_p2p_dev,
                               strlen((const char *)g_p2p_dev),
                               0, &secParams, 0);
        ASSERT_ON_ERROR(lRetVal);
        
    #ifdef P2P_ROLE_TYPE_NEGOTIATE
        while(! IS_IP_ACQUIRED(g_ulStatus))
    #else
        while(! IS_IP_LEASED(g_ulStatus))
    #endif
        {
            _SlNonOsMainLoopTask();
            if(IS_CONNECT_FAILED(g_ulStatus))
            {
                // Error, connection is failed
                ASSERT_ON_ERROR(NETWORK_CONNECTION_FAILED);
            }
        }

    After:

        SlSecParams_t secParams = {0};
        long lRetVal = 0;
    
        secParams.Key = (signed char *)P2P_SECURITY_KEY;
        secParams.KeyLen = strlen(P2P_SECURITY_KEY);
        secParams.Type = P2P_SECURITY_TYPE;
    
        lRetVal = sl_WlanConnect((signed char *)<your mobile device name>,
                                strlen((const char *)<your mobile device name>), 0,
                                &secParams, 0);
        ASSERT_ON_ERROR(lRetVal);
      
    #ifdef P2P_ROLE_TYPE_NEGOTIATE
        while(! IS_IP_ACQUIRED(g_ulStatus))
    #else
        while(! IS_IP_LEASED(g_ulStatus))
    #endif
        {
            _SlNonOsMainLoopTask();
            if(IS_CONNECT_FAILED(g_ulStatus))
            {
                // Error, connection is failed
                ASSERT_ON_ERROR(NETWORK_CONNECTION_FAILED);
            }
        }

    The role and policy is configured in function P2PConfiguration(). Please refer to application note available under '<cc3200-sdk>/docs/examples/' for details on different possible values.

    You can also try the any_p2p connection policy.

    Regards,

    Ankur

  • Hi Ankur,

    That did get it hooked up thanks! I will go through the changes to make sure I understand what they are.

    Thanks again,

    Jeff