-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wifi: samples: Add offloaded raw tx mode sample
This sample demonstrates the offloaded raw TX packet functionality of the nRF70 device. Signed-off-by: Kapil Bhatt <[email protected]>
- Loading branch information
Showing
12 changed files
with
503 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
doc/nrf/protocols/wifi/advanced_modes/offloaded_raw_tx.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.. _ug_nrf70_developing_offloaded_raw_tx: | ||
|
||
Offloaded raw transmit operation | ||
################################ | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 2 | ||
|
||
The nRF70 series ICs can be used as offloaded raw transmit devices wherein the nRF70 series device can transmit frames at regular intervals utilizing very low power. The contents of the frame as well as parameters such as frequency and channel of transmission etc. are programmable. The major functionality of transmitting the frames is offloaded to the nRF70 device thereby placing very minimal requirements on the host (mainly programming capability) thereby leading to very little host memory requirements (Flash and RAM). | ||
|
||
This can serve as an ideal solution for applications such as indoor navigation and tracking, where the anchor nodes need to do low-power beaconing. Anchor devices can transmit beacon-compliant packets containing tracking/location information inside the BSSID/SSID fields. This information can then be used by the devices that scan for these beacon-compliant packets. | ||
|
||
The Offloaded Raw TX is supported as a separate stand-alone compile-time mode of operation in the Wi-Fi driver and is exclusive to the already existing modes of operation, i.e.: | ||
|
||
1. `Wi-Fi mode` and | ||
2. `Radio Test mode` | ||
|
||
In addition to providing start/stop control over the offloaded raw transmit operation, the driver supports updating the configuration parameters as below: | ||
|
||
Frame contents | ||
Channel of operation | ||
Data rate | ||
Rate flags | ||
Periodicity of transmission | ||
Transmit power | ||
|
||
.. _ug_nrf70_developing_enabling_offloaded_raw_tx: | ||
|
||
Offloaded raw transmit API | ||
************************** | ||
|
||
The offloaded raw transmit functionality offered by nRF70 series ICs can be exercised using the APIs exposed by the driver. The API reference can be found at: | ||
|
||
| Header file: :file:`zephyr/drivers/wifi/nrfwifi/off_raw_tx/off_raw_tx_api.h` | ||
|
||
The usage of the API is demonstrated by the :ref:`Offloaded raw transmit sample <wifi_offloaded_raw_tx_packet_sample>` | ||
|
||
.. _ug_nrf70_developing_offloaded_raw_tx_power_consumption: | ||
|
||
Power consumption | ||
***************** | ||
|
||
The power consumed by the nRF70 device during the offloaded raw TX operation is dependent on: | ||
|
||
1. Operating data rate (e.g. 6 Mbps, MCS0 etc.) : Power consumption decreases as the data rate increases. | ||
2. Payload length : Power consumption increases with the payload length. | ||
3. Periodicity of transmission : Power consumption increases as the period between successive transmissions decreases. | ||
4. Transmit power : Power consumption increases as the transmit power is increased. | ||
|
||
The simulated power profiler can be found at: | ||
https://devzone.nordicsemi.com/power/w/opp/14/online-power-profiler-for-wi-fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Copyright (c) 2022 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(nrf_wifi_offloaded_raw_tx) | ||
|
||
target_sources(app PRIVATE | ||
src/main.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
source "Kconfig.zephyr" | ||
|
||
menu "Offloaded Raw TX sample" | ||
|
||
config GENERATE_MAC_ADDRESS | ||
bool "Random Wi-Fi MAC address" | ||
depends on ENTROPY_GENERATOR | ||
help | ||
MAC address to be used by the sample. This is only used | ||
when the nRF7002 OTP is not programmed with a MAC address. | ||
|
||
config BEACON_INTERVAL | ||
int "Beacon interval in milliseconds" | ||
default 100 | ||
range 20 10000 | ||
help | ||
Time interval (in ms) between beacon transmissions. | ||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
.. _wifi_offloaded_raw_tx_packet_sample: | ||
|
||
Wi-Fi: Offloaded raw TX | ||
####################### | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 2 | ||
|
||
The Offloaded raw TX sample demonstrates how to use the `Offloaded raw TX` APIs provided by the nRF70 driver for transmitting raw packets. | ||
|
||
Requirements | ||
************ | ||
|
||
The sample supports the following development kits: | ||
|
||
.. table-from-sample-yaml:: | ||
|
||
Overview | ||
******** | ||
|
||
The sample generates and broadcasts 802.11 beacon frames as raw TX packets. | ||
As a consequence, the nRF70 Series device can be identified as a Wi-Fi® beaconing device. | ||
|
||
Configuration | ||
************* | ||
|
||
|config| | ||
|
||
Configuration options | ||
===================== | ||
|
||
.. options-from-kconfig:: | ||
|
||
Building and running | ||
******************** | ||
|
||
.. |sample path| replace:: :file:`samples/wifi/offloaded_raw_tx` | ||
|
||
.. include:: /includes/build_and_run_ns.txt | ||
|
||
To build for the nRF7002 DK, use the ``nrf7002dk/nrf5340/cpuapp`` board target. | ||
|
||
.. code-block:: console | ||
west build -p -b nrf7002dk/nrf5340/cpuapp | ||
To be able to generate beacons with random source MAC address and BSSID: | ||
|
||
.. code-block:: console | ||
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_GENERATE_MAC_ADDRESS=y -DCONFIG_ENTROPY_GENERATOR=y | ||
To be able to transmit beacons at a specified interval: | ||
|
||
.. code-block:: console | ||
west build -p -b nrf7002dk/nrf5340/cpuapp -- -DCONFIG_BEACON_INTERVAL=200 | ||
Change the board target as given below for the nRF7002 EK. | ||
|
||
.. code-block:: console | ||
nrf5340dk/nrf5340/cpuapp -- -DSHIELD=nrf7002ek | ||
Testing | ||
======= | ||
|
||
|test_sample| | ||
|
||
#. |connect_kit| | ||
#. |connect_terminal| | ||
|
||
The sample shows the following output: | ||
|
||
.. code-block:: console | ||
*** Booting nRF Connect SDK v2.7.99-cb26b7c84971 *** | ||
*** Using Zephyr OS v3.7.99-9056bece3e70 *** | ||
----- Initializing nRF70 ----- | ||
----- Starting to transmit beacons with the following configuration ----- | ||
SSID: nRF70_off_raw_tx_1 | ||
Period: 200000 | ||
TX Power: 15 | ||
Channel: 1 | ||
Short Preamble: 0 | ||
Number of Retries: 10 | ||
Throughput Mode: Legacy | ||
Rate: 54M | ||
HE GI: 1 | ||
HE LTF: 1 | ||
----- Statistics ----- | ||
Packet sent: 150 | ||
----- Updating configuration to ----- | ||
SSID: nRF70_off_raw_tx_2 | ||
Period: 200000 | ||
TX Power: 11 | ||
Channel: 36 | ||
Short Preamble: 0 | ||
Number of Retries: 10 | ||
Throughput Mode: Legacy | ||
Rate: 12M | ||
HE GI: 1 | ||
HE LTF: 1 | ||
----- Statistics ----- | ||
Packet sent: 299 | ||
----- Stopping transmission ----- | ||
----- Deinitializing nRF70 ----- | ||
|
||
Packets sent out, can be observed in a sniffer capture by filtering the packets by their transmit MAC address or SSID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CONFIG_WIFI=y | ||
CONFIG_WIFI_NRF70=y | ||
CONFIG_NRF70_OFFLOADED_RAW_TX=y | ||
|
||
# Memories | ||
CONFIG_MAIN_STACK_SIZE=4096 | ||
CONFIG_HEAP_MEM_POOL_SIZE=18000 | ||
CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
sample: | ||
description: Wi-Fi Offloaded Raw Tx Packet sample | ||
application | ||
name: Wi-Fi Offloaded Raw Tx Packet sample | ||
tests: | ||
sample.nrf7002.offloaded_raw_tx: | ||
sysbuild: true | ||
build_only: true | ||
integration_platforms: | ||
- nrf7002dk/nrf5340/cpuapp | ||
platform_allow: nrf7002dk/nrf5340/cpuapp | ||
tags: ci_build sysbuild ci_samples_wifi | ||
sample.nrf7002_eks.offloaded_raw_tx: | ||
sysbuild: true | ||
build_only: true | ||
extra_args: SHIELD=nrf7002ek | ||
integration_platforms: | ||
- nrf5340dk/nrf5340/cpuapp | ||
platform_allow: nrf5340dk/nrf5340/cpuapp | ||
tags: ci_build sysbuild ci_samples_wifi |
Oops, something went wrong.