The OpenThread CLI exposes configuration and management APIs via a command line interface. This CLI may be used to play with OpenThread and may be used along side additional application code. The OpenThread test scripts use this CLI to execute test cases.
- channel
- childtimeout
- contextreusedelay
- extaddr
- extpanid
- ipaddr
- keysequence
- leaderweight
- masterkey
- mode
- netdataregister
- networkidtimeout
- networkname
- panid
- ping
- prefix
- releaserouterid
- rloc16
- route
- routerupgradethreshold
- scan
- start
- state
- stop
- whitelist
Get the IEEE 802.15.4 Channel value.
$ channel
11
Done
Set the IEEE 802.15.4 Channel value.
$ channel 11
Done
Get the Thread Child Timeout value.
$ childtimeout
300
Done
Set the Thread Child Timeout value.
$ childtimeout 300
Done
Get the CONTEXT_ID_REUSE_DELAY value.
$ contextreusedelay
11
Done
Set the CONTEXT_ID_REUSE_DELAY value.
$ contextreusedelay 11
Done
Get the IEEE 802.15.4 Extended Address.
$ extaddr
0xdead00beef00cafe
Done
Get the Thread Extended PAN ID value.
$ extpanid
0xdead00beef00cafe
Done
Set the Thread Extended PAN ID value.
$ extpanid dead00beef00cafe
Done
List all IPv6 addresses assigned to the Thread interface.
$ ipaddr
fdde:ad00:beef:0:0:ff:fe00:0
fe80:0:0:0:0:ff:fe00:0
fdde:ad00:beef:0:558:f56b:d688:799
fe80:0:0:0:f3d9:2a82:c8d8:fe43
Done
Add an IPv6 address to the Thread interface.
$ ipaddr add 2001::dead:beef:cafe
Done
Delete an IPv6 address from the Thread interface.
$ ipaddr del 2001::dead:beef:cafe
Done
Get the Thread Key Sequence.
$ keysequence
10
Done
Set the Thread Key Sequence.
$ keysequence 10
Done
Get the Thread Leader Weight.
$ leaderweight
128
Done
Set the Thread Leader Weight.
$ leaderweight 128
Done
Get the Thread Master Key value.
$ masterkey
00112233445566778899aabbccddeeff
Done
Set the Thread Master Key value.
$ masterkey 00112233445566778899aabbccddeeff
Done
Get the Thread Device Mode value.
- r: rx-on-when-idle
- s: Secure IEEE 802.15.4 Data Requests
- d: Full Function Device
- n: Full Network Data
$ mode
rsdn
Done
Set the Thread Device Mode value.
- r: rx-on-when-idle
- s: Secure IEEE 802.15.4 Data Requests
- d: Full Function Device
- n: Full Network Data
$ mode rsdn
Done
Register local network data with Thread Leader.
$ netdataregister
Done
Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
$ networkidtimeout
120
Done
Set the NETWORK_ID_TIMEOUT parameter used in the Router role.
$ networkidtimeout 120
Done
Get the Thread Network Name.
$ networkname
OpenThread
Done
Set the Thread Network Name.
$ networkname OpenThread
Done
Get the IEEE 802.15.4 PAN ID value.
$ panid
0xdead
Done
Set the IEEE 802.15.4 PAN ID value.
$ panid 0xdead
Done
Send an ICMPv6 Echo Request.
$ ping fdde:ad00:beef:0:558:f56b:d688:799
16 bytes from fdde:ad00:beef:0:558:f56b:d688:799: icmp_seq=1 hlim=64
Add a valid prefix to the Network Data.
- p: Stateless IPv6 Address Autoconfiguration Preferred flag
- v: Stateless IPv6 Address Autoconfiguration Valid flag
- d: DHCPv6 IPv6 Address Configuration flag
- c: DHCPv6 Other Configuration flag
- s: Stable flag
- r: Default Route flag
- prf: Default router preference, which may be: 'high', 'med', or 'low'.
$ prefix add 2001:dead:beef:cafe::/64 pvsr 0
Done
Invalidate a prefix in the network data.
$ prefix remove 2001:dead:beef:cafe::/64
Done
Release a Router ID that has been allocated by the device in the Leader role.
$ releaserouterid 16
Done
Get the Thread RLOC16 value.
$ rloc16
0xdead
Done
Add a valid prefix to the Network Data.
- s: Stable flag
- prf: Default router preference, which may be: 'high', 'med', or 'low'.
$ route add 2001:dead:beef:cafe::/64 pvsr 0
Done
Invalidate a prefix in the network data.
$ route remove 2001:dead:beef:cafe::/64
Done
Get the ROUTER_UPGRADE_THRESHOLD value.
$ routerupgradethreshold
16
Done
Set the ROUTER_UPGRADE_THRESHOLD value.
$ routerupgradethreshold 16
Done
Perform an IEEE 802.15.4 Active Scan.
- channel: The channel to scan on. If no channel is provided, the active scan will cover all valid channels.
$ scan
| J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm |
+---+------------------+------------------+------+------------------+----+-----+
| 0 | OpenThread | dead00beef00cafe | ffff | f1d92a82c8d8fe43 | 11 | -20 |
Done
Enable OpenThread.
$ start
Done
Disable OpenThread.
$ stop
Done
Add an IEEE 802.15.4 Extended Address to the whitelist.
$ whitelist add dead00beef00cafe
Done
Clear all entries from the whitelist.
$ whitelist clear
Done
Disable MAC whitelist filtering.
$ whitelist disable
Done
Enable MAC whitelist filtering.
$ whitelist enable
Done
Remove an IEEE 802.15.4 Extended Address from the whitelist.
$ whitelist remove dead00beef00cafe
Done