The Unit Gateway H2 supports running the ESP Thread Border Router SDK with the ESP32 series Wi-Fi SoC. This SDK is built based on ESP-IDF and OpenThread, running the Thread network on the H2, which communicates with the main processor via a serial port.
v5.3.1
for compiling this example.git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v5.3.1 # recommend
./install.sh
. ./export.sh
idf.py
commands used in the subsequent tutorials depend on ESP-IDF. Before running the commands, you need to execute . ./export.sh
in ESP-IDF to activate the relevant environment variables. For detailed instructions, please refer to the
ESP-IDF - ESP32S3 Getting Started Guide
.esp32h2
.main/esp_ot_config.h
and changing line 43 .baud_rate = 460800;
to .baud_rate = 230400;
.cd examples/openthread/ot_rcp
vim main/esp_ot_config.h
# line 43 .baud_rate = 460800; change to .baud_rate = 230400;
cd $IDF_PATH/examples/openthread/ot_rcp
idf.py set-target esp32h2
idf.py build
idf.py flash
git clone https://github.com/Ocean-lhy/esp-thread-br.git
# coreS3
git checkout demo_for_unit_coreS3
cd examples/thread_border_router_credential_sharing
idf.py set-target esp32s3
# core2 v1.0 and v1.1 have different power management chips, AXP192 and AXP2101 respectively, which need to be configured in menuconfig
git checkout demo_for_unit_core2
cd examples/thread_border_router_credential_sharing
idf.py set-target esp32
# core
git checkout demo_for_unit_core
cd examples/thread_border_router_credential_sharing
idf.py set-target esp32
idf.py menuconfig
to enter the configuration page. Configure WiFi information in menuconfig: Component config
-> Example Connection Configuration
idf.py menuconfig
idf.py build
idf.py erase_flash
idf.py flash
1.Connect the Unit Gateway H2 to the main control device PORT.C, and wait for the device to connect to Wi-Fi and the Thread network. After the device initialization is complete, the following information will be displayed:
generate epskc button
factoryreset button
Border router web server URL
generate epskc
button, and the device will generate an epskc, which will be displayed on the screen and can be used for quick network access.wifi -s SSID -p PASSWORD
, and then restart the device.Use Unit Gateway H2 (ESP32-H2) or NanoC6 (ESP32-C6), refer to the example program to flash the OpenThread SimpleCLI example, connect to the Thread network, and view Thread network information.
In the ThreadBorderRouter background, input networkkey
, panid
, channel
to obtain the Thread network's network key, panid, and channel.
In the SimpleCLI example, input configuration commands and start the Thread network
networkkey <networkkey>
panid <panid>
channel <channel>
ifconfig up
thread start
state
to view the Thread network status. If connected as a child/router, the Thread network connection is successful. If established as a leader, the configuration may be incorrect.parent
to view the Thread network's parent node; input extaddr
to view the extended address of this node.extaddr
to view the extended address of this node, which should match the parent extaddr
in the SimpleCLI example.neighbor table
to view the Thread network's neighbor nodes, which should include the node from the SimpleCLI example.