Skip to content

Commit

Permalink
Pull request project-chip#698: [Wi-Fi] Updated document for wifi slee…
Browse files Browse the repository at this point in the history
…py devices

Merge in WMN_TOOLS/matter from feature/wifi_NewFeature_doc_update to silabs

Squashed commit of the following:

commit 1e10c3f53935745dc8ed0a13001ee279ab4c3e64
Author: Mathieu Kardous <[email protected]>
Date:   Fri May 5 10:26:25 2023 -0400

    Add Wi-Fi low power section

commit c0d91a5edb75c1f831708a5b21bc78f6d36025f9
Author: senthil kumar E K <[email protected]>
Date:   Fri May 5 16:33:24 2023 +0530

    updated review comments releated to WiFi Station

commit f69f22246db17a637f66ea732413b8db7ccb0da6
Merge: 889affc08d c6de514b8f
Author: Ezra Hale <[email protected]>
Date:   Thu May 4 16:08:32 2023 -0400

    Merge branch 'silabs' of ssh://stash.silabs.com/wmn_tools/matter into feature/wifi_NewFeature_doc_update

     Conflicts:
    	docs/silabs/README.md

... and 46 more commits
  • Loading branch information
senthilku authored and jmartinez-silabs committed Jan 9, 2024
1 parent ad90f01 commit 655ba46
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/silabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
4. [Ozone Environment Setup for the SiWx917 SoC](wifi/SiWx917_Enablement_For_Ozone.md)
5. [Flashing the SiWx917 SoC](general/FLASH_SILABS_SiWx917_SOC_DEVICE.md)
6. [Running the Matter Demo on SiWx917 SoC](wifi/RUN_DEMO_SiWx917_SoC.md)
7. [Matter Wi-Fi Direct Internet Connectivity(DIC)](wifi/DIC_Wi-Fi.md)
7. [Matter Wi-Fi Sleepy End Devices](wifi/WIFI_SLEEPY_END_DEVICE.md)
8. [Matter Wi-Fi Sleepy End Device Power Measurement](wifi/WIFI_Sleepy_Device_Power_Measurement.md)
9. [Matter Wi-Fi Direct Internet Connectivity(DIC)](wifi/DIC_Wi-Fi.md)

6. Matter Bridging to Zigbee/Z-Wave

Expand Down
85 changes: 85 additions & 0 deletions docs/silabs/wifi/WIFI_SLEEPY_END_DEVICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Matter Sleepy End Devices over Wi-Fi

This page explains how Matter Wi-Fi Sleepy End devices (SEDs) work and how to configure a Matter Wi-Fi SED example.

## Overview

Matter provides a Sleepy End Device (SED) operating mode to extend the battery life of a power-limited devices. This operating mode leverages native Wi-Fi functionality to enhance the power management features provided within the Matter protocol.

Wi-Fi module power saving is achieved by the Wi-Fi Station notifying the Access Point (AP) that it is entering its power save (PS) mode. Afterwards, the Wi-Fi station will shut down its RF and Wi-Fi SoC blocks to enter power saving mode.

The Access Point (AP) buffers the frames destined to a Wi-Fi station while it is in power save mode. The Access Point (AP) will send the buffered frames to the Wi-Fi station when requested to do so.

During association, the Wi-Fi Station uses the Delivery Traffic Information Map (DTIM) parameter to get from the Access Point (AP) how many beacon intervals it shall spend in sleep mode before it needs to retrieve the queued frames from the Access Point (AP).

Wi-Fi module sleep is implemented by using the PS-Poll Legacy Power Save (DTIM based) method. EFR sleep is implemented by using the power manager component (EM2).

> **Note**: Wi-Fi module sleep is enabled after successful commissioning and EFR sleep is enabled after system bootup.
> **Note**: Wi-Fi is implemented with DTIM-based sleep, since the operational discovery packet is a broadcast packet that will not be buffered by the Wi-Fi router.
## Power Save Methods

### Deep Sleep Power Save Mode for EFR32
The EFR32 will go into deep sleep (EM2) power save mode by using the power manager module. The power manager is used to transition the system to a power mode when the application is the Idle Task.

In EM2 energy mode, all high frequency clock sources are shut down. Peripherals that require a high frequency clock are unavailable or have limited functionality.

### PS-Poll Legacy Power Save for Wi-Fi Module

The PS-Poll Legacy power save mode leverages the PS-Poll frame to retrieve the buffered frames from the Access Point (AP). The PS-Poll frame is a short Control Frame containing the Association Identifier (AID) value of the Wi-Fi station.
In the Legacy power save mode, when the Wi-Fi station receives a beacon with its Association Identifier (AID) in the TIM element, it initiates the buffered frame delivery by transmitting a PS-POLL control frame to the Access Point (AP).
The AP acknowledges the PS-Poll frame and responds with a single buffered frame.

In this mode, the Wi-Fi station stays active and retrieves a single buffered frame at a time. The AP also indicates that there are more buffered frames for the station using the More Data subfield.
The Wi-Fi station continues to retrieve buffered frames using the PS-Poll frame until there are no more buffered frames and the More Data subfield is set to 0. The Wi-Fi station goes back into the sleep aterwards.

A Wi-Fi station can enter sleep mode after sending a Null frame to the AP with the power management (PM) bit set. From then on, the AP will store all packets destined to the Wi-Fi station in a per-device queue and sets the TIM field in the beacon frame to indicate that packets destined for the Wi-Fi station have been queued.

The Wi-Fi station wakes up to receive buffered traffic for every Delivery Traffic Indication Message (DTIM) beacon.
When it detects that the Traffic Indication Map (TIM) field for it has been set, it sends a PS-Poll control frame to the AP.

### Delivery Traffic Indication Message (DTIM)

A Wi-Fi station in DTIM Power Save mode can wake at any time to transmit uplink traffic, but can only receive downlink traffic (broadcast, multicast or unicast) immediately after receiving a DTIM beacon.
In order to inform the Wi-Fi station in Power Save mode that the access point has buffered downlink traffic, the access point uses the Traffic Indication Map element present in the beacon frames.
The Wi-Fi station in Power Save mode wakes up to receive the DTIM beacon and checks the status of the TIM element. This element indicates whether any frames need to be retrieved from the Access Point (AP).

> **Note**: The DTIM parameter can be configured on the access point settings.
## Building

### Enabling Sleepy Functionalities

To enable sleepy functionality, the `enable_sleepy_device` build argument needs to be set to true. It will enable the following macro: `CHIP_DEVICE_CONFIG_ENABLE_SED`

Here is an example to build the lock-app as an SED for the EFR32MG24 + RS9116.
```bash
./scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/rs9116/lock_sleep BRD41xxx enable_sleepy_device=true disable_lcd=true use_external_flash=false chip_enable_ble_rs911x=true --wifi rs9116
```
Here is an example to build the lock-app as an SED for the EFR32MG24 + RS917 (NCP).
```bash
./scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/SiWx917/lock_sleep BRD41xxx enable_sleepy_device=true disable_lcd=true use_external_flash=false chip_enable_ble_rs911x=true --wifi SiWx917
```

Here is an example to build the lock-app as an SED for the EFR32MG24 + WF200.
```bash
./scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/wf200_lock_sleep BRD41xxx enable_sleepy_device=true chip_build_libshell=false --wifi wf200
```

> **Note**: The power save feature is not enabled for the RS917 SoC.
### Minimal Power Consumption

Simply enabling Sleepy functionalities does not give the application the best power consumption.
By default, several features that increase power consumption are enabled in the example applications.
The following set of features increase power consumption.

- Matter Shell
- LCD and Qr Code

To achieve the most power-efficient build, add these build arguments to the build command to disable all power-consuming features.

```bash
./scripts/examples/gn_efr32_example.sh examples/lock-app/silabs/efr32/ out/SiWx917/lock_sleep BRD41xxx enable_sleepy_device=true disable_lcd=true show_qr_code=false use_external_flash=false chip_build_libshell=false chip_enable_ble_rs911x=true --wifi SiWx917
``````
44 changes: 44 additions & 0 deletions docs/silabs/wifi/WIFI_Sleepy_Device_Power_Measurement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Power Measurements for Wi-Fi Devices

This page explains how to measure the power values for EFR and Wi-Fi co-processor.

### EFR32 + RS9116 Setup for Sleepy Devices

![Power measurment GPIO pin connection for 9116](./images/WiFi_9116_GPIO_Connection.png)

> Note: The following GPIO pins should be connected for 9116 and Host handshakes. \
pin 7 and 9 to UULP_2 and UULP_0 respectively.

## Using Simplicity Studio Energy Profiler for Current Measurement

After flashing the Matter application to the module, Energy profiler or a power meter can be used for power measurements.

![Power measurment connection overview](./images/WiFi_PowerSave_Overview.png)

In Simplicity Studio, click **Tools** on the toolbar, select Energy Profiler, and click "OK".

![Power measurment PowerProfiler](./images/WiFi_PowerProfiler.png)

From the Quick Access or Profiler menu, select 'Start Energy Capture'.

![Power measurment using PowerProfiler](./images/WiFi_PowerProfiler_start.png)

> **Note**: A quick-start guide on the Energy Profiler user interface is in the Simplicity Studio User's Guide's [Energy Profiler User Interface section](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-tools-energy-profiler/energy-profiler-user-interface).
## Power Consumption Measurment (EFR) Using Energy Profiler

Analyze the power values using Energy Profiler.
![Power measurment for EFR using EnergyProfiler](./images/WiFi_EFR_Power_EnergyProfiler.png)

## Power Consumption mMasurment Using a Power Meter

### Power Consumption Measurement Pins for RS9116 Evk Boards
![Power measurment pins for NCP mode](./images/WiFi_9116_PowerMeter_WiFiModule.png)

### Power Consumption Measurement Pins for EXP Boards
![Power measurment pins for NCP mode](./images/SiWx917_Ncp_PowerMeasurment_pins.png)

The power meter's negative probe is used for pin-1 and the positive probe is used for pin-2.

Analyze the power values using the power meter.
![Power measurment for 9116/917 using power meter](./images/WiFi_9116_Power_PowerProfiler.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/silabs/wifi/images/WiFi_PowerProfiler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 655ba46

Please sign in to comment.