|
@@ -34,7 +34,7 @@ Enable `OPENTHREAD_BR_AUTO_START`, configure the `CONFIG_EXAMPLE_WIFI_SSID` and
|
|
|
The device will connect to Wi-Fi and form a Thread network automatically after bootup.
|
|
The device will connect to Wi-Fi and form a Thread network automatically after bootup.
|
|
|
|
|
|
|
|
- Manual mode
|
|
- Manual mode
|
|
|
-Disable `OPENTHREAD_BR_AUTO_START`, and use the CLI command to configure the Wi-Fi and form Thread network manually.
|
|
|
|
|
|
|
+Disable `OPENTHREAD_BR_AUTO_START` and enable `OPENTHREAD_CLI_ESP_EXTENSION`. `wifi` command will be added for connecting the device to the Wi-Fi network.
|
|
|
|
|
|
|
|
### Build, Flash, and Run
|
|
### Build, Flash, and Run
|
|
|
|
|
|
|
@@ -43,57 +43,58 @@ Build the project and flash it to the board, then run monitor tool to view seria
|
|
|
```
|
|
```
|
|
|
idf.py -p PORT build flash monitor
|
|
idf.py -p PORT build flash monitor
|
|
|
```
|
|
```
|
|
|
-If the OPENTHREAD_BR_AUTO_START option is enabled, The device will be connected to the configured Wi-Fi and Thread network automatically then act as the border router.
|
|
|
|
|
|
|
+If the `OPENTHREAD_BR_AUTO_START` option is enabled, The device will be connected to the configured Wi-Fi and Thread network automatically then act as the border router.
|
|
|
|
|
|
|
|
-Otherwise, you need to manually configure the Wi-Fi and Thread network with CLI command.
|
|
|
|
|
|
|
+Otherwise, you need to manually configure the networks with CLI commands.
|
|
|
|
|
|
|
|
-Command `sta` is used for connecting WiFi.
|
|
|
|
|
|
|
+`wifi` command can be used to configure the Wi-Fi network.
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
-> sta
|
|
|
|
|
----wifi sta parameter---
|
|
|
|
|
|
|
+> wifi
|
|
|
|
|
+--wifi parameter---
|
|
|
|
|
+connect
|
|
|
-s : wifi ssid
|
|
-s : wifi ssid
|
|
|
-p : wifi psk
|
|
-p : wifi psk
|
|
|
---example---
|
|
---example---
|
|
|
-join a wifi,
|
|
|
|
|
-ssid: threadcertAP
|
|
|
|
|
-psk: threadcertAP : sta -s threadcertAP -p threadcertAP
|
|
|
|
|
-Done
|
|
|
|
|
-> sta -s threadcertAP -p threadcertAP
|
|
|
|
|
|
|
+join a wifi:
|
|
|
ssid: threadcertAP
|
|
ssid: threadcertAP
|
|
|
-psk: threadcertAP
|
|
|
|
|
-I (47043) wifi:wifi driver task: 3ffd05ac, prio:23, stack:6656, core=0
|
|
|
|
|
|
|
+psk: threadcertAP : wifi connect -s threadcertAP -p threadcertAP
|
|
|
|
|
+state : get wifi state, disconnect or connect
|
|
|
|
|
+---example---
|
|
|
|
|
+get wifi state : wifi state
|
|
|
|
|
+Done
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
|
|
+To join a Wi-Fi network, please use the `wifi connect` command:
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+> wifi connect -s threadcertAP -p threadcertAP
|
|
|
|
|
+ssid: threadcertAP
|
|
|
|
|
+psk: threadcertAP
|
|
|
|
|
+I (11331) wifi:wifi driver task: 3ffd06e4, prio:23, stack:6656, core=0
|
|
|
|
|
+I (11331) system_api: Base MAC address is not set
|
|
|
|
|
+I (11331) system_api: read default base MAC address from EFUSE
|
|
|
|
|
+I (11341) wifi:wifi firmware version: 45c46a4
|
|
|
|
|
+I (11341) wifi:wifi certification version: v7.0
|
|
|
|
|
|
|
|
-......
|
|
|
|
|
|
|
|
|
|
|
|
+..........
|
|
|
|
|
|
|
|
-I (49263) wifi:AP's beacon interval = 102400 us, DTIM period = 1
|
|
|
|
|
-I (50233) esp_netif_handlers: sta ip: 192.168.3.10, mask: 255.255.255.0, gw: 192.168.3.1
|
|
|
|
|
|
|
+I (13741) esp_netif_handlers: sta ip: 192.168.3.10, mask: 255.255.255.0, gw: 192.168.3.1
|
|
|
|
|
+W (13771) wifi:<ba-add>idx:0 (ifx:0, 02:0f:c1:32:3b:2b), tid:0, ssn:2, winSize:64
|
|
|
wifi sta is connected successfully
|
|
wifi sta is connected successfully
|
|
|
Done
|
|
Done
|
|
|
->
|
|
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-Command `wifiinfo` is used for checking the state of Wi-Fi connection and printing IP addresses.
|
|
|
|
|
|
|
+To get the state of the Wi-Fi network:
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
-> wifiinfo
|
|
|
|
|
----get WiFi informations---
|
|
|
|
|
--i : get sta addr
|
|
|
|
|
--s : get wifi state, disconnect or connect
|
|
|
|
|
-Done
|
|
|
|
|
-> wifiinfo -s
|
|
|
|
|
|
|
+> wifi state
|
|
|
connected
|
|
connected
|
|
|
Done
|
|
Done
|
|
|
-> wifiinfo -i
|
|
|
|
|
-inet 192.168.3.10
|
|
|
|
|
-inet6 FE80::7AE3:6DFF:FECD:125C
|
|
|
|
|
-Done
|
|
|
|
|
->
|
|
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-For forming Thread network, you can refer to [ot_cli_README](../ot_cli/README.md)
|
|
|
|
|
|
|
+For forming the Thread network, please refer to the [ot_cli_README](../ot_cli/README.md).
|
|
|
|
|
|
|
|
## Example Output
|
|
## Example Output
|
|
|
|
|
|
|
@@ -115,7 +116,7 @@ I(8159) OPENTHREAD:[NOTE]-MLE-----: Role Detached -> Leader
|
|
|
```
|
|
```
|
|
|
## Using the border agent feature
|
|
## Using the border agent feature
|
|
|
|
|
|
|
|
-You need to ot-commissioner on the host machine and another Thread end device running OpenThread cli.
|
|
|
|
|
|
|
+You need to build ot-commissioner on the host machine and another Thread end device running OpenThread cli.
|
|
|
|
|
|
|
|
You can find the guide to build and run ot-commissioner [here](https://openthread.io/guides/commissioner/build).
|
|
You can find the guide to build and run ot-commissioner [here](https://openthread.io/guides/commissioner/build).
|
|
|
|
|
|