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