WiFi-Direct group owner with WICED: how to do?

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

cross mob
ofexc_2213241
Level 1
Level 1

I am completely new to this: Is there any step by step description, how to establish a WiFi-direct connection between my WICED device and an Adroid smartphone?

I think our WICED Smart device will be in group owner roll.

Can I start the WiFi-direct connection with "wiced_network_up(WICED_AP_INTERFACE,...)" or is this the wrong strarting point?

To be more specific according our environement:

We are using WICED Studio 6.2 and are developing on a Murata module with STM32F412 CYW 43438.

Our goal is to exchange data between our WICED device and an android Smartphone over WiFi-direct. (The Data will be in JSON format).

Any help or hint is greatly appreciated

Best regards

Mic

0 Likes
1 Solution

If you want your WICED device to start acting as GO, you can use p2p_go_start command in console. Then you need to figure out whether your android device supports pin mode or PBC mode. In my case, while using OP5,  I sent an invitation from my mobile and the WICED console prompted me start a WPS registrar in PBC mode, which can be done using pbc_registrar_start pbc and you should see the MAC address of your mobile along with the message WPS completed successfully after which you can start the data frame transfer.

Please let me know if you are facing any difficulty in this process. Currently, there is no clean app like snip.apsta just demonstrating all the p2p features but WICED supports all the standard p2p procedures through the console app. You can write your own application based on the existing implementations like snip.wifi_connection_manager, demo.headset, connection_manager library etc (check the p2p section in 43xxx_Wi-Fi/doc/API.html) using the specific functionalities that you mentioned.

View solution in original post

5 Replies
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Please check this help article WICED Wi-Fi Direct Testing (SDK 3.1.2) to get started with. The help article leverages the console commands present in SDK. If you are using wiced_network_up API, you should use WICED_P2P_INTERFACE as the starting point and then set up the group owner from the src available in 43xxx_Wi-Fi/libraries/utilities/command_console/p2p/command_console_p2p.c. You can also check the snip.wifi_connection_manager app which demonstrates GO, GC capabilities of WICED device. Particularly, for the example project bundled with SDK, CYW43438 is not a valid platform, so you have to modify your code for your platform/application accordingly

Thank you for your hints. I will read the article you mentioned.

But what i can say now is, that WICED_P2P_INTERFACE does not work in my code. If I start the network with

networkResult = wiced_network_up(WICED_P2P_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &wifi_config);

networkResult is allways "WICED_ERROR". It seems that WICED_P2P_INTERFACE is not at all implemented in "wicked_network_common.c". If i step into this function with [F5], WICED_P2P_INTERFACE is never handled...

Best regards

Mic

0 Likes

wiced_network_up does not have the P2P interface in the switch case of the underlying implementation which I will pursue internally. But I can confirm the 43438 FW shipped with latest SDK has p2p feature enabled, hence that should not be a limitation.

It's better to check the wifi_connection_manager implementation and implement something similar for your platform if your application strictly demands the functionality done through APIs. Otherwise, you can always use the console commands as mentioned in the blog post for which you should not face any difficulty.

Hi rroy

I do not know, if we need an API or not (use of a clean API would be logical for me, but i do not know what was the idea of Cypress on how to implement and use WiFi-Direct).

For me a little bit confusing is the fact, that there is a smart, clean API with demo code for WLAN AP and STA but not for WiFi-Derect P2P...

Perhaps we can make everything neccessary with the console. The console seems to be a little bit painfull because we have to controll the console functions with arrays of strings of arguments? And the console seems to be relativly encapsulatet in itself and not very open to use from "Outside" (own application/project).

What we need to do (as far as i understood until now) is:

- start "advertising" with a P2P capable WiFi Network as group owner (i think).

   That would be sothing similar to "p2p_go_start" in console or the not working "wiced_network_up(WICED_P2P_INTERFACE...)"

- start the registrar (as far as i have learned from the article you have mentioned).

   That would be sothing similar to "p2p_registrar_start"

And now we are waiting for an android device to connect to us. And we want to exchange data frames with this Android device. I can not find any description or documentation how to mange this. All callbacks I could find are only internally in "command_console_p2p.c".

The section "Connecting to the Group Owner From an Andriod Device" in the article you mentioned is empty, marked as "TBD"!

Is it really the idea, that we have to reverse-engineer the console app just to unterstand how we have to use and implement WiFi-Direct?

I hope you can give us some more tips and hints.

0 Likes

If you want your WICED device to start acting as GO, you can use p2p_go_start command in console. Then you need to figure out whether your android device supports pin mode or PBC mode. In my case, while using OP5,  I sent an invitation from my mobile and the WICED console prompted me start a WPS registrar in PBC mode, which can be done using pbc_registrar_start pbc and you should see the MAC address of your mobile along with the message WPS completed successfully after which you can start the data frame transfer.

Please let me know if you are facing any difficulty in this process. Currently, there is no clean app like snip.apsta just demonstrating all the p2p features but WICED supports all the standard p2p procedures through the console app. You can write your own application based on the existing implementations like snip.wifi_connection_manager, demo.headset, connection_manager library etc (check the p2p section in 43xxx_Wi-Fi/doc/API.html) using the specific functionalities that you mentioned.