Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/nrf/protocols/wifi/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ If you want to go through an online training course to familiarize yourself with
station_mode/index
scan_mode/index
sap_mode/index
wifi_direct
advanced_modes/index
provisioning/index
regulatory_support
Expand Down
170 changes: 170 additions & 0 deletions doc/nrf/protocols/wifi/wifi_direct.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
.. _ug_wifi_direct:

Wi-Fi Direct (P2P mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should ideally be an upstream docs as this is not specific to nRF70.

#######################

.. contents::
:local:
:depth: 2

Wi-Fi Direct® (also known as Wi-Fi P2P or peer-to-peer mode) enables direct device-to-device connections without requiring a traditional access point.
The nRF70 Series devices support Wi-Fi Direct, allowing you to establish peer-to-peer connections with other Wi-Fi Direct-capable devices.

Building with Wi-Fi Direct support
***********************************
Comment on lines +13 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Building with Wi-Fi Direct support
***********************************
Building with Wi-Fi Direct support
**********************************


To build an application with Wi-Fi Direct support, use the Wi-Fi shell sample with the ``wifi-p2p`` snippet and external flash for firmware patches.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To build an application with Wi-Fi Direct support, use the Wi-Fi shell sample with the ``wifi-p2p`` snippet and external flash for firmware patches.
To build an application with Wi-Fi Direct support, use the :ref:`wifi_shell_sample` sample with the ``wifi-p2p`` snippet and external flash for firmware patches.


Build command
=============

Use the following command to build the Wi-Fi shell sample with P2P support:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the following command to build the Wi-Fi shell sample with P2P support:
To build the Wi-Fi shell sample with Wi-Fi Direct (P2P) support, run the following command:


.. code-block:: console

west build --pristine --board nrf7002dk/nrf5340/cpuapp -S wifi-p2p -S nrf70-fw-patch-ext-flash
west flash

Wi-Fi Direct commands
**********************
Comment on lines +28 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Wi-Fi Direct commands
**********************
Wi-Fi Direct commands
*********************


The following commands are available for Wi-Fi Direct operations.
Both Wi-Fi shell commands and wpa_cli commands are shown for each operation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Both Wi-Fi shell commands and wpa_cli commands are shown for each operation:
Both Wi-Fi shell commands and ``wpa_cli`` commands are provided for each operation.


Finding peers
=============

To start discovering Wi-Fi Direct peers:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To start discovering Wi-Fi Direct peers:
To start discovering Wi-Fi Direct peers, use the following commands:


**Wi-Fi shell command:**

.. code-block:: console

wifi p2p find

**wpa_cli command:**

.. code-block:: console

wpa_cli p2p_find
Comment on lines +39 to +49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use tabs for all the commands.

Suggested change
**Wi-Fi shell command:**
.. code-block:: console
wifi p2p find
**wpa_cli command:**
.. code-block:: console
wpa_cli p2p_find
.. tabs::
.. group-tab:: Wi-Fi shell command
.. code-block:: console
wifi p2p find
.. group-tab:: ``wpa_cli`` command
.. code-block:: console
wpa_cli p2p_find


This command initiates the P2P discovery process. The device will scan for other Wi-Fi Direct-capable devices in range.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This command initiates the P2P discovery process. The device will scan for other Wi-Fi Direct-capable devices in range.
This command initiates the P2P discovery process.
The device scans for other Wi-Fi Direct-capable devices in range.


Listing discovered peers
=========================
Comment on lines +53 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Listing discovered peers
=========================
Listing discovered peers
========================


To view the list of discovered peers:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use tabs instead.

Suggested change
To view the list of discovered peers:
To view the list of discovered peers, use the following commands:


**Wi-Fi shell command:**

.. code-block:: console

wifi p2p peer

**wpa_cli command:**

.. code-block:: console

wpa_cli p2p_peers

This displays a table of discovered peers with the following information:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This displays a table of discovered peers with the following information:
This command displays a table of discovered peers with the following information:


.. code-block:: console

Num | Device Name | MAC Address | RSSI | Device Type | Config Methods
1 | Galaxy S22 | D2:39:FA:43:23:C1 | -58 | 10-0050F204-5 | 0x188

Where:

* **Num** - Sequential number of the peer in the list
* **Device Name** - Friendly name of the peer device
* **MAC Address** - MAC address of the peer device
* **RSSI** - Signal strength in dBm
* **Device Type** - WPS device type identifier
* **Config Methods** - Supported WPS configuration methods
Comment on lines +77 to +84
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Where:
* **Num** - Sequential number of the peer in the list
* **Device Name** - Friendly name of the peer device
* **MAC Address** - MAC address of the peer device
* **RSSI** - Signal strength in dBm
* **Device Type** - WPS device type identifier
* **Config Methods** - Supported WPS configuration methods
The columns in the table represent the following attributes:
* ``Num`` - Sequential number of the peer in the list
* ``Device Name`` - Friendly name of the peer device
* ``MAC Address`` - MAC address of the peer device
* ``RSSI`` - Signal strength in dBm
* ``Device Type`` - WPS device type identifier
* ``Config Methods`` - Supported WPS configuration methods


Getting peer details
====================

To get detailed information about a specific peer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To get detailed information about a specific peer:
To get detailed information about a specific peer, use the following commands:


**Wi-Fi shell command:**

.. code-block:: console

wifi p2p peer <mac_address>

**wpa_cli command:**

.. code-block:: console

wpa_cli p2p_peer <mac_address>

For example:

.. code-block:: console

wpa_cli p2p_peer D2:39:FA:43:23:C1

This displays detailed information about the specified peer device.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This displays detailed information about the specified peer device.
This command displays detailed information about the specified peer device.


Connecting to a peer
====================

To establish a Wi-Fi Direct connection with a discovered peer:

**Wi-Fi shell command:**

.. code-block:: console

wifi p2p connect <mac_address> [pin|pbc] -g <go_intent>

**wpa_cli command:**

.. code-block:: console

wpa_cli p2p_connect <mac_address> <pbc|pin> [go_intent=<0..15>]

Parameters:

* **mac_address** - MAC address of the peer device to connect to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **mac_address** - MAC address of the peer device to connect to
* `<mac_address>` - MAC address of the peer device to connect to

* **pin|pbc** - WPS provisioning method:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **pin|pbc** - WPS provisioning method:
* ``<pbc|pin>`` - WPS provisioning method:


* ``pin`` - Use PIN-based WPS authentication. The command will return a PIN (for example, ``88282282``) that must be entered on the peer device.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* ``pin`` - Use PIN-based WPS authentication. The command will return a PIN (for example, ``88282282``) that must be entered on the peer device.
* ``pin`` - Use PIN-based WPS authentication.
The command will return a PIN (for example, ``88282282``) that must be entered on the peer device.

* ``pbc`` - Use Push Button Configuration (PBC) for WPS authentication.

* **go_intent** - Group Owner (GO) intent value (0-15):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **go_intent** - Group Owner (GO) intent value (0-15):
* ``go_intent`` - Group Owner (GO) intent value ``0-15``:


* Higher values indicate a stronger desire to become the Group Owner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Higher values indicate a stronger desire to become the Group Owner
* Higher values indicate a stronger desire to become the Group Owner.

* Value of 15 forces the device to become the GO
* Value of 0 indicates the device prefers to be a client
Comment on lines +139 to +140
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Value of 15 forces the device to become the GO
* Value of 0 indicates the device prefers to be a client
* Value of ``15`` forces the device to become the GO.
* Value of ``0`` indicates the device prefers to be a client.


Example connection with PIN method:

**Wi-Fi shell command:**

.. code-block:: console

wifi p2p connect D2:39:FA:43:23:C1 pin -g 0

**wpa_cli command:**

.. code-block:: console

wpa_cli p2p_connect D2:39:FA:43:23:C1 pin go_intent=0

The command will output a PIN (for example, ``88282282``) that should be entered on the peer device to complete the connection.

To disconnect from a Wi-Fi Direct connection:

**Wi-Fi shell command:**

.. code-block:: console

wifi disconnect

**wpa_cli command:**

.. code-block:: console

wpa_cli disconnect
22 changes: 22 additions & 0 deletions snippets/wifi-p2p/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _snippet-wifi-p2p:

Wi-Fi P2P Snippet (wifi-p2p)
##########################################
Comment on lines +3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Wi-Fi P2P Snippet (wifi-p2p)
##########################################
Wi-Fi P2P Snippet (wifi-p2p)
############################


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some description.

.. code-block:: console

west build -S wifi-p2p [...]

Overview
********

This snippet enables Wi-Fi P2P support in supported networking samples.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything else to add?

Suggested change
This snippet enables Wi-Fi P2P support in supported networking samples.
This snippet enables Wi-Fi P2P support in supported networking samples.


Requirements
************

Hardware support for:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some intro text.

Suggested change
Hardware support for:
Hardware support for:


- :kconfig:option:`CONFIG_WIFI`
- :kconfig:option:`CONFIG_WIFI_USE_NATIVE_NETWORKING`
- :kconfig:option:`CONFIG_WIFI_NM_WPA_SUPPLICANT`
3 changes: 3 additions & 0 deletions snippets/wifi-p2p/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: wifi-p2p
append:
EXTRA_CONF_FILE: wifi-p2p.conf
6 changes: 6 additions & 0 deletions snippets/wifi-p2p/wifi-p2p.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_NRF70_P2P_MODE=y
CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P=y
CONFIG_WPA_CLI=y
CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF=y
CONFIG_LTO=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment as to why this is needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and why is this needed? Also why is the log level changed?

CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
4 changes: 2 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 2c6007378cbf84131179879ea677ac3441e02020
revision: pull/3452/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down Expand Up @@ -145,7 +145,7 @@ manifest:
- name: nrfxlib
repo-path: sdk-nrfxlib
path: nrfxlib
revision: 36ba54ade9f72909dff5fc1268eb59eb6e289f2d
revision: pull/1902/head
- name: trusted-firmware-m
repo-path: sdk-trusted-firmware-m
path: modules/tee/tf-m/trusted-firmware-m
Expand Down