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: Android Tablet (P2P Group Owner) connecting to multiple CC3220 modules

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Scenario: We want to use Wifi Direct (p2p) to connect:
        Android Tablet as Group Owner
        Multiple CC3220 modules as Clients
The modules must be discoverable by the tablet and the tablet will initiate the connections. The tablet will display a list of discovered modules and the user will choose the modules to connect to.

Hardware/firmware:
        Boards: 2 off, 'CC3220SF-LAUNCHXL' Rev-A
        SDK:    simplelink_cc32xx_sdk_1_40_01_00

Problem: Using the Network Terminal example, I can't get the Android tablet to connect to more than one module.

    Instructions to Reproduce
    -------------------------

    Equipment
    ---------
        Tablet: Nexus 7, Android Version: 6.01
        2 * CC3220SF LaunchXL, running Network Terminal Demo Application

    Steps
    -----
        Modules: power up and connect both to terminal programs.
        Tablet: no Wifi Direct Group in existence. WiFi enabled.

        Module 1 Terminal: type 'p2pstart'.
        Module 2 Terminal: type 'p2pstart'.
        Tablet: within WiFi Direct settings, search for devices.
        Tablet: both modules appear as 'Available'.

        Tablet: connect to Module 1.
        Tablet: Module 1 changes to 'Invited' then indicates 'Connected'.
        Module 1 Terminal: shows 'p2p connection was successfully completed as CLIENT'.
        Tablet: indicates that a group has been formed with the Tablet as Group Owner.

        Tablet: connect to Module 2.
        Tablet: Module 2 changes to 'Invited' and remains 'Invited' indefinitely.
        Module 2 Terminal: No messages are displayed, nothing appears to happen.

        
        
Question: the modules, running the Network Terminal example, accept a connection from the Tablet if no Group exists. How can we make them accept a connection from a Tablet that is already a Group Owner?

Sincerely,
Alison

  • Hi Alison,

    Thanks for your question. Please allow some time for us to get back to you.
  • Hi,

    Just wondered if I could have an update on this? Thank you.
  • Still waiting for an answer.

    Alison

  • Hi Alison,

    For module 1 can you please check exactly which events are triggered in the SimpleLinkWlanEventHandler? Does the SL_WLAN_EVENT_P2P_DEVFOUND event occur?

    Please also check the nexus tablet to make sure there isn't a group limit that may be preventing other devices from joining the group.
  • Hi Austin,

    Thank you for your reply.

    Austin Tanner said:
    Please also check the nexus tablet to make sure there isn't a group limit that may be preventing other devices from joining the group.

    Having used the tablet to connect to Module 1 we can successfully connect to a second tablet, so there would not appear to be 'a group limit'.

    Austin Tanner said:
    For module 1 can you please check exactly which events are triggered in the SimpleLinkWlanEventHandler? Does the SL_WLAN_EVENT_P2P_DEVFOUND event occur?

    To explore this we have tried to connect the modules in two different scenarios:

    Firstly, as described in the original question, we initiated p2pstart on both modules, then connected to Module 1 from the tablet, then tried to connect to Module 2 from the tablet which failed.

    Secondly, we initiated p2pstart on just Module 1, connected to it from the tablet, then initiated p2pstart on Module 2, then tried to connect to it from the tablet, which failed.

    In both cases we captured all terminal output, hence detailing the Events that were triggered. We have included them below and highlighted SL_WLAN_EVENT_P2P_DEVFOUND events in red.

    Best Regards, Alison

    Scenario 1 (initiated p2pstart on both modules, then connected to Module 1 from the tablet, then tried to connect to Module 2 from the tablet which failed)

    Module 1: <p2pstart>


        Terminal 1 Screen:    
            [p2pstart] : Starting NWP in P2P role..

            Device name: cc3220-p2p---3--x

            [p2pstart] : User can stop the P2P connection process by typing 'p2pstop' command.
            user:

            [p2pstart] : Waiting for device to be found ...
            user:


            
    Module 2: <p2pstart>


        Terminal 2 Screen:    
            [p2pstart] : Starting NWP in P2P role..

            Device name: cc3220-p2p---5--x

            [p2pstart] : User can stop the P2P connection process by typing 'p2pstop' command.
            user:

            [p2pstart] : Waiting for device to be found ...
            user:
            [WLAN EVENT] P2P Remote device found
            user:
            [p2pstart] : Waiting for Negotiation request ...
            user:

        Terminal 1 Screen:    
            [WLAN EVENT] P2P Remote device found
            user:
            [p2pstart] : Waiting for Negotiation request ...
            user:

            
            
    Tablet search:


        Terminal 1 Screen:    
            [WLAN EVENT] P2P Remote device found
            user:
            
        Terminal 2 Screen:    
            [WLAN EVENT] P2P Remote device found
            user:
            


    Tablet: connect to Module 1.


        Terminal 1 Screen:    
            [WLAN EVENT] P2P Negotiation request received
            user:
            [p2pstart] : Connecting ...
            [WLAN EVENT] P2P connection was successfully completed as CLIENT
            BSSID is 17:44:49:52:45:43
            user:
            [NETAPP EVENT] IP set to: IPv4=192.168.49.169 , Gateway=192.168.49.1
            user:

            
    Tablet: connect to Module 2.        


        Nothing appears on either Terminal.
        On Tablet Module 2 remains 'invited'.

    Scenario 2 (initiated p2pstart on just Module 1, connected to it from the tablet, then initiated p2pstart on Module 2, then tried to connect to it from the tablet, which failed)

     

    Module 1: <p2pstart>


        Terminal 1 Screen:    
            [p2pstart] : Starting NWP in P2P role..

            Device name: cc3220-p2p---3--x

            [p2pstart] : User can stop the P2P connection process by typing 'p2pstop' command.
            user:

            [p2pstart] : Waiting for device to be found ...
            user:
            [WLAN EVENT] P2P Remote device found
            user:
            [p2pstart] : Waiting for Negotiation request ...
            user:
            

            
    Tablet: connect to Module 1.


        Terminal 1 Screen:    
            [WLAN EVENT] P2P Negotiation request received
            user:
            [p2pstart] : Connecting ...
            [WLAN EVENT] P2P connection was successfully completed as CLIENT
            BSSID is 17:44:49:52:45:43
            user:
            [NETAPP EVENT] IP set to: IPv4=192.168.49.169 , Gateway=192.168.49.1
            user:
            

            
    Module 2: <p2pstart>        


        Terminal 2 Screen:    
            [p2pstart] : Starting NWP in P2P role..

            Device name: cc3220-p2p---5--x

            [p2pstart] : User can stop the P2P connection process by typing 'p2pstop' command.
            user:

            [p2pstart] : Waiting for device to be found ...
            user:
            [WLAN EVENT] P2P Remote device found
            user:
            [WLAN EVENT] P2P Remote device found
            user:
            [p2pstart] : Waiting for Negotiation request ...
            user:
       

        Terminal 1 Screen:    
            No events.

          
    Tablet search:


        Nothing appears on either Terminal but module 2 appears on Tablet as available.
        
        


    Tablet: connect to Module 2. 

        
        Nothing appears on either Terminal.
        On Tablet Module 2 remains 'invited'.

  • Hi,

    We have now downloaded the new sdk (1.50.00.06) and tested it with the same outcome.

    We need an answer to this as our product relies on multiple Wifi Direct connections. If the CC3220 module cannot support this, we will have to abandon it and find an alternative device.

    Can you confirm that it is supported?

    What changes do we need to get it working?

    It is now urgent as it has stalled our project for over a month.

    Please advise, Alison
  • Hi Austin,

    This is becoming urgent. I have added more information to the thread and just wanted to be sure that you had seen it. We really need some answers if we are going to use this part.

    Many thanks in advance,

    Alison

  • Hi Alison,

    Sorry for the delay--I'm just now seeing your follow up posts. I am working to try to reproduce the issue on my setup and will inform you as soon as I have a result.
  • Great, looking forward to your response.

    Alison

  • Hi Austin,

    Have you succeeded in reproducing the problem?

    Best Regards, Alison

  • Hi Alison,

    Yes, I have succeeded in reproducing the problem.  Give me some time to get back to you on whether a fix is available.

  • Hi Alison,

    The network terminal example from the SDK does not support P2P connection with multiple CC3220 modules, but can be easily configured to do so.  

    By default, the p2pstart operation will configure each SimpleLink device with role SL_WLAN_P2P_ROLE_NEGOTIATE--indicating the device can be a client or group owner depending on the Wi-Fi direct negotiator tie-breaker.  For the first connection between the tablet and the SimpleLink device this is fine.  

    For each additional SimpleLink device to be added to the group the device must be configured with SL_WLAN_P2P_ROLE_CLIENT to force the device to client mode.

    You can also refer to the Wi-Fi Direct section for more details in this doc: www.ti.com/.../swru455c.pdf

  • Hi Austin,

    "The network terminal example from the SDK does not support P2P connection with multiple CC3220 modules, but can be easily configured to do so."

    This is great news! However, I am having trouble getting it to work. I have changed the role to 'client' and it doesn't seem to have made any difference.

    In the example project, 'network_terminal_CC3220SF_LAUNCHXL_tirtos_ccs', file wlan_cmd.c, line 1822 it says:

    ret = sl_WlanPolicySet(SL_WLAN_POLICY_P2P, SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_NEGOTIATE, SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF), NULL, 0);

    Based on your instructions I have changed it to:

    ret = sl_WlanPolicySet(SL_WLAN_POLICY_P2P, SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_CLIENT, SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF), NULL, 0);

    I have tried changing one of the modules to 'client role' and connecting to the 'negotiate role' module first. Also, I have made them both 'client role'. In both situations the 2nd module does not connect, there are no messages on the terminal, it just seems to ignore the connection request from the tablet. This is exactly the same as I had before.

    Please send us your working code.

    Best Regards, Alison
  • Hi Austin,

    I've tried this and I can't get it to work (see my last post).

    Any ideas? Can you send me your example code that worked?

    Many Thanks,

    Alison

  • Hi Austin,

    I haven't been able to get this to work. Please see my previous post. If you can just send me your example code that worked I should be able to get mine working and stop pestering you! :)

    Best Regards,

    Alison

  • Hi Austin,

    I tried this and reported back with a full answer 2 and a half weeks ago - it does not work. I've still heard nothing back.

    If you are looking into to it could I at least have a progress report?

    Alison

  • Hi Alison,

    Thanks for your patience.  From SDK 1_40_01_00, I made a few quick changes to the network terminal example to support a second SimpleLink connection to the P2P group.  This worked for my setup, so let me know if you have any issues.  Note that the SSID is the P2P_REMOTE_DEVICE.

    network_terminal_edits.zip

  • Hi Austin,

    Thank you for the example code, this is much appreciated. However, this would appear to be the module connecting to the tablet with prior knowledge of that tablet (SSID).

    As described in the original question, 24th Sept:

    We want to use Wifi Direct (p2p) to connect:
            Android Tablet as Group Owner
            Multiple CC3220 modules as Clients
    The modules must be discoverable by the tablet and the tablet will initiate the connections. The tablet will display a list of discovered modules and the user will choose the modules to connect to.

    The modules will not have any information about the tablet.

    Using the original terminal demo the tablet was able to discover multiple modules, and successfully initiate a connection to a single module. Our problem is that the tablet cannot connect to a second module. When attempting a connection to a second module, no events occur on the module. In this situation we can still use the tablet to initiate a connection to another tablet and complete it successfully, so we can assume the Wifi Direct is still functioning correctly. The problem appears to be with the module.

    Best Regards,

    Alison

  • This did not resolve my issue. Please see my reply.

  • Hi Alison,

    I really appreciate your patience, and thanks for your elaboration on this question!

    Your use case requires the SimpleLink device to reply to a P2P invitation, which is not supported at this time.  Instead the  SimpleLink device must initiate connection.

    Here are the steps you need to take in order to connect a SimpleLink device running as a P2P device to an already existing P2P Group (see also details in the Programmer's Guide):
    • Start the device in P2P role 
    • Perform Scan (section 3.5.4 - Discovering Remote Wi-Fi Direct Peers)
    • Retrieve Scan Results (section 3.5.4 - Retrieve Remote Wi-Fi Direct Peers)
    • Issue connect command to the device that was found in the scan result with the “Device_Name” and security type SL_WLAN_SEC_TYPE_P2P_PBC (=6) (section 3.5.4 - Manual Connection)

    Regards,

    Austin