xref: /aosp_15_r20/external/openthread/src/cli/README_COMMISSIONER.md (revision cfb92d1480a9e65faed56933e9c12405f45898b4)
1*cfb92d14SAndroid Build Coastguard Worker# OpenThread CLI - Commissioner
2*cfb92d14SAndroid Build Coastguard Worker
3*cfb92d14SAndroid Build Coastguard Worker## Overview
4*cfb92d14SAndroid Build Coastguard Worker
5*cfb92d14SAndroid Build Coastguard WorkerThe Commissioner is an entity that can add new Thread devices securely to a Thread network. It also can manage a Thread network by changing network configuration parameters ([Operational Datasets](README_DATASET.md)) or sending specific management/diagnostic commands to selected Thread devices. Before a Commissioner can do its tasks, it has to petition to the Leader to get permission to become the Commissioner.
6*cfb92d14SAndroid Build Coastguard Worker
7*cfb92d14SAndroid Build Coastguard Worker## Quick Start
8*cfb92d14SAndroid Build Coastguard Worker
9*cfb92d14SAndroid Build Coastguard WorkerSee [README_COMMISSIONING.md](README_COMMISSIONING.md).
10*cfb92d14SAndroid Build Coastguard Worker
11*cfb92d14SAndroid Build Coastguard Worker## Command List
12*cfb92d14SAndroid Build Coastguard Worker
13*cfb92d14SAndroid Build Coastguard Worker- [help](#help)
14*cfb92d14SAndroid Build Coastguard Worker- [announce](#announce)
15*cfb92d14SAndroid Build Coastguard Worker- [energy](#energy)
16*cfb92d14SAndroid Build Coastguard Worker- [joiner add](#joiner-add)
17*cfb92d14SAndroid Build Coastguard Worker- [joiner remove](#joiner-remove)
18*cfb92d14SAndroid Build Coastguard Worker- [joiner table](#joiner-table)
19*cfb92d14SAndroid Build Coastguard Worker- [mgmtget](#mgmtget)
20*cfb92d14SAndroid Build Coastguard Worker- [mgmtset](#mgmtset)
21*cfb92d14SAndroid Build Coastguard Worker- [panid](#panid)
22*cfb92d14SAndroid Build Coastguard Worker- [provisioningurl](#provisioningurl)
23*cfb92d14SAndroid Build Coastguard Worker- [sessionid](#sessionid)
24*cfb92d14SAndroid Build Coastguard Worker- [start](#start)
25*cfb92d14SAndroid Build Coastguard Worker- [state](#state)
26*cfb92d14SAndroid Build Coastguard Worker- [stop](#stop)
27*cfb92d14SAndroid Build Coastguard Worker
28*cfb92d14SAndroid Build Coastguard Worker## Command Details
29*cfb92d14SAndroid Build Coastguard Worker
30*cfb92d14SAndroid Build Coastguard Worker### help
31*cfb92d14SAndroid Build Coastguard Worker
32*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner help`
33*cfb92d14SAndroid Build Coastguard Worker
34*cfb92d14SAndroid Build Coastguard WorkerPrint commissioner help menu.
35*cfb92d14SAndroid Build Coastguard Worker
36*cfb92d14SAndroid Build Coastguard Worker```bash
37*cfb92d14SAndroid Build Coastguard Worker> commissioner help
38*cfb92d14SAndroid Build Coastguard Workerhelp
39*cfb92d14SAndroid Build Coastguard Workerannounce
40*cfb92d14SAndroid Build Coastguard Workerenergy
41*cfb92d14SAndroid Build Coastguard Workerjoiner
42*cfb92d14SAndroid Build Coastguard Workermgmtget
43*cfb92d14SAndroid Build Coastguard Workermgmtset
44*cfb92d14SAndroid Build Coastguard Workerpanid
45*cfb92d14SAndroid Build Coastguard Workerprovisioningurl
46*cfb92d14SAndroid Build Coastguard Workersessionid
47*cfb92d14SAndroid Build Coastguard Workerstart
48*cfb92d14SAndroid Build Coastguard Workerstop
49*cfb92d14SAndroid Build Coastguard WorkerDone
50*cfb92d14SAndroid Build Coastguard Worker```
51*cfb92d14SAndroid Build Coastguard Worker
52*cfb92d14SAndroid Build Coastguard Worker### announce
53*cfb92d14SAndroid Build Coastguard Worker
54*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner announce <mask> <count> <period> <destination>`
55*cfb92d14SAndroid Build Coastguard Worker
56*cfb92d14SAndroid Build Coastguard WorkerSend a `MGMT_ANNOUNCE_BEGIN` message.
57*cfb92d14SAndroid Build Coastguard Worker
58*cfb92d14SAndroid Build Coastguard Worker- mask: Bitmask identifying channels to send MLE Announce messages.
59*cfb92d14SAndroid Build Coastguard Worker- count: Number of MLE Announce transmissions per channel.
60*cfb92d14SAndroid Build Coastguard Worker- period: Period between successive MLE Announce transmissions (milliseconds).
61*cfb92d14SAndroid Build Coastguard Worker- destination: IPv6 destination for the message (may be multicast).
62*cfb92d14SAndroid Build Coastguard Worker
63*cfb92d14SAndroid Build Coastguard Worker```bash
64*cfb92d14SAndroid Build Coastguard Worker> commissioner announce 0x00050000 2 32 fdde:ad00:beef:0:0:ff:fe00:c00
65*cfb92d14SAndroid Build Coastguard WorkerDone
66*cfb92d14SAndroid Build Coastguard Worker```
67*cfb92d14SAndroid Build Coastguard Worker
68*cfb92d14SAndroid Build Coastguard Worker### energy
69*cfb92d14SAndroid Build Coastguard Worker
70*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner energy <mask> <count> <period> <scanDuration> <destination>`
71*cfb92d14SAndroid Build Coastguard Worker
72*cfb92d14SAndroid Build Coastguard WorkerSend a `MGMT_ED_SCAN` message.
73*cfb92d14SAndroid Build Coastguard Worker
74*cfb92d14SAndroid Build Coastguard Worker- mask: Bitmask identifying channels to perform IEEE 802.15.4 ED Scans.
75*cfb92d14SAndroid Build Coastguard Worker- count: Number of IEEE 802.15.4 ED Scans per channel.
76*cfb92d14SAndroid Build Coastguard Worker- period: Period between successive IEEE 802.15.4 ED Scans (milliseconds).
77*cfb92d14SAndroid Build Coastguard Worker- scanDuration: IEEE 802.15.4 ScanDuration to use when performing an IEEE 802.15.4 ED Scan (milliseconds).
78*cfb92d14SAndroid Build Coastguard Worker- destination: IPv6 destination for the message (may be multicast).
79*cfb92d14SAndroid Build Coastguard Worker
80*cfb92d14SAndroid Build Coastguard WorkerThe contents of `MGMT_ED_REPORT` messages (i.e. Channel Mask and Energy List) are printed as they are received.
81*cfb92d14SAndroid Build Coastguard Worker
82*cfb92d14SAndroid Build Coastguard Worker```bash
83*cfb92d14SAndroid Build Coastguard Worker> commissioner energy 0x00050000 2 32 1000 fdde:ad00:beef:0:0:ff:fe00:c00
84*cfb92d14SAndroid Build Coastguard WorkerDone
85*cfb92d14SAndroid Build Coastguard WorkerEnergy: 00050000 0 0 0 0
86*cfb92d14SAndroid Build Coastguard Worker```
87*cfb92d14SAndroid Build Coastguard Worker
88*cfb92d14SAndroid Build Coastguard Worker### joiner add
89*cfb92d14SAndroid Build Coastguard Worker
90*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner joiner add <eui64>|<discerner> <pskd> [timeout]`
91*cfb92d14SAndroid Build Coastguard Worker
92*cfb92d14SAndroid Build Coastguard WorkerAdd a Joiner entry.
93*cfb92d14SAndroid Build Coastguard Worker
94*cfb92d14SAndroid Build Coastguard Worker- eui64: The IEEE EUI-64 of the Joiner or '\*' to match any Joiner.
95*cfb92d14SAndroid Build Coastguard Worker- discerner: The Joiner discerner in format `number/length`.
96*cfb92d14SAndroid Build Coastguard Worker- pskd: Pre-Shared Key for the Joiner.
97*cfb92d14SAndroid Build Coastguard Worker- timeout: joiner timeout in seconds.
98*cfb92d14SAndroid Build Coastguard Worker
99*cfb92d14SAndroid Build Coastguard Worker```bash
100*cfb92d14SAndroid Build Coastguard Worker> commissioner joiner add d45e64fa83f81cf7 J01NME
101*cfb92d14SAndroid Build Coastguard WorkerDone
102*cfb92d14SAndroid Build Coastguard Worker```
103*cfb92d14SAndroid Build Coastguard Worker
104*cfb92d14SAndroid Build Coastguard Worker```bash
105*cfb92d14SAndroid Build Coastguard Worker> commissioner joiner add 0xabc/12 J01NME
106*cfb92d14SAndroid Build Coastguard WorkerDone
107*cfb92d14SAndroid Build Coastguard Worker```
108*cfb92d14SAndroid Build Coastguard Worker
109*cfb92d14SAndroid Build Coastguard Worker### joiner remove
110*cfb92d14SAndroid Build Coastguard Worker
111*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner joiner remove <eui64>|<discerner>`
112*cfb92d14SAndroid Build Coastguard Worker
113*cfb92d14SAndroid Build Coastguard WorkerRemove a Joiner entry.
114*cfb92d14SAndroid Build Coastguard Worker
115*cfb92d14SAndroid Build Coastguard Worker- eui64: The IEEE EUI-64 of the Joiner or '\*' to match any Joiner.
116*cfb92d14SAndroid Build Coastguard Worker- discerner: The Joiner discerner in format `number/length`.
117*cfb92d14SAndroid Build Coastguard Worker
118*cfb92d14SAndroid Build Coastguard Worker```bash
119*cfb92d14SAndroid Build Coastguard Worker> commissioner joiner remove d45e64fa83f81cf7
120*cfb92d14SAndroid Build Coastguard WorkerDone
121*cfb92d14SAndroid Build Coastguard Worker```
122*cfb92d14SAndroid Build Coastguard Worker
123*cfb92d14SAndroid Build Coastguard Worker```bash
124*cfb92d14SAndroid Build Coastguard Worker> commissioner joiner remove 0xabc/12
125*cfb92d14SAndroid Build Coastguard WorkerDone
126*cfb92d14SAndroid Build Coastguard Worker```
127*cfb92d14SAndroid Build Coastguard Worker
128*cfb92d14SAndroid Build Coastguard Worker### joiner table
129*cfb92d14SAndroid Build Coastguard Worker
130*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner joiner table`
131*cfb92d14SAndroid Build Coastguard Worker
132*cfb92d14SAndroid Build Coastguard WorkerList all Joiner entries.
133*cfb92d14SAndroid Build Coastguard Worker
134*cfb92d14SAndroid Build Coastguard Worker```bash
135*cfb92d14SAndroid Build Coastguard Worker> commissioner joiner table
136*cfb92d14SAndroid Build Coastguard Worker| ID                    | PSKd                             | Expiration |
137*cfb92d14SAndroid Build Coastguard Worker+-----------------------+----------------------------------+------------+
138*cfb92d14SAndroid Build Coastguard Worker|                     * |                           J01NME |      81015 |
139*cfb92d14SAndroid Build Coastguard Worker|      d45e64fa83f81cf7 |                           J01NME |     101204 |
140*cfb92d14SAndroid Build Coastguard Worker| 0x0000000000000abc/12 |                           J01NME |     114360 |
141*cfb92d14SAndroid Build Coastguard WorkerDone
142*cfb92d14SAndroid Build Coastguard Worker```
143*cfb92d14SAndroid Build Coastguard Worker
144*cfb92d14SAndroid Build Coastguard Worker### mgmtget
145*cfb92d14SAndroid Build Coastguard Worker
146*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner mgmtget [locator] [sessionid] [steeringdata] [joinerudpport] [-x <TLV Types>]`
147*cfb92d14SAndroid Build Coastguard Worker
148*cfb92d14SAndroid Build Coastguard WorkerSend a `MGMT_GET` message to the Leader.
149*cfb92d14SAndroid Build Coastguard Worker
150*cfb92d14SAndroid Build Coastguard Worker```bash
151*cfb92d14SAndroid Build Coastguard Worker> commissioner mgmtget locator sessionid
152*cfb92d14SAndroid Build Coastguard WorkerDone
153*cfb92d14SAndroid Build Coastguard Worker```
154*cfb92d14SAndroid Build Coastguard Worker
155*cfb92d14SAndroid Build Coastguard Worker### mgmtset
156*cfb92d14SAndroid Build Coastguard Worker
157*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner mgmtset [locator <locator>] [sessionid <sessionid>] [steeringdata <steeringdata>] [joinerudpport <joinerudpport>] [-x <TLVs>]`
158*cfb92d14SAndroid Build Coastguard Worker
159*cfb92d14SAndroid Build Coastguard WorkerSend a `MGMT_SET` message to the Leader.
160*cfb92d14SAndroid Build Coastguard Worker
161*cfb92d14SAndroid Build Coastguard Worker```bash
162*cfb92d14SAndroid Build Coastguard Worker> commissioner mgmtset joinerudpport 9988
163*cfb92d14SAndroid Build Coastguard WorkerDone
164*cfb92d14SAndroid Build Coastguard Worker```
165*cfb92d14SAndroid Build Coastguard Worker
166*cfb92d14SAndroid Build Coastguard Worker### panid
167*cfb92d14SAndroid Build Coastguard Worker
168*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner panid <panid> <mask> <destination>`
169*cfb92d14SAndroid Build Coastguard Worker
170*cfb92d14SAndroid Build Coastguard WorkerSend a `MGMT_PANID_QUERY` message.
171*cfb92d14SAndroid Build Coastguard Worker
172*cfb92d14SAndroid Build Coastguard Worker- panid: PAN ID to check for conflicts.
173*cfb92d14SAndroid Build Coastguard Worker- mask: Bitmask identifying channels to perform IEEE 802.15.4 Active Scans.
174*cfb92d14SAndroid Build Coastguard Worker- destination: IPv6 destination for the message (may be multicast).
175*cfb92d14SAndroid Build Coastguard Worker
176*cfb92d14SAndroid Build Coastguard WorkerThe contents of `MGMT_PANID_CONFLICT` messages (i.e. PAN ID and Channel Mask) are printed as they are received.
177*cfb92d14SAndroid Build Coastguard Worker
178*cfb92d14SAndroid Build Coastguard Worker```bash
179*cfb92d14SAndroid Build Coastguard Worker> commissioner panid 0xdead 0x7fff800 fdde:ad00:beef:0:0:ff:fe00:c00
180*cfb92d14SAndroid Build Coastguard WorkerDone
181*cfb92d14SAndroid Build Coastguard WorkerConflict: dead, 00000800
182*cfb92d14SAndroid Build Coastguard Worker```
183*cfb92d14SAndroid Build Coastguard Worker
184*cfb92d14SAndroid Build Coastguard Worker### provisioningurl
185*cfb92d14SAndroid Build Coastguard Worker
186*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner provisioningurl <provisioningurl>`
187*cfb92d14SAndroid Build Coastguard Worker
188*cfb92d14SAndroid Build Coastguard WorkerSet the Provisioning URL.
189*cfb92d14SAndroid Build Coastguard Worker
190*cfb92d14SAndroid Build Coastguard Worker```bash
191*cfb92d14SAndroid Build Coastguard Worker> commissioner provisioningurl http://github.com/openthread/openthread
192*cfb92d14SAndroid Build Coastguard WorkerDone
193*cfb92d14SAndroid Build Coastguard Worker```
194*cfb92d14SAndroid Build Coastguard Worker
195*cfb92d14SAndroid Build Coastguard Worker### sessionid
196*cfb92d14SAndroid Build Coastguard Worker
197*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner sessionid`
198*cfb92d14SAndroid Build Coastguard Worker
199*cfb92d14SAndroid Build Coastguard WorkerGet current commissioner session id.
200*cfb92d14SAndroid Build Coastguard Worker
201*cfb92d14SAndroid Build Coastguard Worker```bash
202*cfb92d14SAndroid Build Coastguard Worker> commissioner sessionid
203*cfb92d14SAndroid Build Coastguard Worker0
204*cfb92d14SAndroid Build Coastguard WorkerDone
205*cfb92d14SAndroid Build Coastguard Worker```
206*cfb92d14SAndroid Build Coastguard Worker
207*cfb92d14SAndroid Build Coastguard Worker### id
208*cfb92d14SAndroid Build Coastguard Worker
209*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner id`
210*cfb92d14SAndroid Build Coastguard Worker
211*cfb92d14SAndroid Build Coastguard WorkerGet the commissioner id.
212*cfb92d14SAndroid Build Coastguard Worker
213*cfb92d14SAndroid Build Coastguard Worker```bash
214*cfb92d14SAndroid Build Coastguard Worker> commissioner id
215*cfb92d14SAndroid Build Coastguard WorkerOpenThread Commissioner
216*cfb92d14SAndroid Build Coastguard WorkerDone
217*cfb92d14SAndroid Build Coastguard Worker```
218*cfb92d14SAndroid Build Coastguard Worker
219*cfb92d14SAndroid Build Coastguard Worker### id \<name\>
220*cfb92d14SAndroid Build Coastguard Worker
221*cfb92d14SAndroid Build Coastguard WorkerSet the commissioner id.
222*cfb92d14SAndroid Build Coastguard Worker
223*cfb92d14SAndroid Build Coastguard Worker```bash
224*cfb92d14SAndroid Build Coastguard Worker> commissioner id "Custom Commissioner Id"
225*cfb92d14SAndroid Build Coastguard WorkerDone
226*cfb92d14SAndroid Build Coastguard Worker```
227*cfb92d14SAndroid Build Coastguard Worker
228*cfb92d14SAndroid Build Coastguard Worker### start
229*cfb92d14SAndroid Build Coastguard Worker
230*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner start`
231*cfb92d14SAndroid Build Coastguard Worker
232*cfb92d14SAndroid Build Coastguard WorkerStart the Commissioner role.
233*cfb92d14SAndroid Build Coastguard Worker
234*cfb92d14SAndroid Build Coastguard WorkerThis command will cause the device to send `LEAD_PET` and `LEAD_KA` messages.
235*cfb92d14SAndroid Build Coastguard Worker
236*cfb92d14SAndroid Build Coastguard Worker```bash
237*cfb92d14SAndroid Build Coastguard Worker> commissioner start
238*cfb92d14SAndroid Build Coastguard WorkerCommissioner: petitioning
239*cfb92d14SAndroid Build Coastguard WorkerDone
240*cfb92d14SAndroid Build Coastguard WorkerCommissioner: active
241*cfb92d14SAndroid Build Coastguard Worker```
242*cfb92d14SAndroid Build Coastguard Worker
243*cfb92d14SAndroid Build Coastguard Worker### state
244*cfb92d14SAndroid Build Coastguard Worker
245*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner state`
246*cfb92d14SAndroid Build Coastguard Worker
247*cfb92d14SAndroid Build Coastguard WorkerGet Commissioner state.
248*cfb92d14SAndroid Build Coastguard Worker
249*cfb92d14SAndroid Build Coastguard WorkerThis command will return the current Commissioner state.
250*cfb92d14SAndroid Build Coastguard Worker
251*cfb92d14SAndroid Build Coastguard Worker```bash
252*cfb92d14SAndroid Build Coastguard Worker> commissioner state
253*cfb92d14SAndroid Build Coastguard Workeractive
254*cfb92d14SAndroid Build Coastguard WorkerDone
255*cfb92d14SAndroid Build Coastguard Worker```
256*cfb92d14SAndroid Build Coastguard Worker
257*cfb92d14SAndroid Build Coastguard Worker### stop
258*cfb92d14SAndroid Build Coastguard Worker
259*cfb92d14SAndroid Build Coastguard WorkerUsage: `commissioner stop`
260*cfb92d14SAndroid Build Coastguard Worker
261*cfb92d14SAndroid Build Coastguard WorkerStop the Commissioner role.
262*cfb92d14SAndroid Build Coastguard Worker
263*cfb92d14SAndroid Build Coastguard WorkerThis command will cause the device to send `LEAD_KA[Reject]` messages.
264*cfb92d14SAndroid Build Coastguard Worker
265*cfb92d14SAndroid Build Coastguard Worker```bash
266*cfb92d14SAndroid Build Coastguard Worker> commissioner stop
267*cfb92d14SAndroid Build Coastguard WorkerDone
268*cfb92d14SAndroid Build Coastguard Worker```
269