1# OpenThread Factory Diagnostics Module Reference 2 3The OpenThread diagnostics module is a tool for debugging platform hardware manually, and it will also be used during manufacturing process, to verify platform hardware performance. 4 5The diagnostics module supports common diagnostics features that are listed below, and it also provides a mechanism for expanding platform specific diagnostics features. 6 7## Common Diagnostics Command List 8 9- [diag](#diag) 10- [diag start](#diag-start) 11- [diag channel](#diag-channel) 12- [diag power](#diag-power) 13- [diag send](#diag-send-packets-length) 14- [diag repeat](#diag-repeat-delay-length) 15- [diag radio](#diag-radio-sleep) 16- [diag stats](#diag-stats) 17- [diag stop](#diag-stop) 18 19### diag 20 21Show diagnostics mode status. 22 23```bash 24> diag 25diagnostics mode is disabled 26``` 27 28### diag start 29 30Start diagnostics mode. 31 32```bash 33> diag start 34start diagnostics mode 35status 0x00 36``` 37 38### diag channel 39 40Get the IEEE 802.15.4 Channel value for diagnostics module. 41 42```bash 43> diag channel 44channel: 11 45``` 46 47### diag channel \<channel\> 48 49Set the IEEE 802.15.4 Channel value for diagnostics module. 50 51```bash 52> diag channel 11 53set channel to 11 54status 0x00 55``` 56 57### diag power 58 59Get the tx power value(dBm) for diagnostics module. 60 61```bash 62> diag power 63tx power: -10 dBm 64``` 65 66### diag power \<power\> 67 68Set the tx power value(dBm) for diagnostics module. 69 70```bash 71> diag power -10 72set tx power to -10 dBm 73status 0x00 74``` 75 76### diag send \<packets\> \<length\> 77 78Transmit a fixed number of packets with fixed length. 79 80Length parameter has to be in range [3, 127]. 81 82```bash 83> diag send 20 100 84sending 0x14 packet(s), length 0x64 85status 0x00 86``` 87 88### diag repeat \<delay\> \<length\> 89 90Transmit packets repeatedly with a fixed interval. 91 92Length parameter has to be in range [3, 127]. 93 94```bash 95> diag repeat 100 100 96sending packets of length 0x64 at the delay of 0x64 ms 97status 0x00 98``` 99 100### diag repeat stop 101 102Stop repeated packet transmission. 103 104```bash 105> diag repeat stop 106repeated packet transmission is stopped 107status 0x00 108``` 109 110### diag radio sleep 111 112Enter radio sleep mode. 113 114```bash 115> diag radio sleep 116set radio from receive to sleep 117status 0x00 118``` 119 120### diag radio receive 121 122Set radio from sleep mode to receive mode. 123 124```bash 125> diag radio receive 126set radio from sleep to receive on channel 11 127status 0x00 128``` 129 130### diag radio state 131 132Return the state of the radio. 133 134```bash 135> diag radio state 136sleep 137``` 138 139### diag stats 140 141Print statistics during diagnostics mode. 142 143```bash 144> diag stats 145received packets: 10 146sent packets: 10 147first received packet: rssi=-65, lqi=101 148last received packet: rssi=-64, lqi=98 149``` 150 151### diag stats clear 152 153Clear statistics during diagnostics mode. 154 155```bash 156> diag stats clear 157stats cleared 158``` 159 160### diag stop 161 162Stop diagnostics mode and print statistics. 163 164```bash 165> diag stop 166received packets: 10 167sent packets: 10 168first received packet: rssi=-65, lqi=101 169last received packet: rssi=-61, lqi=98 170 171stop diagnostics mode 172status 0x00 173``` 174 175### diag rcp 176 177RCP-related diagnostics commands. These commands are used for debugging and testing only. 178 179#### diag rcp start 180 181Start RCP diagnostics mode. 182 183```bash 184> diag rcp start 185Done 186``` 187 188#### diag rcp stop 189 190Stop RCP diagnostics mode. 191 192```bash 193> diag rcp stop 194Done 195``` 196 197#### diag rcp channel \<channel\> 198 199Set the RCP IEEE 802.15.4 Channel value for diagnostics module. 200 201```bash 202> diag rcp channel 11 203Done 204``` 205 206#### diag rcp power \<power\> 207 208Set the RCP tx power value(dBm) for diagnostics module. 209 210```bash 211> diag rcp power 0 212Done 213``` 214 215#### diag rcp echo \<message\> 216 217RCP echoes the given message. 218 219```bash 220> diag rcp echo 0123456789 2210123456789 222Done 223``` 224 225#### diag rcp echo -n \<number\> 226 227RCP echoes the message with the given number of bytes. 228 229```bash 230> diag rcp echo -n 20 23101234567890123456789 232Done 233``` 234