Wifi direct connection time issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

We are developing the wifi direct application  based on the console/p2p etc modules in SDK 3.1.2. The WICED device starts as persistent autonomous group owner. I added the function to measure the wifi direct connection time  from a Android phone. The first connection time is 6~8 seconds. Is there any way to reduce the time less than 2 seconds?

Thanks

0 Likes
9 Replies
JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

Hi,

It would be helpful if you provided more information on your setting.

Which side did you measure the time on? The WICED side or Android side? Where did you insert the measuring part in between?

Did you connect the Android device to the WICED through WPS pbc or pin?

Thanks,

Jaeyoung

0 Likes
Anonymous
Not applicable

Hi,

I measure the time on WICED side. I connect the Android device to the WICED through WPS pbc. The time is between my insert statement wifi_connection_start_time = host_rtos_get_time() in the top of p2p_connection_request_handler() and my insert statement wifi_connection_end_time = (host_rtos_get_time() - wifi_connection_start_time) before WPRINT_APP_INFO(( "p2p_wps_result_handler: WPS completed successfully\n" )) in p2p_wps_result_handler(). The output from the windows terminal is below

Connection Request from:  92:B6:86:7D:81:75     ST

Start the WPS registrar using the following command: 'p2p_registrar_start pbc'

Starting registrar in PBC mode

Starting WPS Registrar

WPS enrollee associated:  92:B6:86:7D:01:75

WPA2 client associated:  92:B6:86:7D:01:75

WPS completed successfully

p2p_wps_result_handler: WPS completed successfully

wifi connection time, 8532

0 Likes

Hi,

I've run the P2P app with the time measurements in the same places as yours and I'm getting around 4024 ms. The 8532 you are getting seems to be quite high.

Looking at your result screen it seems like you are pushing the connection request first and then bringing the WPS registrar up. In that case the time you are measuring would be wps registrar bringup + connection time.

Try doing it in this order and you should see a similar connection time as mine.

1. On the WICED board:

>> p2p_go_start p test 12345678 1

>> p2p_registrar_start pbc

2. On the Android device:

Request for connection to WICED_P2P in the Wi-Fi Direct menu.

Here's a screenshot of my results.

** I've tested it with WICED SDK 3.1.2 on a WCD43362WCD4 board with a connection to a Galaxy S5 device.

p2p_connection.PNG

You could shave off another 100ms if you turn off WPRINT_ENABLE_APP_INFO and WPRINT_ENABLE_WPS_INFO in include/wiced_defaults.c but around 3950ms would be the amount of time needed for connection.

Let me know if this works out for you.

Thanks,

Jaeyoung

Anonymous
Not applicable

Hi,

I added the p2p_registrar_start() after p2p_go_start() below in my code.

void application_start( )

{

       /* Initialize Wiced system */

    wiced_init();

    //Start P2P (p)ersistent  group

    //p2p_go_start p test12345678 1

    char* argv_p2p_go_start[] = {"p2p_go_start", "p", "test", "12345678", "1"};

    if(p2p_go_start( 5, argv_p2p_go_start ) !=0)

    {

        WPRINT_APP_INFO(("p2p_go_start failed\r\n"));

        return;

    }

      //call p2p_registrar_start

      char* argv_p2p_registrar_start[] = {"p2p_registrar_start", "pbc"};

      if(p2p_registrar_start(2,argv_p2p_registrar_start) != 0)

      {

           WPRINT_APP_INFO( ( "p2p_registrar_start() in p2p_connection_request_handler() failed\r\n" ) );

           return;

      }

}

I can get the connection time ~4000 ms only for the first connection. But after I remove the remembered group name and disconnected the WICED_P2P device in the wifi direct menu, then I try to connect the Android phone to the WICED_P2P device and the connection time is still ~8000 ms because In this case the connection time  would still be wps registrar bringup + connection time. How can I start a permanent WPS registrar. It seems to me that the wps registrar only runs a specific period of time, not forever.

Thanks

0 Likes

Hi,

The WPS registrar is programmed to run for two minutes until it is timed out. In the case a device connects using WPS and then disconnects, the registrar does not get started automatically.

If you want to automatically start the registrar every time a device loses connection, you could add code into the p2p_device_disassociation_handler() function in p2p.c to start up the registrar mode again.

Thanks,

Jaeyoung

0 Likes

Hi,

I just checked the 3.3.0 version of P2P and I'm getting a much better connection time of ~2338 ms. You might want to check out the newer SDK.

Thanks,

Jaeyoung

0 Likes
Anonymous
Not applicable

Hi,

I am using the WICED 3.1.2. Where can I get the 3.3.0 version of P2P?

Thanks

0 Likes

Hi there,

I'm sorry it turns out SDK 3.3.0 is a beta version right now and we are preparing to release the official version in a few weeks. We will keep you posted on this update. Thank you for your patience!

Regards,

Jaeyoung

Hello,

The next SDK will be 3.3.1 around August time frame.

0 Likes