|
|
@@ -1,69 +1,38 @@
|
|
|
| Supported Targets | ESP32-H2 |
|
|
|
| ----------------- | -------- |
|
|
|
|
|
|
-# OpenThread radio co-processor (RCP) example
|
|
|
+# OpenThread Radio Co-Processor (RCP) Example
|
|
|
|
|
|
-## Overview
|
|
|
+This example demonstrates an [OpenThread Radio Co-Processor](https://openthread.io/platforms/co-processor).
|
|
|
|
|
|
-This example demonstrates an openthread radio co-processor.
|
|
|
-The RCP can receive/transmit 15.4-type packets, encode and send the packet to the host device.
|
|
|
-You can use the RCP to implement an Openthread sniffer. You cani also connect the RCP to the host device which do not have a 15.4-radio to join in an Openthread network.
|
|
|
+OpenThread RCP doesn't function alone, it needs to work together with a Host and this example covers two common user scenarios:
|
|
|
+- Work with a Host Processor to perform a [Thread Border Router](https://openthread.io/guides/border-router).
|
|
|
+- Work as a [Thread Sniffer](https://openthread.io/guides/pyspinel/sniffer).
|
|
|
|
|
|
-To run this example, an ESP32-H2 board is required.
|
|
|
+## How to use example
|
|
|
|
|
|
-### Config ESP32-H2 uart
|
|
|
+### Hardware Required
|
|
|
|
|
|
-Modify the file `esp_ot_config.h`.
|
|
|
+To run this example, an ESP32-H2 board is required.
|
|
|
|
|
|
-In the file `esp_ot_config.h`, there are three parameters.
|
|
|
-As for `ESP_OPENTHREAD_DEFAULT_RADIO_CONFIG` and `ESP_OPENTHREAD_DEFAULT_PORT_CONFIG`, modification is not recommended.
|
|
|
-As for the parameters in `ESP_OPENTHREAD_DEFAULT_HOST_CONFIG`, you can refer to ESP uart example `example/peripherals/uart/uart_echo/README.md`
|
|
|
+### Configure the project
|
|
|
|
|
|
-### Build, Flash, and Run
|
|
|
+The default communication interface is port 0 of ESP32-H2 UART running at 115200 baud, change the configuration in [esp_ot_config.h](main/esp_ot_config.h) if you want to use another interface or need different communication parameters.
|
|
|
|
|
|
-Build the project and flash it to the board
|
|
|
+### Build and Flash
|
|
|
+
|
|
|
+Build the project and flash it to the board:
|
|
|
|
|
|
```
|
|
|
idf.py -p <PORT> build flash
|
|
|
```
|
|
|
|
|
|
-Now you'll get an ot-rcp (for this example, there is no output in console).
|
|
|
-
|
|
|
-# OpenThread sniffer example (Linux or macOS based)
|
|
|
-
|
|
|
-## Overview
|
|
|
-
|
|
|
-This example is about how to run a sniffer to capture Thread packet, which refers to [openthread.io](https://openthread.io/guides/pyspinel/sniffer).
|
|
|
-Openthread group just supports Linux and macOS.
|
|
|
-
|
|
|
-## How to use example
|
|
|
-
|
|
|
-### Hardware connection
|
|
|
+Now you'll get an OpenThread RCP, you can try the following use cases:
|
|
|
|
|
|
-To run this example, you need an ESP32-H2 borad flashed with ot-rcp application.
|
|
|
+#### Thread Border Router
|
|
|
|
|
|
-### Set up the sniffer environment
|
|
|
+Please refer to [ot_br](../ot_br) example for the setup steps.
|
|
|
|
|
|
-The sniffer tool connects to an openthread RCP device and converts it into a promiscuous packet sniffer. RCP
|
|
|
-will encode and send the packet to host after capturing a 15.4-type packet. On the host, Pyspinel should be run for
|
|
|
-decoding the packet and generating a pcap (packet capture) stream to be saved or piped directly into Wireshark.
|
|
|
-
|
|
|
-Clone and install Pyspinel and dependencies, refer to [openthread.io](https://openthread.io/guides/pyspinel/sniffer#installation).
|
|
|
-
|
|
|
-### Install and config Wireshark
|
|
|
-
|
|
|
-For installing the Wireshark, refer to [Espressif Wireshark User Guide](
|
|
|
-https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wireshark-user-guide.html).
|
|
|
-
|
|
|
-You need to config Wireshark with some properties for the Thread network.
|
|
|
-For Wireshark configuration, refer to [openthread.io](https://openthread.io/guides/pyspinel/sniffer#thread_network_properties).
|
|
|
-
|
|
|
-### Run the sniffer
|
|
|
-
|
|
|
-For example, to sniff on Channel 15 using a device mounted at /dev/ttyUSB0 with the baudrate 115200 in the Wireshark output:
|
|
|
-
|
|
|
-```
|
|
|
-cd ~/pyspinel
|
|
|
-python sniffer.py -c 15 -u /dev/ttyUSB0 --crc -b 115200 | wireshark -k -i -
|
|
|
-```
|
|
|
+#### Thread Sniffer
|
|
|
|
|
|
+Please refer to [Thread Sniffer](https://openthread.io/guides/pyspinel/sniffer) for the detailed instructions.
|