ESP Thread 邊界路由器是採用 FreeRTOS 的實作,搭配 Espressif 的 Wi-Fi 和 802.15.4 SoC 組合運作。
硬體需求:
Espressif 提供 ESP 邊界路由器,將主機 SoC (ESP32-S3) 和 RCP (ESP32-H2) 整合到一個模組中。
您只需將電路板連接到 ESP32-S3 (主要 SoC) 連接埠。主要 SoC 會自動編寫 Thread 輔助處理器的程式。
硬體平台
設定存放區
如要設定環境,請按照官方安裝指南操作。
複製 esp-idf 和 esp-thread-br 存放區。
git clone -b v5.1.2 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh
. ./export.sh
cd ..
git clone -b v1.0 --recursive https://github.com/espressif/esp-thread-br.git
設定 Thread 和 Wi-Fi 網路
邊界路由器會自動加入 Wi-Fi 網路,並在儲存空間內沒有 Thread 網路時,自動建立新的 Thread 網路。 您可以在設定選單中設定聯播網參數:
cd esp-thread-br/examples/basic_thread_border_router
idf.py menuconfig
網路設定項目包括:
- 在 Thread 邊界路由器中啟用自動開始模式:ESP Thread 邊界路由器範例 > 啟用 Thread Border Router 中的自動啟動模式。
- Wi-Fi SSID 和 PSK:範例連線設定 > 使用 Wi-Fi 介面連線
- 執行緒網路參數:元件設定 > OpenThread > 執行緒作業資料集
建構並執行邊界路由器
建構 esp-idf/examples/openthread/ot_rcp
範例。韌體不需要明確刷新至裝置。這組映像檔將納入邊界路由器韌體中,並在首次啟動 (或 RCP 韌體變更) 時刷新至 ESP32-H2 晶片。
cd ${IDF_PATH}/examples/openthread/ot_rcp
idf.py set-target esp32h2
idf.py build
接著返回 basic_thread_border_router
範例資料夾。
cd esp-thread-br/examples/basic_thread_border_router
idf.py set-target esp32s3
idf.py build
idf.py -p
flash monitor
現在您會看見 ESP32S3 監視器中的邊界路由器輸出內容。此外,它也提供互動式 OpenThread 指令列:
state
leader
Done
>
支援的功能
- 外部調試者的邊境代理處。
- IPv6 雙向連線。
- SRP 服務註冊和廣告 Proxy。
- mDNS 探索 Proxy。
- 是 NAT64
- 多點傳播轉送。
- Web GUI 式 REST API。
- OTA。
如要進一步瞭解 ESP Thread 邊界路由器,請參閱 ESP Thread 邊界路由器程式碼研究室。