1# OpenThread CLI - Commissioner
2
3## Quick Start
4
5See [README_COMMISSIONING.md](README_COMMISSIONING.md).
6
7## Command List
8
9- [help](#help)
10- [announce](#announce)
11- [energy](#energy)
12- [joiner add](#joiner-add)
13- [joiner remove](#joiner-remove)
14- [mgmtget](#mgmtget)
15- [mgmtset](#mgmtset)
16- [panid](#panid)
17- [provisioningurl](#provisioningurl)
18- [sessionid](#sessionid)
19- [start](#start)
20- [state](#state)
21- [stop](#stop)
22
23## Command Details
24
25### help
26
27Usage: `commissioner help`
28
29Print commissioner help menu.
30
31```bash
32> commissioner help
33help
34announce
35energy
36joiner
37mgmtget
38mgmtset
39panid
40provisioningurl
41sessionid
42start
43stop
44Done
45```
46
47### announce
48
49Usage: `commissioner announce <mask> <count> <period> <destination>`
50
51Send a `MGMT_ANNOUNCE_BEGIN` message.
52
53- mask: Bitmask identifying channels to send MLE Announce messages.
54- count: Number of MLE Announce transmissions per channel.
55- period: Period between successive MLE Announce transmissions (milliseconds).
56- destination: IPv6 destination for the message (may be multicast).
57
58```bash
59> commissioner announce 0x00050000 2 32 fdde:ad00:beef:0:0:ff:fe00:c00
60Done
61```
62
63### energy
64
65Usage: `commissioner energy <mask> <count> <period> <scanDuration> <destination>`
66
67Send a `MGMT_ED_SCAN` message.
68
69- mask: Bitmask identifying channels to perform IEEE 802.15.4 ED Scans.
70- count: Number of IEEE 802.15.4 ED Scans per channel.
71- period: Period between successive IEEE 802.15.4 ED Scans (milliseconds).
72- scanDuration: IEEE 802.15.4 ScanDuration to use when performing an IEEE 802.15.4 ED Scan (milliseconds).
73- destination: IPv6 destination for the message (may be multicast).
74
75The contents of `MGMT_ED_REPORT` messages (i.e. Channel Mask and Energy List) are printed as they are received.
76
77```bash
78> commissioner energy 0x00050000 2 32 1000 fdde:ad00:beef:0:0:ff:fe00:c00
79Done
80Energy: 00050000 0 0 0 0
81```
82
83### joiner add
84
85Usage: `commissioner joiner add <eui64>|<discerner> <pskd> [timeout]`
86
87Add a Joiner entry.
88
89- eui64: The IEEE EUI-64 of the Joiner or '\*' to match any Joiner.
90- discerner: The Joiner discerner in format `number/length`.
91- pskd: Pre-Shared Key for the Joiner.
92- timeout: joiner timeout in seconds.
93
94```bash
95> commissioner joiner add d45e64fa83f81cf7 J01NME
96Done
97```
98
99```bash
100> commissioner joiner add 0xabc/12 J01NME
101Done
102```
103
104### joiner remove
105
106Usage: `commissioner joiner remove <eui64>|<discerner>`
107
108Remove a Joiner entry.
109
110- eui64: The IEEE EUI-64 of the Joiner or '\*' to match any Joiner.
111- discerner: The Joiner discerner in format `number/length`.
112
113```bash
114> commissioner joiner remove d45e64fa83f81cf7
115Done
116```
117
118```bash
119> commissioner joiner remove 0xabc/12
120Done
121```
122
123### mgmtget
124
125Usage: `commissioner mgmtget [locator] [sessionid] [steeringdata] [joinerudpport] [-x <TLV Types>]`
126
127Send a `MGMT_GET` message to the Leader.
128
129```bash
130> commissioner mgmtget locator sessionid
131Done
132```
133
134### mgmtset
135
136Usage: `commissioner mgmtset [locator <locator>] [sessionid <sessionid>] [steeringdata <steeringdata>] [joinerudpport <joinerudpport>] [-x <TLVs>]`
137
138Send a `MGMT_SET` message to the Leader.
139
140```bash
141> commissioner mgmtset joinerudpport 9988
142Done
143```
144
145### panid
146
147Usage: `commissioner panid <panid> <mask> <destination>`
148
149Send a `MGMT_PANID_QUERY` message.
150
151- panid: PAN ID to check for conflicts.
152- mask: Bitmask identifying channels to perform IEEE 802.15.4 Active Scans.
153- destination: IPv6 destination for the message (may be multicast).
154
155The contents of `MGMT_PANID_CONFLICT` messages (i.e. PAN ID and Channel Mask) are printed as they are received.
156
157```bash
158> commissioner panid 0xdead 0x7fff800 fdde:ad00:beef:0:0:ff:fe00:c00
159Done
160Conflict: dead, 00000800
161```
162
163### provisioningurl
164
165Usage: `commissioner provisioningurl <provisioningurl>`
166
167Set the Provisioning URL.
168
169```bash
170> commissioner provisioningurl http://github.com/openthread/openthread
171Done
172```
173
174### sessionid
175
176Usage: `commissioner sessionid`
177
178Get current commissioner session id.
179
180```bash
181> commissioner sessionid
1820
183Done
184```
185
186### start
187
188Usage: `commissioner start`
189
190Start the Commissioner role.
191
192This command will cause the device to send `LEAD_PET` and `LEAD_KA` messages.
193
194```bash
195> commissioner start
196Commissioner: petitioning
197Done
198Commissioner: active
199```
200
201### state
202
203Usage: `commissioner state`
204
205Get Commissioner state.
206
207This command will return the current Commissioner state.
208
209```bash
210> commissioner state
211active
212Done
213```
214
215### stop
216
217Usage: `commissioner stop`
218
219Stop the Commissioner role.
220
221This command will cause the device to send `LEAD_KA[Reject]` messages.
222
223```bash
224> commissioner stop
225Done
226```
227