1*cfb92d14SAndroid Build Coastguard Worker# OpenThread CLI - Commissioning 2*cfb92d14SAndroid Build Coastguard Worker 3*cfb92d14SAndroid Build Coastguard Worker## Overview 4*cfb92d14SAndroid Build Coastguard Worker 5*cfb92d14SAndroid Build Coastguard WorkerCommissioning is the process of adding a new Thread device, called the Joiner, to a Thread network. This process is done under guidance of a [Commissioner](README_COMMISSIONER.md). 6*cfb92d14SAndroid Build Coastguard Worker 7*cfb92d14SAndroid Build Coastguard Worker## Quick Start 8*cfb92d14SAndroid Build Coastguard Worker 9*cfb92d14SAndroid Build Coastguard Worker### Form Network 10*cfb92d14SAndroid Build Coastguard Worker 11*cfb92d14SAndroid Build Coastguard WorkerForm a network with the Thread device that has Commissioner support. 12*cfb92d14SAndroid Build Coastguard Worker 13*cfb92d14SAndroid Build Coastguard Worker1. Generate and view new network configuration. 14*cfb92d14SAndroid Build Coastguard Worker 15*cfb92d14SAndroid Build Coastguard Worker ```bash 16*cfb92d14SAndroid Build Coastguard Worker > dataset init new 17*cfb92d14SAndroid Build Coastguard Worker Done 18*cfb92d14SAndroid Build Coastguard Worker > dataset 19*cfb92d14SAndroid Build Coastguard Worker Active Timestamp: 1 20*cfb92d14SAndroid Build Coastguard Worker Channel: 13 21*cfb92d14SAndroid Build Coastguard Worker Channel Mask: 0x07fff800 22*cfb92d14SAndroid Build Coastguard Worker Ext PAN ID: d63e8e3e495ebbc3 23*cfb92d14SAndroid Build Coastguard Worker Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 24*cfb92d14SAndroid Build Coastguard Worker Network Key: dfd34f0f05cad978ec4e32b0413038ff 25*cfb92d14SAndroid Build Coastguard Worker Network Name: OpenThread-8f28 26*cfb92d14SAndroid Build Coastguard Worker PAN ID: 0x8f28 27*cfb92d14SAndroid Build Coastguard Worker PSKc: c23a76e98f1a6483639b1ac1271e2e27 28*cfb92d14SAndroid Build Coastguard Worker Security Policy: 0, onrc 29*cfb92d14SAndroid Build Coastguard Worker Done 30*cfb92d14SAndroid Build Coastguard Worker ``` 31*cfb92d14SAndroid Build Coastguard Worker 32*cfb92d14SAndroid Build Coastguard Worker2. Commit new dataset to the Active Operational Dataset in non-volatile storage. 33*cfb92d14SAndroid Build Coastguard Worker 34*cfb92d14SAndroid Build Coastguard Worker ```bash 35*cfb92d14SAndroid Build Coastguard Worker dataset commit active 36*cfb92d14SAndroid Build Coastguard Worker Done 37*cfb92d14SAndroid Build Coastguard Worker ``` 38*cfb92d14SAndroid Build Coastguard Worker 39*cfb92d14SAndroid Build Coastguard Worker3. Enable Thread interface 40*cfb92d14SAndroid Build Coastguard Worker 41*cfb92d14SAndroid Build Coastguard Worker ```bash 42*cfb92d14SAndroid Build Coastguard Worker > ifconfig up 43*cfb92d14SAndroid Build Coastguard Worker Done 44*cfb92d14SAndroid Build Coastguard Worker > thread start 45*cfb92d14SAndroid Build Coastguard Worker Done 46*cfb92d14SAndroid Build Coastguard Worker ``` 47*cfb92d14SAndroid Build Coastguard Worker 48*cfb92d14SAndroid Build Coastguard Worker### Obtain Joiner IEEE EUI-64 49*cfb92d14SAndroid Build Coastguard Worker 50*cfb92d14SAndroid Build Coastguard Worker1. Start the Joiner node and obtain the Joiner's IEEE EUI-64. 51*cfb92d14SAndroid Build Coastguard Worker 52*cfb92d14SAndroid Build Coastguard Worker ```bash 53*cfb92d14SAndroid Build Coastguard Worker > eui64 54*cfb92d14SAndroid Build Coastguard Worker 18b4300000000002 55*cfb92d14SAndroid Build Coastguard Worker Done 56*cfb92d14SAndroid Build Coastguard Worker ``` 57*cfb92d14SAndroid Build Coastguard Worker 58*cfb92d14SAndroid Build Coastguard Worker### Start Commissioner 59*cfb92d14SAndroid Build Coastguard Worker 60*cfb92d14SAndroid Build Coastguard Worker1. Start the Commissioner Role 61*cfb92d14SAndroid Build Coastguard Worker 62*cfb92d14SAndroid Build Coastguard Worker ```bash 63*cfb92d14SAndroid Build Coastguard Worker > commissioner start 64*cfb92d14SAndroid Build Coastguard Worker Commissioner: petitioning 65*cfb92d14SAndroid Build Coastguard Worker Done 66*cfb92d14SAndroid Build Coastguard Worker Commissioner: active 67*cfb92d14SAndroid Build Coastguard Worker ``` 68*cfb92d14SAndroid Build Coastguard Worker 69*cfb92d14SAndroid Build Coastguard Worker2. Add the Joiner with the device-specific pre-shared key (PSKd) 70*cfb92d14SAndroid Build Coastguard Worker 71*cfb92d14SAndroid Build Coastguard Worker ```bash 72*cfb92d14SAndroid Build Coastguard Worker > commissioner joiner add 18b4300000000002 J01NME 73*cfb92d14SAndroid Build Coastguard Worker Done 74*cfb92d14SAndroid Build Coastguard Worker ``` 75*cfb92d14SAndroid Build Coastguard Worker 76*cfb92d14SAndroid Build Coastguard Worker### Start Joiner 77*cfb92d14SAndroid Build Coastguard Worker 78*cfb92d14SAndroid Build Coastguard Worker1. Factory reset the device. 79*cfb92d14SAndroid Build Coastguard Worker 80*cfb92d14SAndroid Build Coastguard Worker ```bash 81*cfb92d14SAndroid Build Coastguard Worker > factoryreset 82*cfb92d14SAndroid Build Coastguard Worker ``` 83*cfb92d14SAndroid Build Coastguard Worker 84*cfb92d14SAndroid Build Coastguard Worker2. Start the Joiner process. 85*cfb92d14SAndroid Build Coastguard Worker 86*cfb92d14SAndroid Build Coastguard Worker ```bash 87*cfb92d14SAndroid Build Coastguard Worker > ifconfig up 88*cfb92d14SAndroid Build Coastguard Worker Done 89*cfb92d14SAndroid Build Coastguard Worker > joiner start J01NME 90*cfb92d14SAndroid Build Coastguard Worker Done 91*cfb92d14SAndroid Build Coastguard Worker Join success 92*cfb92d14SAndroid Build Coastguard Worker ``` 93*cfb92d14SAndroid Build Coastguard Worker 94*cfb92d14SAndroid Build Coastguard Worker3. Attach to Thread network 95*cfb92d14SAndroid Build Coastguard Worker 96*cfb92d14SAndroid Build Coastguard Worker ```bash 97*cfb92d14SAndroid Build Coastguard Worker > thread start 98*cfb92d14SAndroid Build Coastguard Worker Done 99*cfb92d14SAndroid Build Coastguard Worker ``` 100*cfb92d14SAndroid Build Coastguard Worker 101*cfb92d14SAndroid Build Coastguard Worker4. After successful attach, validate the device has the same Active Operational Dataset as above. 102*cfb92d14SAndroid Build Coastguard Worker 103*cfb92d14SAndroid Build Coastguard Worker ```bash 104*cfb92d14SAndroid Build Coastguard Worker > dataset active 105*cfb92d14SAndroid Build Coastguard Worker Active Timestamp: 1 106*cfb92d14SAndroid Build Coastguard Worker Channel: 13 107*cfb92d14SAndroid Build Coastguard Worker Channel Mask: 0x07fff800 108*cfb92d14SAndroid Build Coastguard Worker Ext PAN ID: d63e8e3e495ebbc3 109*cfb92d14SAndroid Build Coastguard Worker Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 110*cfb92d14SAndroid Build Coastguard Worker Network Key: dfd34f0f05cad978ec4e32b0413038ff 111*cfb92d14SAndroid Build Coastguard Worker Network Name: OpenThread-8f28 112*cfb92d14SAndroid Build Coastguard Worker PAN ID: 0x8f28 113*cfb92d14SAndroid Build Coastguard Worker PSKc: c23a76e98f1a6483639b1ac1271e2e27 114*cfb92d14SAndroid Build Coastguard Worker Security Policy: 0, onrc 115*cfb92d14SAndroid Build Coastguard Worker Done 116*cfb92d14SAndroid Build Coastguard Worker ``` 117*cfb92d14SAndroid Build Coastguard Worker 118*cfb92d14SAndroid Build Coastguard Worker## CLI Reference 119*cfb92d14SAndroid Build Coastguard Worker 120*cfb92d14SAndroid Build Coastguard Worker- [Commissioner CLI Reference](README_COMMISSIONER.md) 121*cfb92d14SAndroid Build Coastguard Worker- [Joiner CLI Reference](README_JOINER.md) 122