esp-idf/examples/openthread/ot_sleepy_device/light_sleep
2024-01-23 16:11:29 +08:00
..
main ci(openthread): Add a test case for openthread sleepy device 2024-01-23 16:11:29 +08:00
CMakeLists.txt feat(openthread): Add deep sleep support for SED 2023-11-03 11:02:56 +08:00
partitions.csv feat(openthread): Add deep sleep support for SED 2023-11-03 11:02:56 +08:00
README.md fix(pm): add mac/bb power down/up prepare for fix esp32c6 pll issue 2023-12-08 08:03:32 +00:00
sdkconfig.ci.sleepy_c6 fix(pm): add mac/bb power down/up prepare for fix esp32c6 pll issue 2023-12-08 08:03:32 +00:00
sdkconfig.ci.sleepy_h2 feat(openthread): Add deep sleep support for SED 2023-11-03 11:02:56 +08:00
sdkconfig.defaults feat(openthread): Add deep sleep support for SED 2023-11-03 11:02:56 +08:00
sdkconfig.defaults.esp32c6 fix(pm): add mac/bb power down/up prepare for fix esp32c6 pll issue 2023-12-08 08:03:32 +00:00
sdkconfig.defaults.esp32h2 fix(pm): add mac/bb power down/up prepare for fix esp32c6 pll issue 2023-12-08 08:03:32 +00:00

Supported Targets ESP32-C6 ESP32-H2

OpenThread Sleepy Device Example

The example demonstrates the Thread Sleepy End Device (SED), the device will enter Light Sleep mode during idle state.

How to use example

Hardware Required

  • Prepare an 802.15.4 SoC development board as an OpenThread Sleepy End Device (SED).
  • Connect the board using a USB cable for power supply and programming.
  • Choose another 802.15.4 SoC as the OpenThread Leader.

Configure the Openthread Dataset

  • Run ot_cli on another 802.15.4 SoC device to create openthread dataset configuration and start an openthread network as the leader.
  • Configure the Openthread dataset using idf.py menuconfig in Component config ---> Openthread ---> Thread Operation Dataset, ensuring that the openthread sleepy device's dataset matches the dataset of the leader.

Build and Flash

Build the project and flash it to the board. Use the following command: idf.py -p <PORT> erase-flash flash monitor.

Example Output

As the example runs, you will see the log output indicating the initialization and operation of OpenThread, including the device joining the OpenThread network as a Sleepy End Device (SED) and periodic polling of the leader.

I (769) btbb_init: btbb sleep retention initialization
I (769) ieee802154: ieee802154 mac sleep retention initialization
I(769) OPENTHREAD:[I] ChildSupervsn-: Timeout: 0 -> 190
I (699) main_task: Returned from app_main()
I (799) OPENTHREAD: OpenThread attached to netif
I(799) OPENTHREAD:[N] Mle-----------: Mode 0x0f -> 0x04 [rx-on:no ftd:no full-net:no]
I(809) OPENTHREAD:[N] Mle-----------: Role disabled -> detached
I (819) OPENTHREAD: netif up
I(1519) OPENTHREAD:[N] Mle-----------: Attach attempt 1, AnyPartition reattaching with Active Dataset
I(2479) OPENTHREAD:[N] Mle-----------: RLOC16 fffe -> 5023
I(2529) OPENTHREAD:[N] Mle-----------: Role detached -> child