1# OpenThread CLI Reference
2
3The OpenThread CLI exposes configuration and management APIs via a command line interface. Use the CLI to play with OpenThread, which can also be used with additional application code. The OpenThread test scripts use the CLI to execute test cases.
4
5## Separator and escaping characters
6
7The whitespace character (`' '`) is used to delimit the command name and the different arguments, together with tab (`'\t'`) and new line characters (`'\r'`, `'\n'`).
8
9Some arguments might require to accept whitespaces on them. For those cases the backslash character (`'\'`) can be used to escape separators or the backslash itself.
10
11Example:
12
13```bash
14> networkname Test\ Network
15Done
16> networkname
17Test Network
18Done
19>
20```
21
22## OpenThread Command List
23
24- [attachtime](#attachtime)
25- [ba](#ba)
26- [bbr](#bbr)
27- [br](README_BR.md)
28- [bufferinfo](#bufferinfo)
29- [ccathreshold](#ccathreshold)
30- [channel](#channel)
31- [child](#child-list)
32- [childip](#childip)
33- [childmax](#childmax)
34- [childsupervision](#childsupervision-interval)
35- [childtimeout](#childtimeout)
36- [coap](README_COAP.md)
37- [coaps](README_COAPS.md)
38- [coex](#coex)
39- [commissioner](README_COMMISSIONER.md)
40- [contextreusedelay](#contextreusedelay)
41- [counters](#counters)
42- [csl](#csl)
43- [dataset](README_DATASET.md)
44- [debug](#debug)
45- [delaytimermin](#delaytimermin)
46- [detach](#detach)
47- [deviceprops](#deviceprops)
48- [diag](#diag)
49- [discover](#discover-channel)
50- [dns](#dns-config)
51- [domainname](#domainname)
52- [dua](#dua-iid)
53- [eidcache](#eidcache)
54- [eui64](#eui64)
55- [extaddr](#extaddr)
56- [extpanid](#extpanid)
57- [factoryreset](#factoryreset)
58- [fake](#fake)
59- [fem](#fem)
60- [history](README_HISTORY.md)
61- [ifconfig](#ifconfig)
62- [instanceid](#instanceid)
63- [ipaddr](#ipaddr)
64- [ipmaddr](#ipmaddr)
65- [joiner](README_JOINER.md)
66- [joinerport](#joinerport-port)
67- [keysequence](#keysequence-counter)
68- [leaderdata](#leaderdata)
69- [leaderweight](#leaderweight)
70- [linkmetrics](#linkmetrics-config-async-ipaddr-enhanced-ack-clear)
71- [linkmetricsmgr](#linkmetricsmgr-disable)
72- [locate](#locate)
73- [log](#log-filename-filename)
74- [mac](#mac-altshortaddr)
75- [macfilter](#macfilter)
76- [meshdiag](#meshdiag-topology-ip6-addrs-children)
77- [mliid](#mliid-iid)
78- [mlr](#mlr-reg-ipaddr--timeout)
79- [mode](#mode)
80- [multiradio](#multiradio)
81- [nat64](#nat64-cidr)
82- [neighbor](#neighbor-list)
83- [netdata](README_NETDATA.md)
84- [netstat](#netstat)
85- [networkdiagnostic](#networkdiagnostic-get-addr-type-)
86- [networkidtimeout](#networkidtimeout)
87- [networkkey](#networkkey)
88- [networkname](#networkname)
89- [networktime](#networktime)
90- [nexthop](#nexthop)
91- [panid](#panid)
92- [parent](#parent)
93- [parentpriority](#parentpriority)
94- [partitionid](#partitionid)
95- [ping](#ping-async--i-source--m-ipaddr-size-count-interval-hoplimit-timeout)
96- [platform](#platform)
97- [pollperiod](#pollperiod-pollperiod)
98- [preferrouterid](#preferrouterid-routerid)
99- [prefix](#prefix)
100- [promiscuous](#promiscuous)
101- [pskc](#pskc)
102- [pskcref](#pskcref)
103- [radio](#radio-enable)
104- [radiofilter](#radiofilter)
105- [rcp](#rcp)
106- [region](#region)
107- [releaserouterid](#releaserouterid-routerid)
108- [reset](#reset)
109- [rloc16](#rloc16)
110- [route](#route)
111- [router](#router-list)
112- [routerdowngradethreshold](#routerdowngradethreshold)
113- [routereligible](#routereligible)
114- [routerselectionjitter](#routerselectionjitter)
115- [routerupgradethreshold](#routerupgradethreshold)
116- [childrouterlinks](#childrouterlinks)
117- [scan](#scan-channel)
118- [service](#service)
119- [singleton](#singleton)
120- [sntp](#sntp-query-sntp-server-ip-sntp-server-port)
121- [state](#state)
122- [srp](README_SRP.md)
123- [tcat](README_TCAT.md)
124- [tcp](README_TCP.md)
125- [test](#test-tmforiginfilter-enabledisable)
126- [thread](#thread-start)
127- [timeinqueue](#timeinqueue)
128- [trel](#trel)
129- [tvcheck](#tvcheck-enable)
130- [txpower](#txpower)
131- [udp](README_UDP.md)
132- [unsecureport](#unsecureport-add-port)
133- [uptime](#uptime)
134- [vendor](#vendor-name)
135- [verhoeff](#verhoeff-calculate)
136- [version](#version)
137- [wakeup](#wakeup-channel)
138
139## OpenThread Command Details
140
141### attachtime
142
143Prints the attach time (duration since device was last attached).
144
145Requires `OPENTHREAD_CONFIG_UPTIME_ENABLE`.
146
147Duration is formatted as `{hh}:{mm}:{ss}` for hours, minutes, and seconds if it is less than one day. If the duration is longer than one day, the format is `{dd}d.{hh}:{mm}:{ss}`.
148
149```bash
150> attachtime
15101:38:25
152Done
153```
154
155### bbr
156
157Show current Primary Backbone Router information for Thread 1.2 device.
158
159```bash
160> bbr
161BBR Primary:
162server16: 0xE400
163seqno:    10
164delay:    120 secs
165timeout:  300 secs
166Done
167```
168
169```bash
170> bbr
171BBR Primary: None
172Done
173```
174
175### bbr mgmt dua \<status\|coap-code\> [meshLocalIid]
176
177Configure the response status for DUA.req with meshLocalIid in payload. Without meshLocalIid, simply respond any coming DUA.req next with the specified status or COAP code.
178
179Only for testing/reference device.
180
181known status value:
182
183- 0: ST_DUA_SUCCESS
184- 1: ST_DUA_REREGISTER
185- 2: ST_DUA_INVALID
186- 3: ST_DUA_DUPLICATE
187- 4: ST_DUA_NO_RESOURCES
188- 5: ST_DUA_BBR_NOT_PRIMARY
189- 6: ST_DUA_GENERAL_FAILURE
190- 160: COAP code 5.00
191
192```bash
193> bbr mgmt dua 1 2f7c235e5025a2fd
194Done
195> bbr mgmt dua 160
196Done
197```
198
199### bbr mgmt mlr listener
200
201Show the Multicast Listeners.
202
203Only for testing/reference Backbone Router device.
204
205```bash
206> bbr mgmt mlr listener
207ff04:0:0:0:0:0:0:abcd 3534000
208ff04:0:0:0:0:0:0:eeee 3537610
209Done
210```
211
212### bbr mgmt mlr listener add \<ipaddr\> \[\<timeout\>\]
213
214Add a Multicast Listener with a given IPv6 multicast address and timeout (in seconds).
215
216Only for testing/reference Backbone Router device.
217
218```bash
219> bbr mgmt mlr listener add ff04::1
220Done
221> bbr mgmt mlr listener add ff04::2 300
222Done
223> bbr mgmt mlr listener
224ff04:0:0:0:0:0:0:2 261
225ff04:0:0:0:0:0:0:1 3522
226Done
227```
228
229### bbr mgmt mlr listener clear
230
231Removes all the Multicast Listeners.
232
233Only for testing/reference Backbone Router device.
234
235```bash
236> bbr mgmt mlr listener clear
237Done
238> bbr mgmt mlr listener
239Done
240```
241
242### bbr mgmt mlr response \<status\>
243
244Configure the response status for the next MLR.req.
245
246Only for testing/reference device.
247
248Known status values:
249
250- 0: ST_MLR_SUCCESS
251- 2: ST_MLR_INVALID
252- 3: ST_MLR_NO_PERSISTENT
253- 4: ST_MLR_NO_RESOURCES
254- 5: ST_MLR_BBR_NOT_PRIMARY
255- 6: ST_MLR_GENERAL_FAILURE
256
257```bash
258> bbr mgmt mlr response 2
259Done
260```
261
262### bbr state
263
264Show local Backbone state ([`Disabled`,`Primary`, `Secondary`]) for Thread 1.2 FTD.
265
266`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
267
268```bash
269> bbr state
270Disabled
271Done
272
273> bbr state
274Primary
275Done
276
277> bbr state
278Secondary
279Done
280```
281
282### bbr enable
283
284Enable Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered for attached device if there is no Backbone Router Service in Thread Network Data.
285
286`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
287
288```bash
289> bbr enable
290Done
291```
292
293### bbr disable
294
295Disable Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered if Backbone Router is Primary state. o `OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
296
297```bash
298> bbr disable
299Done
300```
301
302### bbr register
303
304Register Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered for attached device.
305
306`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
307
308```bash
309> bbr register
310Done
311```
312
313### bbr config
314
315Show local Backbone Router configuration for Thread 1.2 FTD.
316
317`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
318
319```bash
320> bbr config
321seqno:    10
322delay:    120 secs
323timeout:  300 secs
324Done
325```
326
327### bbr config \[seqno \<seqno\>\] \[delay \<delay\>\] \[timeout \<timeout\>\]
328
329Configure local Backbone Router configuration for Thread 1.2 FTD. `bbr register` should be issued explicitly to register Backbone Router service to Leader for Secondary Backbone Router. `SRV_DATA.ntf` would be initiated automatically if BBR Dataset changes for Primary Backbone Router.
330
331`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
332
333```bash
334> bbr config seqno 20 delay 30
335Done
336```
337
338### bbr jitter
339
340Show jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
341
342`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
343
344```bash
345> bbr jitter
34620
347Done
348```
349
350### bbr jitter \<jitter\>
351
352Set jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
353
354`OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required.
355
356```bash
357> bbr jitter 10
358Done
359```
360
361### ba
362
363Show current Border Agent information.
364
365### ba port
366
367Print border agent service port.
368
369```bash
370> ba port
37149152
372Done
373```
374
375### ba state
376
377Print border agent state.
378
379Possible states are
380
381- `Stopped` : Border Agent is stopped.
382- `Started` : Border Agent is running with no active connection with external commissioner.
383- `Active` : Border Agent is running and is connected with an external commissioner.
384
385```bash
386> ba state
387Started
388Done
389```
390
391### ba disconnect
392
393Disconnects border agent from any active secure sessions.
394
395```bash
396> ba disconnect
397Done
398```
399
400### ba ephemeralkey
401
402Indicates if an ephemeral key is active.
403
404Requires `OPENTHREAD_CONFIG_BORDER_AGENT_EPHEMERAL_KEY_ENABLE`.
405
406```bash
407> ba ephemeralkey
408inactive
409Done
410
411> ba ephemeralkey set Z10X20g3J15w1000P60m16 1000
412Done
413
414> ba ephemeralkey
415active
416Done
417```
418
419### ba ephemeralkey set \<keystring\> \[timeout\] \[port\]
420
421Sets the ephemeral key for a given timeout duration.
422
423Requires `OPENTHREAD_CONFIG_BORDER_AGENT_EPHEMERAL_KEY_ENABLE`.
424
425The ephemeral key can be set when Border Agent is already running and is not currently connected to any external commissioner (i.e., `ba state` gives `Started`).
426
427The `keystring` string is directly used as the ephemeral PSK (excluding the trailing null `\0` character). Its length MUST be between 6 and 32, inclusive.
428
429The `timeout` is in milliseconds. If not provided or set to zero, the default value of 2 minutes will be used. If the timeout value is larger than 10 minutes, the 10 minutes timeout value will be used instead.
430
431The `port` specifies the UDP port to use with the ephemeral key. If UDP port is zero or is not provided, an ephemeral port will be used. `ba port` will give the current UDP port in use by the Border Agent.
432
433Setting the ephemeral key again before a previously set one is timed out, will replace the previous one.
434
435During the timeout interval, the ephemeral key can be used only once by an external commissioner to establish a connection. After the commissioner disconnects, the ephemeral key is cleared, and the Border Agent reverts to using PSKc. If the timeout expires while a commissioner is still connected, the session will be terminated, and the Border Agent will cease using the ephemeral key and revert to PSKc.
436
437```bash
438> ba ephemeralkey set Z10X20g3J15w1000P60m16 5000 1234
439Done
440```
441
442### ba ephemeralkey clear
443
444Cancels the ephemeral key in use if any.
445
446Requires `OPENTHREAD_CONFIG_BORDER_AGENT_EPHEMERAL_KEY_ENABLE`.
447
448Can be used to cancel a previously set ephemeral key before it is used or times out. If the Border Agent is not running or there is no ephemeral key in use, calling this function has no effect.
449
450If a commissioner is connected using the ephemeral key and is currently active, calling this method does not change its state. In this case the `ba ephemeralkey` will continue to return `active` until the commissioner disconnects.
451
452```bash
453> ba ephemeralkey clear
454Done
455```
456
457### ba ephemeralkey callback enable
458
459Enables callback from Border Agent for ephemeral key state changes.
460
461```bash
462> ba ephemeralkey callback enable
463Done
464
465> ba ephemeralkey set W10X12 5000 49155
466Done
467
468BorderAgent callback: Ephemeral key active, port:49155
469BorderAgent callback: Ephemeral key inactive
470```
471
472### ba ephemeralkey callback disable
473
474Disables callback from Border Agent for ephemeral key state changes.
475
476```bash
477> ba ephemeralkey callback disable
478Done
479```
480
481### ba counters
482
483Get the border agent counter values.
484
485Note that it requires `OPENTHREAD_CONFIG_BORDER_AGENT_EPHEMERAL_KEY_ENABLE` to output the ePSKc counters.
486
487```bash
488> ba counters
489epskcActivation: 2
490epskcApiDeactivation: 1
491epskcTimeoutDeactivation: 1
492epskcMaxAttemptDeactivation: 0
493epskcDisconnectDeactivation: 0
494epskcInvalidBaStateError: 1
495epskcInvalidArgsError: 1
496epskcStartSecureSessionError: 0
497epskcSecureSessionSuccess: 0
498epskcSecureSessionFailure: 0
499epskcCommissionerPetition: 0
500pskcSecureSessionSuccess: 0
501pskcSecureSessionFailure: 0
502pskcCommissionerPetition: 0
503mgmtActiveGet: 0
504mgmtPendingGet: 0
505Done
506```
507
508### bufferinfo
509
510Show the current message buffer information.
511
512- The `total` shows total number of message buffers in pool.
513- The `free` shows the number of free message buffers.
514- The `max-used` shows the maximum number of used buffers at the same time since OT stack initialization or last `bufferinfo reset`.
515- This is then followed by info about different queues used by OpenThread stack, each line representing info about a queue.
516  - The first number shows number messages in the queue.
517  - The second number shows number of buffers used by all messages in the queue.
518  - The third number shows total number of bytes of all messages in the queue.
519
520```bash
521> bufferinfo
522total: 40
523free: 40
524max-used: 5
5256lo send: 0 0 0
5266lo reas: 0 0 0
527ip6: 0 0 0
528mpl: 0 0 0
529mle: 0 0 0
530coap: 0 0 0
531coap secure: 0 0 0
532application coap: 0 0 0
533Done
534```
535
536### bufferinfo reset
537
538Reset the message buffer counter tracking maximum number buffers in use at the same time.
539
540```bash
541> bufferinfo reset
542Done
543```
544
545### ccathreshold
546
547Get the CCA threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.
548
549```bash
550> ccathreshold
551-75 dBm
552Done
553```
554
555### ccathreshold \<ccathreshold\>
556
557Set the CCA threshold measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.
558
559```bash
560> ccathreshold -62
561Done
562```
563
564### channel
565
566Get the IEEE 802.15.4 Channel value.
567
568```bash
569> channel
57011
571Done
572```
573
574### channel \<channel\>
575
576Set the IEEE 802.15.4 Channel value.
577
578```bash
579> channel 11
580Done
581```
582
583### channel manager
584
585Get channel manager state.
586
587`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is required.
588
589```bash
590channel: 11
591auto: 1
592delay: 120
593interval: 10800
594supported: { 11-26}
595favored: { 11-26}
596Done
597```
598
599### channel manager change \<channel\>
600
601Initiate a channel change with the channel manager.
602
603`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is required.
604
605```bash
606> channel manager change 11
607channel manager change 11
608Done
609```
610
611### channel manager select \<skip quality check (boolean)\>
612
613Request a channel selection with the channel manager.
614
615`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
616
617```bash
618> channel manager select 1
619channel manager select 1
620Done
621```
622
623### channel manager auto \<enable (boolean)\>
624
625Enable/disable the auto-channel-selection functionality.
626
627`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
628
629```bash
630> channel manager auto 1
631channel manager auto 1
632Done
633```
634
635### channel manager delay \<delay\>
636
637Set the channel change delay (in seconds).
638
639`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
640
641```bash
642> channel manager delay 120
643channel manager delay 120
644Done
645```
646
647### channel manager interval \<interval\>
648
649Set the auto-channel-selection interval (in seconds).
650
651`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
652
653```bash
654> channel manager interval 10800
655channel manager interval 10800
656Done
657```
658
659### channel manager supported \<mask\>
660
661Set the supported channel mask for the auto-channel-selection.
662
663`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
664
665```bash
666> channel manager supported 0x7fffc00
667channel manager supported 0x7fffc00
668Done
669```
670
671### channel manager favored \<mask\>
672
673Set the favored channel mask for the auto-channel-selection.
674
675`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` are required.
676
677```bash
678> channel manager favored 0x7fffc00
679channel manager favored 0x7fffc00
680Done
681```
682
683### channel monitor
684
685Get current channel monitor state and channel occupancy.
686
687`OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` is required.
688
689```bash
690> channel monitor
691channel monitor
692enabled: 1
693interval: 41000
694threshold: -75
695window: 960
696count: 10552
697occupancies:
698ch 11 (0x0cb7)  4.96% busy
699ch 12 (0x2e2b) 18.03% busy
700ch 13 (0x2f54) 18.48% busy
701ch 14 (0x0fef)  6.22% busy
702ch 15 (0x1536)  8.28% busy
703ch 16 (0x1746)  9.09% busy
704ch 17 (0x0b8b)  4.50% busy
705ch 18 (0x60a7) 37.75% busy
706ch 19 (0x0810)  3.14% busy
707ch 20 (0x0c2a)  4.75% busy
708ch 21 (0x08dc)  3.46% busy
709ch 22 (0x101d)  6.29% busy
710ch 23 (0x0092)  0.22% busy
711ch 24 (0x0028)  0.06% busy
712ch 25 (0x0063)  0.15% busy
713ch 26 (0x058c)  2.16% busy
714
715Done
716```
717
718### channel monitor start
719
720Start the channel monitor.
721
722`OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` is required.
723
724```bash
725> channel monitor start
726channel monitor start
727Done
728```
729
730### channel monitor stop
731
732Stop the channel monitor.
733
734`OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE` is required.
735
736```bash
737> channel monitor stop
738channel monitor stop
739Done
740```
741
742### channel preferred
743
744Get preferred channel mask.
745
746```bash
747> channel preferred
7480x7fff800
749Done
750```
751
752### channel supported
753
754Get supported channel mask.
755
756```bash
757> channel supported
7580x7fff800
759Done
760```
761
762### child list
763
764List attached Child IDs.
765
766```bash
767> child list
7681 2 3 6 7 8
769Done
770```
771
772### child table
773
774Print table of attached children.
775
776```bash
777> child table
778| ID  | RLOC16 | Timeout    | Age        | LQ In | C_VN |R|D|N|Ver|CSL|QMsgCnt|Suprvsn| Extended MAC     |
779+-----+--------+------------+------------+-------+------+-+-+-+---+---+-------+-------+------------------+
780|   1 | 0xc801 |        240 |         24 |     3 |  131 |1|0|0|  3| 0 |     0 |   129 | 4ecede68435358ac |
781|   2 | 0xc802 |        240 |          2 |     3 |  131 |0|0|0|  3| 1 |     0 |     0 | a672a601d2ce37d8 |
782Done
783```
784
785### child \<id\>
786
787Print diagnostic information for an attached Thread Child. The `id` may be a Child ID or an RLOC16.
788
789```bash
790> child 1
791Child ID: 1
792Rloc: 9c01
793Ext Addr: e2b3540590b0fd87
794Mode: rn
795CSL Synchronized: 1
796Net Data: 184
797Timeout: 100
798Age: 0
799Link Quality In: 3
800RSSI: -20
801Supervision Interval: 129
802Done
803```
804
805### childip
806
807Get the list of IP addresses stored for MTD children.
808
809```bash
810> childip
8113401: fdde:ad00:beef:0:3037:3e03:8c5f:bc0c
812Done
813```
814
815### childip max
816
817Get the maximum number of IP addresses that each MTD child may register with this device as parent.
818
819```bash
820> childip max
8214
822Done
823```
824
825### childip max \<count\>
826
827Set the maximum number of IP addresses that each MTD child may register with this device as parent. 0 to clear the setting and restore the default.
828
829`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required.
830
831```bash
832> childip max 2
833Done
834```
835
836### childmax
837
838Get the Thread maximum number of allowed children.
839
840```bash
841> childmax
8425
843Done
844```
845
846### childmax \<count\>
847
848Set the Thread maximum number of allowed children.
849
850```bash
851> childmax 2
852Done
853```
854
855### childsupervision interval
856
857Get the Child Supervision interval value on the child.
858
859Child Supervision feature provides a mechanism for parent to ensure that a message is sent to each sleepy child within the supervision interval. If there is no transmission to the child within the supervision interval, OpenThread enqueues and sends a Child Supervision Message to the child.
860
861```bash
862> childsupervision interval
86330
864Done
865```
866
867### childsupervision interval \<interval\>
868
869Set the Child Supervision interval value on the child.
870
871```bash
872> childsupervision interval 30
873Done
874```
875
876### childsupervision checktimeout
877
878Get the Child Supervision Check Timeout value on the child.
879
880If the device is a sleepy child and it does not hear from its parent within the specified check timeout, it initiates the re-attach process (MLE Child Update Request/Response exchange with its parent).
881
882```bash
883> childsupervision checktimeout
88430
885Done
886```
887
888### childsupervision checktimeout \<timeout\>
889
890Set the Child Supervision Check Timeout value on the child.
891
892```bash
893> childsupervision checktimeout 30
894Done
895```
896
897### childsupervision failcounter
898
899Get the current value of supervision check timeout failure counter.
900
901The counter tracks the number of supervision check failures on the child. It is incremented when the child does not hear from its parent within the specified check timeout interval.
902
903```bash
904> childsupervision failcounter
9050
906Done
907```
908
909### childsupervision failcounter reset
910
911Reset the supervision check timeout failure counter to zero.
912
913```bash
914> childsupervision failcounter reset
915Done
916```
917
918### childtimeout
919
920Get the Thread Child Timeout value.
921
922```bash
923> childtimeout
924300
925Done
926```
927
928### childtimeout \<timeout\>
929
930Set the Thread Child Timeout value.
931
932```bash
933> childtimeout 300
934Done
935```
936
937### coex
938
939Get the coex status.
940
941`OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE` is required.
942
943```bash
944> coex
945Enabled
946Done
947```
948
949### coex disable
950
951Disable coex.
952
953`OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE` is required.
954
955```bash
956> coex disable
957Done
958```
959
960### coex enable
961
962Enable coex.
963
964`OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE` is required.
965
966```bash
967> coex enable
968Done
969```
970
971### coex metrics
972
973Show coex metrics.
974
975`OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE` is required.
976
977```bash
978> coex metrics
979Stopped: false
980Grant Glitch: 0
981Transmit metrics
982    Request: 0
983    Grant Immediate: 0
984    Grant Wait: 0
985    Grant Wait Activated: 0
986    Grant Wait Timeout: 0
987    Grant Deactivated During Request: 0
988    Delayed Grant: 0
989    Average Request To Grant Time: 0
990Receive metrics
991    Request: 0
992    Grant Immediate: 0
993    Grant Wait: 0
994    Grant Wait Activated: 0
995    Grant Wait Timeout: 0
996    Grant Deactivated During Request: 0
997    Delayed Grant: 0
998    Average Request To Grant Time: 0
999    Grant None: 0
1000Done
1001```
1002
1003### contextreusedelay
1004
1005Get the CONTEXT_ID_REUSE_DELAY value.
1006
1007```bash
1008> contextreusedelay
100911
1010Done
1011```
1012
1013### contextreusedelay \<delay\>
1014
1015Set the CONTEXT_ID_REUSE_DELAY value.
1016
1017```bash
1018> contextreusedelay 11
1019Done
1020```
1021
1022### counters
1023
1024Get the supported counter names.
1025
1026```bash
1027> counters
1028br
1029ip
1030mac
1031mle
1032Done
1033```
1034
1035### counters \<countername\>
1036
1037Get the counter value.
1038
1039Note:
1040
1041- `OPENTHREAD_CONFIG_UPTIME_ENABLE` is required for MLE role time tracking in `counters mle`
1042- `OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE` is required for `counters br`
1043
1044```bash
1045> counters mac
1046TxTotal: 10
1047    TxUnicast: 3
1048    TxBroadcast: 7
1049    TxAckRequested: 3
1050    TxAcked: 3
1051    TxNoAckRequested: 7
1052    TxData: 10
1053    TxDataPoll: 0
1054    TxBeacon: 0
1055    TxBeaconRequest: 0
1056    TxOther: 0
1057    TxRetry: 0
1058    TxErrCca: 0
1059    TxErrBusyChannel: 0
1060RxTotal: 2
1061    RxUnicast: 1
1062    RxBroadcast: 1
1063    RxData: 2
1064    RxDataPoll: 0
1065    RxBeacon: 0
1066    RxBeaconRequest: 0
1067    RxOther: 0
1068    RxAddressFiltered: 0
1069    RxDestAddrFiltered: 0
1070    RxDuplicated: 0
1071    RxErrNoFrame: 0
1072    RxErrNoUnknownNeighbor: 0
1073    RxErrInvalidSrcAddr: 0
1074    RxErrSec: 0
1075    RxErrFcs: 0
1076    RxErrOther: 0
1077Done
1078> counters mle
1079Role Disabled: 0
1080Role Detached: 1
1081Role Child: 0
1082Role Router: 0
1083Role Leader: 1
1084Attach Attempts: 1
1085Partition Id Changes: 1
1086Better Partition Attach Attempts: 0
1087Better Parent Attach Attempts: 0
1088Parent Changes: 0
1089Time Disabled Milli: 10026
1090Time Detached Milli: 6852
1091Time Child Milli: 0
1092Time Router Milli: 0
1093Time Leader Milli: 16195
1094Time Tracked Milli: 33073
1095Done
1096> counters ip
1097TxSuccess: 10
1098TxFailed: 0
1099RxSuccess: 5
1100RxFailed: 0
1101Done
1102> counters br
1103Inbound Unicast: Packets 4 Bytes 320
1104Inbound Multicast: Packets 0 Bytes 0
1105Outbound Unicast: Packets 2 Bytes 160
1106Outbound Multicast: Packets 0 Bytes 0
1107RA Rx: 4
1108RA TxSuccess: 2
1109RA TxFailed: 0
1110RS Rx: 0
1111RS TxSuccess: 2
1112RS TxFailed: 0
1113Done
1114```
1115
1116### counters \<countername\> reset
1117
1118Reset the counter value.
1119
1120```bash
1121> counters mac reset
1122Done
1123> counters mle reset
1124Done
1125> counters ip reset
1126Done
1127```
1128
1129### csl
1130
1131Get the CSL configuration.
1132
1133CSL period is shown in microseconds.
1134
1135```bash
1136> csl
1137Channel: 11
1138Period: 160000us
1139Timeout: 1000s
1140Done
1141```
1142
1143### csl channel \<channel\>
1144
1145Set CSL channel.
1146
1147```bash
1148> csl channel 20
1149Done
1150```
1151
1152### csl period \<period\>
1153
1154Set CSL period in microseconds. Disable CSL by setting this parameter to `0`.
1155
1156The CSL period MUST be a multiple 160 microseconds which is 802.15.4 "ten symbols time".
1157
1158```bash
1159> csl period 30000000
1160Done
1161```
1162
1163### csl timeout \<timeout\>
1164
1165Set the CSL timeout in seconds.
1166
1167```bash
1168> csl timeout 10
1169Done
1170```
1171
1172### debug
1173
1174Executes a series of CLI commands to gather information about the device and thread network. This is intended for debugging.
1175
1176The output will display each executed CLI command preceded by "\$", followed by the corresponding command's generated output.
1177
1178The generated output encompasses the following information:
1179
1180- Version
1181- Current state
1182- RLOC16, extended MAC address
1183- Unicast and multicast IPv6 address list
1184- Channel
1185- PAN ID and extended PAN ID
1186- Network Data
1187- Partition ID
1188- Leader Data
1189
1190If the device is operating as FTD:
1191
1192- Child and neighbor table
1193- Router table and next hop Info
1194- Address cache table
1195- Registered MTD child IPv6 address
1196- Device properties
1197
1198If the device supports and acts as an SRP client:
1199
1200- SRP client state
1201- SRP client services and host info
1202
1203If the device supports and acts as an SRP sever:
1204
1205- SRP server state and address mode
1206- SRP server registered hosts and services
1207
1208If the device supports TREL:
1209
1210- TREL status and peer table
1211
1212If the device supports and acts as a border router:
1213
1214- BR state
1215- BR prefixes (OMR, on-link, NAT64)
1216- Discovered prefix table
1217
1218### delaytimermin
1219
1220Get the minimal delay timer (in seconds).
1221
1222```bash
1223> delaytimermin
122430
1225Done
1226```
1227
1228### delaytimermin \<delaytimermin\>
1229
1230Set the minimal delay timer (in seconds).
1231
1232```bash
1233> delaytimermin 60
1234Done
1235```
1236
1237### detach
1238
1239Start the graceful detach process by first notifying other nodes (sending Address Release if acting as a router, or setting Child Timeout value to zero on parent if acting as a child) and then stopping Thread protocol operation.
1240
1241```bash
1242> detach
1243Finished detaching
1244Done
1245```
1246
1247### detach async
1248
1249Start the graceful detach process similar to the `detach` command without blocking and waiting for the callback indicating that detach is finished.
1250
1251```bash
1252> detach async
1253Done
1254```
1255
1256### deviceprops
1257
1258Get the current device properties.
1259
1260```bash
1261> deviceprops
1262PowerSupply      : external
1263IsBorderRouter   : yes
1264SupportsCcm      : no
1265IsUnstable       : no
1266WeightAdjustment : 0
1267Done
1268```
1269
1270### deviceprops \<power-supply\> \<is-br\> \<supports-ccm\> \<is-unstable\> \<weight-adjustment\>
1271
1272Set the device properties which are then used to determine and set the Leader Weight.
1273
1274- power-supply: `battery`, `external`, `external-stable`, or `external-unstable`.
1275- weight-adjustment: Valid range is from -16 to +16. Clamped if not within the range.
1276
1277```bash
1278> deviceprops battery 0 0 0 -5
1279Done
1280
1281> deviceprops
1282PowerSupply      : battery
1283IsBorderRouter   : no
1284SupportsCcm      : no
1285IsUnstable       : no
1286WeightAdjustment : -5
1287Done
1288
1289> leaderweight
129051
1291Done
1292```
1293
1294### discover \[channel\]
1295
1296Perform an MLE Discovery operation.
1297
1298- channel: The channel to discover on. If no channel is provided, the discovery will cover all valid channels.
1299
1300```bash
1301> discover
1302| J | Network Name     | Extended PAN     | PAN  | MAC Address      | Ch | dBm | LQI |
1303+---+------------------+------------------+------+------------------+----+-----+-----+
1304| 0 | OpenThread       | dead00beef00cafe | ffff | f1d92a82c8d8fe43 | 11 | -20 |   0 |
1305Done
1306```
1307
1308### dns config
1309
1310Get the default query config used by DNS client.
1311
1312The config includes
1313
1314- Server IPv6 address and port
1315- Response timeout in msec (wait time to rx response)
1316- Maximum tx attempts before reporting failure
1317- Boolean flag to indicate whether the server can resolve the query recursively or not.
1318- Service resolution mode which specifies which records to query. Possible options are:
1319  - `srv` : Query for SRV record only.
1320  - `txt` : Query for TXT record only.
1321  - `srv_txt` : Query for both SRV and TXT records in the same message.
1322  - `srv_txt_sep`: Query in parallel for SRV and TXT using separate messages.
1323  - `srv_txt_opt`: Query for TXT/SRV together first, if it fails then query separately.
1324- Whether to allow/disallow NAT64 address translation during address resolution (requires `OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE`)
1325- Transport protocol UDP or TCP (requires `OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE`)
1326
1327```bash
1328> dns config
1329Server: [fd00:0:0:0:0:0:0:1]:1234
1330ResponseTimeout: 5000 ms
1331MaxTxAttempts: 2
1332RecursionDesired: no
1333ServiceMode: srv_txt_opt
1334Nat64Mode: allow
1335TransportProtocol: udp
1336Done
1337>
1338```
1339
1340### dns config \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\] \[service mode] \[protocol]
1341
1342Set the default query config.
1343
1344Service mode specifies which records to query. Possible options are:
1345
1346- `def` : Use default option.
1347- `srv` : Query for SRV record only.
1348- `txt` : Query for TXT record only.
1349- `srv_txt` : Query for both SRV and TXT records in the same message.
1350- `srv_txt_sep`: Query in parallel for SRV and TXT using separate messages.
1351- `srv_txt_opt`: Query for TXT/SRV together first, if it fails then query separately.
1352
1353To set protocol effectively to tcp `OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE` is required.
1354
1355```bash
1356> dns config fd00::1 1234 5000 2 0 srv_txt_sep tcp
1357Done
1358
1359> dns config
1360Server: [fd00:0:0:0:0:0:0:1]:1234
1361ResponseTimeout: 5000 ms
1362MaxTxAttempts: 2
1363RecursionDesired: no
1364ServiceMode: srv_txt_sep
1365Nat64Mode: allow
1366TransportProtocol: tcp
1367Done
1368```
1369
1370We can leave some of the fields as unspecified (or use value zero). The unspecified fields are replaced by the corresponding OT config option definitions `OPENTHREAD_CONFIG_DNS_CLIENT_DEFAULT_{}` to form the default query config.
1371
1372```bash
1373> dns config fd00::2
1374Done
1375
1376> dns config
1377Server: [fd00:0:0:0:0:0:0:2]:53
1378ResponseTimeout: 6000 ms
1379MaxTxAttempts: 3
1380RecursionDesired: yes
1381Nat64Mode: allow
1382TransportProtocol: udp
1383Done
1384```
1385
1386This final example shows how only 'recursion desired' and the service mode are set, and all other parameters are set to their defaults:
1387
1388```bash
1389> dns config :: 0 0 0 1 srv_txt_sep
1390Done
1391
1392> dns config
1393Server: [2001:4860:4860:0:0:0:0:8888]:53
1394ResponseTimeout: 6000 ms
1395MaxTxAttempts: 3
1396RecursionDesired: yes
1397ServiceMode: srv_txt_sep
1398Nat64Mode: allow
1399TransportProtocol: udp
1400Done
1401```
1402
1403### dns resolve \<hostname\> \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\] \[transport protocol\]
1404
1405Send DNS Query to obtain IPv6 address for given hostname.
1406
1407The parameters after `hostname` are optional. Any unspecified (or zero) value for these optional parameters is replaced by the value from the current default config (`dns config`).
1408
1409To use tcp, `OPENTHREAD_CONFIG_DNS_CLIENT_OVER_TCP_ENABLE` is required.
1410
1411```bash
1412> dns resolve ipv6.google.com
1413> DNS response for ipv6.google.com - 2a00:1450:401b:801:0:0:0:200e TTL: 300
1414```
1415
1416The DNS server IP can be an IPv4 address, which will be synthesized to an IPv6 address using the preferred NAT64 prefix from the network data.
1417
1418> Note: The command will return `InvalidState` when the DNS server IP is an IPv4 address but the preferred NAT64 prefix is unavailable.
1419
1420```bash
1421> dns resolve example.com 8.8.8.8
1422Synthesized IPv6 DNS server address: fdde:ad00:beef:2:0:0:808:808
1423DNS response for example.com. - fd4c:9574:3720:2:0:0:5db8:d822 TTL:20456
1424Done
1425```
1426
1427### dns resolve4 \<hostname\> \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\]
1428
1429Send DNS query to obtain IPv4 address for a given hostname and provide the NAT64 synthesized IPv6 addresses for the IPv4 addresses from the query response.
1430
1431Requires `OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE`.
1432
1433The parameters after `hostname` are optional. Any unspecified (or zero) value for these optional parameters is replaced by the value from the current default config (`dns config`).
1434
1435This command requires a NAT64 prefix to be configured and present in Thread Network Data.
1436
1437For example, if a NAT64 prefix of `2001:db8:122:344::/96` is used within the Thread mesh, the outputted IPv6 address corresponds to an IPv4 address of `142.250.191.78` for the `ipv4.google.com` host:
1438
1439```bash
1440> dns resolve4 ipv4.google.com
1441> DNS response for ipv4.google.com - 2001:db8:122:344:0:0:8efa:bf4e TTL: 20456
1442```
1443
1444### dns browse \<service-name\> \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\]
1445
1446Send a browse (service instance enumeration) DNS query to get the list of services for given service-name.
1447
1448The parameters after `service-name` are optional. Any unspecified (or zero) value for these optional parameters is replaced by the value from the current default config (`dns config`).
1449
1450```bash
1451> dns browse _service._udp.example.com
1452DNS browse response for _service._udp.example.com.
1453inst1
1454inst2
1455inst3
1456Done
1457```
1458
1459The detailed service info (port number, weight, host name, TXT data, host addresses) is outputted only when provided by server/resolver in the browse response (in additional Data Section). This is a SHOULD and not a MUST requirement, and servers/resolvers are not required to provide this.
1460
1461The recommended behavior, which is supported by the OpenThread DNS-SD resolver, is to only provide the additional data when there is a single instance in the response. However, users should assume that the browse response may only contain the list of matching service instances and not any detail service info. To resolve a service instance, users can use the `dns service` or `dns servicehost` commands.
1462
1463```bash
1464> dns browse _service._udp.example.com
1465DNS browse response for _service._udp.example.com.
1466inst1
1467    Port:1234, Priority:1, Weight:2, TTL:7200
1468    Host:host.example.com.
1469    HostAddress:fd00:0:0:0:0:0:0:abcd TTL:7200
1470    TXT:[a=6531, b=6c12] TTL:7300
1471Done
1472```
1473
1474```bash
1475> dns browse _airplay._tcp.default.service.arpa
1476DNS browse response for _airplay._tcp.default.service.arpa.
1477Gabe's Mac mini
1478    Port:7000, Priority:0, Weight:0, TTL:10
1479    Host:Gabes-Mac-mini.default.service.arpa.
1480    HostAddress:fd97:739d:386a:1:1c2e:d83c:fcbe:9cf4 TTL:10
1481Done
1482```
1483
1484> Note: The DNS server IP can be an IPv4 address, which will be synthesized to an IPv6 address using the preferred NAT64 prefix from the network data. The command will return `InvalidState` when the DNS server IP is an IPv4 address but the preferred NAT64 prefix is unavailable. When testing DNS-SD discovery proxy, the zone is not `local` and instead should be `default.service.arpa`.
1485
1486### dns service \<service-instance-label\> \<service-name\> \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\]
1487
1488Send a service instance resolution DNS query for a given service instance. Service instance label is provided first, followed by the service name (note that service instance label can contain dot '.' character).
1489
1490The parameters after `service-name` are optional. Any unspecified (or zero) value for these optional parameters is replaced by the value from the current default config (`dns config`).
1491
1492> Note: The DNS server IP can be an IPv4 address, which will be synthesized to an IPv6 address using the preferred NAT64 prefix from the network data. The command will return `InvalidState` when the DNS server IP is an IPv4 address but the preferred NAT64 prefix is unavailable.
1493
1494### dns servicehost \<service-instance-label\> \<service-name\> \[DNS server IP\] \[DNS server port\] \[response timeout (ms)\] \[max tx attempts\] \[recursion desired (boolean)\]
1495
1496Send a service instance resolution DNS query for a given service instance with a potential follow-up address resolution for the host name discovered for the service instance (if the server/resolver does not provide AAAA/A records for the host name in the response to SRV query).
1497
1498Service instance label is provided first, followed by the service name (note that service instance label can contain dot '.' character).
1499
1500The parameters after `service-name` are optional. Any unspecified (or zero) value for these optional parameters is replaced by the value from the current default config (`dns config`).
1501
1502### dns server upstream \[enable|disable\]
1503
1504Enable/Disable the upstream DNS feature. If no argument is provided, it prints whether the upstream DNS feature is enabled.
1505
1506`OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE` is required.
1507
1508Enable the upstream DNS feature.
1509
1510```
1511> dns server upstream enable
1512Done
1513```
1514
1515Get whether the upstream DNS feature is enabled.
1516
1517```
1518> dns server upstream
1519Enabled
1520Done
1521```
1522
1523### dns compression \[enable|disable\]
1524
1525Enable/Disable the "DNS name compression" mode.
1526
1527By default DNS name compression is enabled. When disabled, DNS names are appended as full and never compressed. This is applicable to OpenThread's DNS and SRP client/server modules.
1528
1529This is intended for testing only and available under `REFERENCE_DEVICE` config.
1530
1531Get the current "DNS name compression" mode.
1532
1533```
1534> dns compression
1535Enabled
1536```
1537
1538Set the "DNS name compression" mode.
1539
1540```
1541> dns compression disable
1542Done
1543>
1544>
1545> dns compression
1546Disabled
1547Done
1548```
1549
1550### domainname
1551
1552Get the Thread Domain Name for Thread 1.2 device.
1553
1554```bash
1555> domainname
1556Thread
1557Done
1558```
1559
1560### domainname \<name\>
1561
1562Set the Thread Domain Name for Thread 1.2 device.
1563
1564```bash
1565> domainname Test\ Thread
1566Done
1567```
1568
1569### dua iid
1570
1571Get the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device.
1572
1573```bash
1574> dua iid
15750004000300020001
1576Done
1577```
1578
1579### dua iid \<iid\>
1580
1581Set the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device.
1582
1583```bash
1584> dua iid 0004000300020001
1585Done
1586```
1587
1588### dua iid clear
1589
1590Clear the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device.
1591
1592```bash
1593> dua iid clear
1594Done
1595```
1596
1597### eidcache
1598
1599Print the EID-to-RLOC cache entries.
1600
1601```bash
1602> eidcache
1603fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7d 2000 cache canEvict=1 transTime=0 eid=fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7d
1604fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7f fffe retry canEvict=1 timeout=10 retryDelay=30
1605Done
1606```
1607
1608### eui64
1609
1610Get the factory-assigned IEEE EUI-64.
1611
1612```bash
1613> eui64
16140615aae900124b00
1615Done
1616```
1617
1618### extaddr
1619
1620Get the IEEE 802.15.4 Extended Address.
1621
1622```bash
1623> extaddr
1624dead00beef00cafe
1625Done
1626```
1627
1628### extaddr \<extaddr\>
1629
1630Set the IEEE 802.15.4 Extended Address.
1631
1632```bash
1633> extaddr dead00beef00cafe
1634dead00beef00cafe
1635Done
1636```
1637
1638### extpanid
1639
1640Get the Thread Extended PAN ID value.
1641
1642**NOTE** The current commissioning credential becomes stale after changing this value. Use [pskc](#pskc--p-keypassphrase) to reset.
1643
1644```bash
1645> extpanid
1646dead00beef00cafe
1647Done
1648```
1649
1650### extpanid \<extpanid\>
1651
1652Set the Thread Extended PAN ID value.
1653
1654```bash
1655> extpanid dead00beef00cafe
1656Done
1657```
1658
1659### factoryreset
1660
1661Delete all stored settings, and signal a platform reset.
1662
1663```bash
1664> factoryreset
1665```
1666
1667### fake
1668
1669Send fake Thread messages.
1670
1671Note: Only for certification test.
1672
1673#### fake /a/an \<dst-ipaddr\> \<target\> \<meshLocalIid\>
1674
1675```bash
1676> fake /a/an fdde:ad00:beef:0:0:ff:fe00:a800 fd00:7d03:7d03:7d03:55f2:bb6a:7a43:a03b 1111222233334444
1677Done
1678```
1679
1680### fem
1681
1682Get external FEM parameters.
1683
1684```bash
1685> fem
1686LNA gain 11 dBm
1687Done
1688```
1689
1690### fem lnagain
1691
1692Get the Rx LNA gain in dBm of the external FEM.
1693
1694```bash
1695> fem lnagain
169611
1697Done
1698```
1699
1700### fem lnagain \<LNA gain\>
1701
1702Set the Rx LNA gain in dBm of the external FEM.
1703
1704```bash
1705> fem lnagain 8
1706Done
1707```
1708
1709### ifconfig
1710
1711Show the status of the IPv6 interface.
1712
1713```bash
1714> ifconfig
1715down
1716Done
1717```
1718
1719### ifconfig up
1720
1721Bring up the IPv6 interface.
1722
1723```bash
1724> ifconfig up
1725Done
1726```
1727
1728### ifconfig down
1729
1730Bring down the IPv6 interface.
1731
1732```bash
1733> ifconfig down
1734Done
1735```
1736
1737### instanceid
1738
1739Show OpenThread instance identifier.
1740
1741```bash
1742> instanceid
1743468697314
1744Done
1745```
1746
1747### ipaddr
1748
1749List all IPv6 addresses assigned to the Thread interface.
1750
1751```bash
1752> ipaddr
1753fdde:ad00:beef:0:0:ff:fe00:0
1754fdde:ad00:beef:0:558:f56b:d688:799
1755fe80:0:0:0:f3d9:2a82:c8d8:fe43
1756Done
1757```
1758
1759Use `-v` to get more verbose information about the address:
1760
1761- `origin`: can be `thread`, `slaac`, `dhcp6`, or `manual`, and indicates the origin of the address
1762- `plen`: prefix length (in bits)
1763- `preferred`: preferred flag (boolean)
1764- `valid`: valid flag (boolean)
1765
1766```bash
1767> ipaddr -v
1768fd5e:18fa:f4a5:b8:0:ff:fe00:fc00 origin:thread plen:64 preferred:0 valid:1
1769fd5e:18fa:f4a5:b8:0:ff:fe00:dc00 origin:thread plen:64 preferred:0 valid:1
1770fd5e:18fa:f4a5:b8:f8e:5d95:87a0:e82c origin:thread plen:64 preferred:0 valid:1
1771fe80:0:0:0:4891:b191:e277:8826 origin:thread plen:64 preferred:1 valid:1
1772Done
1773```
1774
1775### ipaddr add \<ipaddr\>
1776
1777Add an IPv6 address to the Thread interface.
1778
1779```bash
1780> ipaddr add 2001::dead:beef:cafe
1781Done
1782```
1783
1784### ipaddr del \<ipaddr\>
1785
1786Delete an IPv6 address from the Thread interface.
1787
1788```bash
1789> ipaddr del 2001::dead:beef:cafe
1790Done
1791```
1792
1793### ipaddr linklocal
1794
1795Print Thread link-local IPv6 address.
1796
1797```bash
1798> ipaddr linklocal
1799fe80:0:0:0:f3d9:2a82:c8d8:fe43
1800Done
1801```
1802
1803### ipaddr mleid
1804
1805Print Thread Mesh Local EID address.
1806
1807```bash
1808> ipaddr mleid
1809fdde:ad00:beef:0:558:f56b:d688:799
1810Done
1811```
1812
1813### ipaddr rloc
1814
1815Print Thread Routing Locator (RLOC) address.
1816
1817```bash
1818> ipaddr rloc
1819fdde:ad00:beef:0:0:ff:fe00:0
1820Done
1821```
1822
1823### ipmaddr
1824
1825List all IPv6 multicast addresses subscribed to the Thread interface.
1826
1827```bash
1828> ipmaddr
1829ff05:0:0:0:0:0:0:1
1830ff33:40:fdde:ad00:beef:0:0:1
1831ff32:40:fdde:ad00:beef:0:0:1
1832Done
1833```
1834
1835### ipmaddr add \<ipaddr\>
1836
1837Subscribe the Thread interface to the IPv6 multicast address.
1838
1839```bash
1840> ipmaddr add ff05::1
1841Done
1842```
1843
1844### ipmaddr del \<ipaddr\>
1845
1846Unsubscribe the Thread interface to the IPv6 multicast address.
1847
1848```bash
1849> ipmaddr del ff05::1
1850Done
1851```
1852
1853### ipmaddr llatn
1854
1855Get the Link-Local All Thread Nodes multicast address.
1856
1857```
1858> ipmaddr llatn
1859ff32:40:fdde:ad00:beef:0:0:1
1860Done
1861```
1862
1863### ipmaddr rlatn
1864
1865Get the Realm-Local All Thread Nodes multicast address.
1866
1867```
1868> ipmaddr rlatn
1869ff33:40:fdde:ad00:beef:0:0:1
1870Done
1871```
1872
1873### joinerport \<port\>
1874
1875Set the Joiner port.
1876
1877```bash
1878> joinerport 1000
1879Done
1880```
1881
1882### keysequence counter
1883
1884Get the Thread Key Sequence Counter.
1885
1886```bash
1887> keysequence counter
188810
1889Done
1890```
1891
1892### keysequence counter \<counter\>
1893
1894Set the Thread Key Sequence Counter.
1895
1896This command is reserved for testing and demo purposes only. Changing Key Sequence Counter will render a production application non-compliant with the Thread Specification.
1897
1898```bash
1899> keysequence counter 10
1900Done
1901```
1902
1903### keysequence guardtime
1904
1905Get Thread Key Switch Guard Time (in hours)
1906
1907```bash
1908> keysequence guardtime
19090
1910Done
1911```
1912
1913### keysequence guardtime \<guardtime\>
1914
1915Set Thread Key Switch Guard Time (in hours).
1916
1917This command is reserved for testing and demo purposes only. Changing Key Switch Guard Time will render a production application non-compliant with the Thread Specification.
1918
1919```bash
1920> keysequence guardtime 0
1921Done
1922```
1923
1924### leaderdata
1925
1926Show the Thread Leader Data.
1927
1928```bash
1929> leaderdata
1930Partition ID: 1077744240
1931Weighting: 64
1932Data Version: 109
1933Stable Data Version: 211
1934Leader Router ID: 60
1935Done
1936```
1937
1938### leaderweight
1939
1940Get the Thread Leader Weight.
1941
1942```bash
1943> leaderweight
1944128
1945Done
1946```
1947
1948### leaderweight \<weight\>
1949
1950Set the Thread Leader Weight.
1951
1952```bash
1953> leaderweight 128
1954Done
1955```
1956
1957### linkmetrics config \[async\] \<ipaddr\> enhanced-ack clear
1958
1959Send a Link Metrics Management Request to clear an Enhanced-ACK Based Probing.
1960
1961- async: Use the non-blocking mode.
1962- ipaddr: Peer address (SHOULD be link local address of the neighboring device).
1963
1964```bash
1965> linkmetrics config fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack clear
1966Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
1967Status: Success
1968Done
1969
1970> linkmetrics config async fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack clear
1971Done
1972> Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
1973Status: Success
1974```
1975
1976### linkmetrics config \[async\] \<ipaddr\> enhanced-ack register \<qmr\> \[r\]
1977
1978Send a Link Metrics Management Request to register an Enhanced-ACK Based Probing.
1979
1980- async: Use the non-blocking mode.
1981- ipaddr: Peer address.
1982- qmr: This specifies what metrics to query. At most two options are allowed to select (per spec 4.11.3.4.4.6).
1983  - q: Layer 2 LQI.
1984  - m: Link Margin.
1985  - r: RSSI.
1986- r: This is optional and only used for reference devices. When this option is specified, Type/Average Enum of each Type Id Flags would be set to `reserved`. This is used to verify the Probing Subject correctly handles invalid Type Id Flags. This is only available when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.
1987
1988```bash
1989> linkmetrics config fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack register qm
1990Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
1991Status: Success
1992Done
1993
1994> linkmetrics config async fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack register qm
1995Done
1996> Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
1997Status: Success
1998
1999> linkmetrics config async fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack register qm r
2000Done
2001> Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
2002Status: Cannot support new series
2003```
2004
2005### linkmetrics config \[async\] \<ipaddr\> forward \<seriesid\> \<ldraX\> \<pqmr\>
2006
2007Send a Link Metrics Management Request to configure a Forward Tracking Series.
2008
2009- async: Use the non-blocking mode.
2010- ipaddr: Peer address.
2011- seriesid: The Series ID.
2012- ldraX: This specifies which frames are to be accounted.
2013  - l: MLE Link Probe.
2014  - d: MAC Data.
2015  - r: MAC Data Request.
2016  - a: MAC Ack.
2017  - X: This represents none of the above flags, i.e., to stop accounting and remove the series. This can only be used without any other flags.
2018- pqmr: This specifies what metrics to query.
2019  - p: Layer 2 Number of PDUs received.
2020  - q: Layer 2 LQI.
2021  - m: Link Margin.
2022  - r: RSSI.
2023
2024```bash
2025> linkmetrics config fe80:0:0:0:3092:f334:1455:1ad2 forward 1 dra pqmr
2026Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
2027Status: SUCCESS
2028Done
2029
2030> linkmetrics config async fe80:0:0:0:3092:f334:1455:1ad2 forward 1 dra pqmr
2031Done
2032> Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2
2033Status: SUCCESS
2034```
2035
2036### linkmetrics probe \<ipaddr\> \<seriesid\> \<length\>
2037
2038Send a MLE Link Probe message to the peer.
2039
2040- ipaddr: Peer address.
2041- seriesid: The Series ID for which this Probe message targets at.
2042- length: The length of the Probe message, valid range: [0, 64].
2043
2044```bash
2045> linkmetrics probe fe80:0:0:0:3092:f334:1455:1ad2 1 10
2046Done
2047```
2048
2049### linkmetrics request \[async\] \<ipaddr\> single \<pqmr\>
2050
2051Perform a Link Metrics query (Single Probe).
2052
2053- async: Use the non-blocking mode.
2054- ipaddr: Peer address.
2055- pqmr: This specifies what metrics to query.
2056  - p: Layer 2 Number of PDUs received.
2057  - q: Layer 2 LQI.
2058  - m: Link Margin.
2059  - r: RSSI.
2060
2061```bash
2062> linkmetrics request fe80:0:0:0:3092:f334:1455:1ad2 single qmr
2063Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2
2064
2065 - LQI: 76 (Exponential Moving Average)
2066 - Margin: 82 (dB) (Exponential Moving Average)
2067 - RSSI: -18 (dBm) (Exponential Moving Average)
2068Done
2069
2070> linkmetrics request async fe80:0:0:0:3092:f334:1455:1ad2 single qmr
2071Done
2072> Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2
2073
2074 - LQI: 76 (Exponential Moving Average)
2075 - Margin: 82 (dB) (Exponential Moving Average)
2076 - RSSI: -18 (dBm) (Exponential Moving Average)
2077```
2078
2079### linkmetrics request \[async\] \<ipaddr\> forward \<seriesid\>
2080
2081Perform a Link Metrics query (Forward Tracking Series).
2082
2083- sync: Use the blocking mode.
2084- ipaddr: Peer address.
2085- seriesid: The Series ID.
2086
2087```bash
2088> linkmetrics request fe80:0:0:0:3092:f334:1455:1ad2 forward 1
2089Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2
2090
2091 - PDU Counter: 2 (Count/Summation)
2092 - LQI: 76 (Exponential Moving Average)
2093 - Margin: 82 (dB) (Exponential Moving Average)
2094 - RSSI: -18 (dBm) (Exponential Moving Average)
2095Done
2096
2097> linkmetrics request async fe80:0:0:0:3092:f334:1455:1ad2 forward 1
2098Done
2099> Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2
2100
2101 - PDU Counter: 2 (Count/Summation)
2102 - LQI: 76 (Exponential Moving Average)
2103 - Margin: 82 (dB) (Exponential Moving Average)
2104 - RSSI: -18 (dBm) (Exponential Moving Average)
2105```
2106
2107### linkmetricsmgr disable
2108
2109Disable the Link Metrics Manager.
2110
2111`OPENTHREAD_CONFIG_LINK_METRICS_MANAGER_ENABLE` is required.
2112
2113```bash
2114> linkmetricsmgr disable
2115Done
2116```
2117
2118### linkmetricsmgr enable
2119
2120Enable the Link Metrics Manager.
2121
2122`OPENTHREAD_CONFIG_LINK_METRICS_MANAGER_ENABLE` is required.
2123
2124```bash
2125> linkmetricsmgr enable
2126Done
2127```
2128
2129### linkmetricsmgr show
2130
2131Display the Link Metrics data of all subjects. The subjects are identified by its extended address.
2132
2133`OPENTHREAD_CONFIG_LINK_METRICS_MANAGER_ENABLE` is required.
2134
2135```bash
2136
2137> linkmetricsmgr show
2138ExtAddr:827aa7f7f63e1234, LinkMargin:80, Rssi:-20
2139Done
2140```
2141
2142### locate
2143
2144Gets the current state (`In Progress` or `Idle`) of anycast locator.
2145
2146`OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE` is required.
2147
2148```bash
2149> locate
2150Idle
2151Done
2152
2153> locate fdde:ad00:beef:0:0:ff:fe00:fc10
2154
2155> locate
2156In Progress
2157Done
2158```
2159
2160### locate \<anycastaddr\>
2161
2162Locate the closest destination of an anycast address (i.e., find the destination's mesh local EID and RLOC16).
2163
2164`OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE` is required.
2165
2166The closest destination is determined based on the the current routing table and path costs within the Thread mesh.
2167
2168Locate the leader using its anycast address:
2169
2170```bash
2171> locate fdde:ad00:beef:0:0:ff:fe00:fc00
2172fdde:ad00:beef:0:d9d3:9000:16b:d03b 0xc800
2173Done
2174```
2175
2176Locate the closest destination of a service anycast address:
2177
2178```bash
2179
2180> srp server enable
2181Done
2182
2183> netdata show
2184Prefixes:
2185Routes:
2186Services:
218744970 5d c002 s c800
218844970 5d c002 s cc00
2189Done
2190
2191> locate fdde:ad00:beef:0:0:ff:fe00:fc10
2192fdde:ad00:beef:0:a477:dc98:a4e4:71ea 0xcc00
2193done
2194```
2195
2196### log filename \<filename\>
2197
2198- Note: Simulation Only, ie: `OPENTHREAD_EXAMPLES_SIMULATION`
2199- Requires `OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART`
2200
2201Specifies filename to capture otPlatLog() messages, useful when debugging automated test scripts on Linux when logging disrupts the automated test scripts.
2202
2203### log level
2204
2205Get the log level.
2206
2207```bash
2208> log level
22091
2210Done
2211```
2212
2213### log level \<level\>
2214
2215Set the log level.
2216
2217```bash
2218> log level 4
2219Done
2220```
2221
2222### meshdiag topology \[ip6-addrs\] \[children\]
2223
2224Discover network topology (list of routers and their connections).
2225
2226This command requires `OPENTHREAD_CONFIG_MESH_DIAG_ENABLE` and `OPENTHREAD_FTD`.
2227
2228Parameters are optional and indicate additional items to discover. Can be added in any order.
2229
2230- `ip6-addrs` to discover the list of IPv6 addresses of every router.
2231- `children` to discover the child table of every router.
2232
2233Output lists all discovered routers. Information per router:
2234
2235- Router ID
2236- RLOC16
2237- Extended MAC address
2238- Thread Version (if known).
2239- Whether the router is this device is itself (`me`)
2240- Whether the router is the parent of this device when device is a child (`parent`)
2241- Whether the router is `leader`
2242- Whether the router acts as a border router providing external connectivity (`br`)
2243- List of routers to which this router has a link:
2244  - `3-links`: Router IDs to which this router has a incoming link with link quality 3
2245  - `2-links`: Router IDs to which this router has a incoming link with link quality 2
2246  - `1-links`: Router IDs to which this router has a incoming link with link quality 1
2247  - If a list if empty, it is omitted in the out.
2248- If `ip6-addrs`, list of IPv6 addresses of the router
2249- If `children`, list of all children of the router. Information per child:
2250  - RLOC16
2251  - Incoming Link Quality from perspective of parent to child (zero indicates unknown)
2252  - Child Device mode (`r` rx-on-when-idle, `d` Full Thread Device, `n` Full Network Data, `-` no flags set)
2253  - Whether the child is this device itself (`me`)
2254  - Whether the child acts as a border router providing external connectivity (`br`)
2255
2256Discover network topology:
2257
2258```bash
2259> meshdiag topology
2260id:02 rloc16:0x0800 ext-addr:8aa57d2c603fe16c ver:4 - me - leader
2261   3-links:{ 46 }
2262id:46 rloc16:0xb800 ext-addr:fe109d277e0175cc ver:4
2263   3-links:{ 02 51 57 }
2264id:33 rloc16:0x8400 ext-addr:d2e511a146b9e54d ver:4
2265   3-links:{ 51 57 }
2266id:51 rloc16:0xcc00 ext-addr:9aab43ababf05352 ver:4
2267   3-links:{ 33 57 }
2268   2-links:{ 46 }
2269id:57 rloc16:0xe400 ext-addr:dae9c4c0e9da55ff ver:4
2270   3-links:{ 46 51 }
2271   1-links:{ 33 }
2272Done
2273```
2274
2275Discover network topology with router's IPv6 addresses and children:
2276
2277```bash
2278> meshdiag topology children ip6-addrs
2279id:62 rloc16:0xf800 ext-addr:ce349873897233a5 ver:4 - me - br
2280   3-links:{ 46 }
2281   ip6-addrs:
2282       fdde:ad00:beef:0:0:ff:fe00:f800
2283       fdde:ad00:beef:0:211d:39e9:6b2e:4ad1
2284       fe80:0:0:0:cc34:9873:8972:33a5
2285   children: none
2286id:02 rloc16:0x0800 ext-addr:8aa57d2c603fe16c ver:4 - leader - br
2287   3-links:{ 46 51 }
2288   ip6-addrs:
2289       fdde:ad00:beef:0:0:ff:fe00:fc00
2290       fdde:ad00:beef:0:0:ff:fe00:800
2291       fdde:ad00:beef:0:8a36:a3eb:47ae:a9b0
2292       fe80:0:0:0:88a5:7d2c:603f:e16c
2293   children:
2294       rloc16:0x0803 lq:3, mode:rn
2295       rloc16:0x0804 lq:3, mode:rdn
2296id:33 rloc16:0x8400 ext-addr:d2e511a146b9e54d ver:4
2297   3-links:{ 57 }
2298   ip6-addrs:
2299       fdde:ad00:beef:0:0:ff:fe00:8400
2300       fdde:ad00:beef:0:824:a126:cf19:a9f4
2301       fe80:0:0:0:d0e5:11a1:46b9:e54d
2302   children: none
2303id:51 rloc16:0xcc00 ext-addr:9aab43ababf05352 ver:4
2304   3-links:{ 02 46 57 }
2305   ip6-addrs:
2306       fdde:ad00:beef:0:0:ff:fe00:cc00
2307       fdde:ad00:beef:0:2986:bba3:12d0:1dd2
2308       fe80:0:0:0:98ab:43ab:abf0:5352
2309   children: none
2310id:57 rloc16:0xe400 ext-addr:dae9c4c0e9da55ff ver:4
2311   3-links:{ 33 51 }
2312   ip6-addrs:
2313       fdde:ad00:beef:0:0:ff:fe00:e400
2314       fdde:ad00:beef:0:87d0:550:bc18:9920
2315       fe80:0:0:0:d8e9:c4c0:e9da:55ff
2316   children:
2317       rloc16:0xe402 lq:3, mode:rn - br
2318       rloc16:0xe403 lq:3, mode:rn
2319id:46 rloc16:0xb800 ext-addr:fe109d277e0175cc ver:4
2320   3-links:{ 02 51 62 }
2321   ip6-addrs:
2322       fdde:ad00:beef:0:0:ff:fe00:b800
2323       fdde:ad00:beef:0:df4d:2994:d85c:c337
2324       fe80:0:0:0:fc10:9d27:7e01:75cc
2325   children: none
2326Done
2327```
2328
2329Discover network topology with children:
2330
2331```bash
2332> meshdiag topology children
2333id:02 rloc16:0x0800 ext-addr:8aa57d2c603fe16c ver:4 - parent - leader - br
2334   3-links:{ 46 51 }
2335   children:
2336       rloc16:0x0803 lq:0, mode:rn
2337       rloc16:0x0804 lq:0, mode:rdn - me
2338id:46 rloc16:0xb800 ext-addr:fe109d277e0175cc ver:4
2339   3-links:{ 02 51 62 }
2340   children: none
2341id:33 rloc16:0x8400 ext-addr:d2e511a146b9e54d ver:4
2342   3-links:{ 57 }
2343   children: none
2344id:51 rloc16:0xcc00 ext-addr:9aab43ababf05352 ver:4
2345   3-links:{ 02 46 57 }
2346   children: none
2347id:57 rloc16:0xe400 ext-addr:dae9c4c0e9da55ff ver:4
2348   3-links:{ 33 51 }
2349   children:
2350       rloc16:0xe402 lq:3, mode:rn - br
2351       rloc16:0xe403 lq:3, mode:rn
2352id:62 rloc16:0xf800 ext-addr:ce349873897233a5 ver:4 - br
2353   3-links:{ 46 }
2354   children: none
2355```
2356
2357### meshdiag childtable \<router-rloc16\>
2358
2359Start a query for child table of a router with a given RLOC16.
2360
2361Output lists all child entries. Information per child:
2362
2363- RLOC16
2364- Extended MAC address
2365- Thread Version
2366- Timeout (in seconds)
2367- Age (seconds since last heard)
2368- Supervision interval (in seconds)
2369- Number of queued messages (in case the child is sleepy)
2370- Device Mode
2371- RSS (average and last) and link margin
2372- Error rates, frame tx (at MAC layer), IPv6 message tx (above MAC)
2373- Connection time (seconds since link establishment {dd}d.{hh}:{mm}:{ss} format)
2374- CSL info
2375  - If synchronized
2376  - Period (in unit of 10-symbols-time)
2377  - Timeout (in seconds)
2378  - Channel
2379
2380```bash
2381> meshdiag childtable 0x6400
2382rloc16:0x6402 ext-addr:8e6f4d323bbed1fe ver:4
2383    timeout:120 age:36 supvn:129 q-msg:0
2384    rx-on:yes type:ftd full-net:yes
2385    rss - ave:-20 last:-20 margin:80
2386    err-rate - frame:11.51% msg:0.76%
2387    conn-time:00:11:07
2388    csl - sync:no period:0 timeout:0 channel:0
2389rloc16:0x6403 ext-addr:ee24e64ecf8c079a ver:4
2390    timeout:120 age:19 supvn:129 q-msg:0
2391    rx-on:no type:mtd full-net:no
2392    rss - ave:-20 last:-20 margin:80
2393    err-rate - frame:0.73% msg:0.00%
2394    conn-time:01:08:53
2395    csl - sync:no period:0 timeout:0 channel:0
2396Done
2397```
2398
2399### meshdiag childip6 \<parent-rloc16\>
2400
2401Send a query to a parent to retrieve the IPv6 addresses of all its MTD children.
2402
2403```bash
2404> meshdiag childip6 0xdc00
2405child-rloc16: 0xdc02
2406    fdde:ad00:beef:0:ded8:cd58:b73:2c21
2407    fd00:2:0:0:c24a:456:3b6b:c597
2408    fd00:1:0:0:120b:95fe:3ecc:d238
2409child-rloc16: 0xdc03
2410    fdde:ad00:beef:0:3aa6:b8bf:e7d6:eefe
2411    fd00:2:0:0:8ff8:a188:7436:6720
2412    fd00:1:0:0:1fcf:5495:790a:370f
2413Done
2414```
2415
2416### meshdiag routerneighbortable \<router-rloc16\>
2417
2418Start a query for router neighbor table of a router with a given RLOC16.
2419
2420Output lists all router neighbor entries. Information per entry:
2421
2422- RLOC16
2423- Extended MAC address
2424- Thread Version
2425- RSS (average and last) and link margin
2426- Error rates, frame tx (at MAC layer), IPv6 message tx (above MAC)
2427- Connection time (seconds since link establishment {dd}d.{hh}:{mm}:{ss} format)
2428
2429```bash
2430> meshdiag routerneighbortable 0x7400
2431rloc16:0x9c00 ext-addr:764788cf6e57a4d2 ver:4
2432   rss - ave:-20 last:-20 margin:80
2433   err-rate - frame:1.38% msg:0.00%
2434   conn-time:01:54:02
2435rloc16:0x7c00 ext-addr:4ed24fceec9bf6d3 ver:4
2436   rss - ave:-20 last:-20 margin:80
2437   err-rate - frame:0.72% msg:0.00%
2438   conn-time:00:11:27
2439Done
2440```
2441
2442### mliid \<iid\>
2443
2444Set the Mesh Local IID.
2445
2446It must be used before Thread stack is enabled.
2447
2448Only for testing/reference device.
2449
2450```bash
2451> mliid 1122334455667788
2452Done
2453```
2454
2455### mlr reg \<ipaddr\> ... [timeout]
2456
2457Register Multicast Listeners to Primary Backbone Router, with an optional `timeout` (in seconds).
2458
2459Omit `timeout` to use the default MLR timeout on the Primary Backbone Router.
2460
2461Use `timeout = 0` to deregister Multicast Listeners.
2462
2463NOTE: Only for Thread 1.2 Commissioner FTD device.
2464
2465```bash
2466> mlr reg ff04::1
2467status 0, 0 failed
2468Done
2469> mlr reg ff04::1 ff04::2 ff02::1
2470status 2, 1 failed
2471ff02:0:0:0:0:0:0:1
2472Done
2473> mlr reg ff04::1 ff04::2 1000
2474status 0, 0 failed
2475Done
2476> mlr reg ff04::1 ff04::2 0
2477status 0, 0 failed
2478Done
2479```
2480
2481### mode
2482
2483Get the Thread Device Mode value.
2484
2485- -: no flags set (rx-off-when-idle, minimal Thread device, stable network data)
2486- r: rx-on-when-idle
2487- d: Full Thread Device
2488- n: Full Network Data
2489
2490```bash
2491> mode
2492rdn
2493Done
2494```
2495
2496### mode [rdn]
2497
2498Set the Thread Device Mode value.
2499
2500- -: no flags set (rx-off-when-idle, minimal Thread device, stable network data)
2501- r: rx-on-when-idle
2502- d: Full Thread Device
2503- n: Full Network Data
2504
2505```bash
2506> mode rdn
2507Done
2508```
2509
2510```bash
2511> mode -
2512Done
2513```
2514
2515### multiradio
2516
2517Get the list of supported radio links by the device.
2518
2519This command is always available, even when only a single radio is supported by the device.
2520
2521```bash
2522> multiradio
2523[15.4, TREL]
2524Done
2525```
2526
2527### multiradio neighbor list
2528
2529Get the list of neighbors and their supported radios and their preference.
2530
2531This command is only available when device supports more than one radio link.
2532
2533```bash
2534> multiradio neighbor list
2535ExtAddr:3a65bc38dbe4a5be, RLOC16:0xcc00, Radios:[15.4(255), TREL(255)]
2536ExtAddr:17df23452ee4a4be, RLOC16:0x1300, Radios:[15.4(255)]
2537Done
2538```
2539
2540### multiradio neighbor \<ext address\>
2541
2542Get the radio info for specific neighbor with a given extended address.
2543
2544This command is only available when device supports more than one radio link.
2545
2546```bash
2547> multiradio neighbor 3a65bc38dbe4a5be
2548[15.4(255), TREL(255)]
2549Done
2550```
2551
2552### nat64 cidr
2553
2554Gets the IPv4 configured CIDR in the NAT64 translator.
2555
2556`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required.
2557
2558```bash
2559> nat64 cidr
2560192.168.255.0/24
2561Done
2562```
2563
2564### nat64 cidr \<IPv4 address\>
2565
2566Sets the IPv4 CIDR in the NAT64 translator.
2567
2568Note:
2569
2570- `OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required.
2571- A valid CIDR must have a non-zero prefix length.
2572- When updating the CIDR, NAT64 translator will be reset and all existing sessions will be expired.
2573
2574```bash
2575> nat64 cidr 192.168.100.0/24
2576Done
2577```
2578
2579### nat64 disable
2580
2581Disable NAT64 functions, including the translator and the prefix publishing.
2582
2583This command will reset the mapping table in the translator (if NAT64 translator is enabled in the build).
2584
2585`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` or `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` are required.
2586
2587```bash
2588> nat64 disable
2589Done
2590```
2591
2592### nat64 enable
2593
2594Enable NAT64 functions, including the translator and the prefix publishing.
2595
2596This command can be called anytime.
2597
2598`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` or `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` are required.
2599
2600```bash
2601> nat64 enable
2602Done
2603```
2604
2605### nat64 state
2606
2607Gets the state of NAT64 functions.
2608
2609Possible results for prefix manager are (`OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` is required):
2610
2611- `Disabled`: NAT64 prefix manager is disabled.
2612- `NotRunning`: NAT64 prefix manager is enabled, but is not running, probably because the routing manager is disabled.
2613- `Idle`: NAT64 prefix manager is enabled and is running, but is not publishing a NAT64 prefix. Usually when there is another border router publishing a NAT64 prefix with higher priority.
2614- `Active`: NAT64 prefix manager is enabled, running and publishing a NAT64 prefix.
2615
2616Possible results for NAT64 translator are (`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required):
2617
2618- `Disabled`: NAT64 translator is disabled.
2619- `NotRunning`: NAT64 translator is enabled, but is not translating packets, probably because it is not configured with a NAT64 prefix or a CIDR for NAT64.
2620- `Active`: NAT64 translator is enabled and is translating packets.
2621
2622`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` or `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` are required.
2623
2624```bash
2625> nat64 state
2626PrefixManager: NotRunning
2627Translator:    NotRunning
2628Done
2629
2630> nat64 state
2631PrefixManager: Idle
2632Translator:    NotRunning
2633Done
2634
2635> nat64 state
2636PrefixManager: Active
2637Translator:    Active
2638Done
2639```
2640
2641### nat64 mappings
2642
2643Get the NAT64 translator mappings.
2644
2645`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required.
2646
2647```bash
2648> nat64 mappings
2649|          | Address                   |        | 4 to 6       | 6 to 4       |
2650+----------+---------------------------+--------+--------------+--------------+
2651| ID       | IPv6       | IPv4         | Expiry | Pkts | Bytes | Pkts | Bytes |
2652+----------+------------+--------------+--------+------+-------+------+-------+
2653| 00021cb9 | fdc7::df79 | 192.168.64.2 |  7196s |    6 |   456 |   11 |  1928 |
2654|          |                                TCP |    0 |     0 |    0 |     0 |
2655|          |                                UDP |    1 |   136 |   16 |  1608 |
2656|          |                               ICMP |    5 |   320 |    5 |   320 |
2657```
2658
2659### nat64 counters
2660
2661Get the NAT64 translator packet and error counters.
2662
2663`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required.
2664
2665```bash
2666> nat64 counters
2667|               | 4 to 6                  | 6 to 4                  |
2668+---------------+-------------------------+-------------------------+
2669| Protocol      | Pkts     | Bytes        | Pkts     | Bytes        |
2670+---------------+----------+--------------+----------+--------------+
2671|         Total |       11 |          704 |       11 |          704 |
2672|           TCP |        0 |            0 |        0 |            0 |
2673|           UDP |        0 |            0 |        0 |            0 |
2674|          ICMP |       11 |          704 |       11 |          704 |
2675| Errors        | Pkts                    | Pkts                    |
2676+---------------+-------------------------+-------------------------+
2677|         Total |                       8 |                       4 |
2678|   Illegal Pkt |                       0 |                       0 |
2679|   Unsup Proto |                       0 |                       0 |
2680|    No Mapping |                       2 |                       0 |
2681Done
2682```
2683
2684### neighbor linkquality
2685
2686Print link quality info for all neighbors.
2687
2688```bash
2689> neighbor linkquality
2690| RLOC16 | Extended MAC     | Frame Error | Msg Error | Avg RSS | Last RSS | Age   |
2691+--------+------------------+-------------+-----------+---------+----------+-------+
2692| 0xe800 | 9e2fa4e1b84f92db |      0.00 % |    0.00 % |     -46 |      -48 |     1 |
2693| 0xc001 | 0ad7ed6beaa6016d |      4.67 % |    0.08 % |     -68 |      -72 |    10 |
2694Done
2695```
2696
2697### neighbor list
2698
2699List RLOC16 of neighbors.
2700
2701```bash
2702> neighbor list
27030xcc01 0xc800 0xf000
2704Done
2705```
2706
2707### neighbor table
2708
2709Print table of neighbors.
2710
2711```bash
2712> neighbor table
2713| Role | RLOC16 | Age | Avg RSSI | Last RSSI |R|D|N| Extended MAC     |
2714+------+--------+-----+----------+-----------+-+-+-+------------------+
2715|   C  | 0xcc01 |  96 |      -46 |       -46 |1|1|1| 1eb9ba8a6522636b |
2716|   R  | 0xc800 |   2 |      -29 |       -29 |1|1|1| 9a91556102c39ddb |
2717|   R  | 0xf000 |   3 |      -28 |       -28 |1|1|1| 0ad7ed6beaa6016d |
2718Done
2719```
2720
2721### neighbor conntime
2722
2723Print connection time and age of neighbors.
2724
2725The table provides the following info per neighbor:
2726
2727- RLOC16
2728- Extended MAC address
2729- Age (seconds since last heard from neighbor)
2730- Connection time (seconds since link establishment with neighbor)
2731
2732Duration intervals are formatted as `<hh>:<mm>:<ss>` for hours, minutes, and seconds if the duration is less than one day. If the duration is longer than one day, the format is `<dd>d.<hh>:<mm>:<ss>`.
2733
2734```bash
2735> neighbor conntime
2736| RLOC16 | Extended MAC     | Last Heard (Age) | Connection Time  |
2737+--------+------------------+------------------+------------------+
2738| 0x8401 | 1a28be396a14a318 |         00:00:13 |         00:07:59 |
2739| 0x5c00 | 723ebf0d9eba3264 |         00:00:03 |         00:11:27 |
2740| 0xe800 | ce53628a1e3f5b3c |         00:00:02 |         00:00:15 |
2741Done
2742```
2743
2744### neighbor conntime list
2745
2746Print connection time and age of neighbors.
2747
2748This command is similar to `neighbor conntime`, but it displays the information in a list format. The age and connection time are both displayed in seconds.
2749
2750```bash
2751> neighbor conntime list
27520x8401 1a28be396a14a318 age:63 conn-time:644
27530x5c00 723ebf0d9eba3264 age:23 conn-time:852
27540xe800 ce53628a1e3f5b3c age:23 conn-time:180
2755Done
2756```
2757
2758### netstat
2759
2760List all UDP sockets.
2761
2762```bash
2763> netstat
2764| Local Address                                   | Peer Address                                    |
2765+-------------------------------------------------+-------------------------------------------------+
2766| [0:0:0:0:0:0:0:0]:49153                         | [0:0:0:0:0:0:0:0]:0                             |
2767| [0:0:0:0:0:0:0:0]:49152                         | [0:0:0:0:0:0:0:0]:0                             |
2768| [0:0:0:0:0:0:0:0]:61631                         | [0:0:0:0:0:0:0:0]:0                             |
2769| [0:0:0:0:0:0:0:0]:19788                         | [0:0:0:0:0:0:0:0]:0                             |
2770Done
2771```
2772
2773### networkdiagnostic get \<addr\> \<type\> ..
2774
2775Send network diagnostic request to retrieve tlv of \<type\>s.
2776
2777If \<addr\> is unicast address, `Diagnostic Get` will be sent. if \<addr\> is multicast address, `Diagnostic Query` will be sent.
2778
2779```bash
2780> networkdiagnostic get fdde:ad00:beef:0:0:ff:fe00:fc00 0 1 6
2781> DIAG_GET.rsp/ans: 00080e336e1c41494e1c01020c000608640b0f674074c503
2782Ext Address: '0e336e1c41494e1c'
2783Rloc16: 0x0c00
2784Leader Data:
2785    PartitionId: 0x640b0f67
2786    Weighting: 64
2787    DataVersion: 116
2788    StableDataVersion: 197
2789    LeaderRouterId: 0x03
2790Done
2791
2792> networkdiagnostic get ff02::1 0 1
2793> DIAG_GET.rsp/ans: 00080e336e1c41494e1c01020c00
2794Ext Address: '0e336e1c41494e1c'
2795Rloc16: 0x0c00
2796Done
2797DIAG_GET.rsp/ans: 00083efcdb7e3f9eb0f201021800
2798Ext Address: '3efcdb7e3f9eb0f2'
2799Rloc16: 0x1800
2800Done
2801```
2802
2803### networkdiagnostic reset \<addr\> \<type\> ..
2804
2805Send network diagnostic request to reset \<addr\>'s tlv of \<type\>s. Currently only `MAC Counters`(9) is supported.
2806
2807```bash
2808> diagnostic reset fd00:db8::ff:fe00:0 9
2809Done
2810```
2811
2812### networkidtimeout
2813
2814Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
2815
2816```bash
2817> networkidtimeout
2818120
2819Done
2820```
2821
2822### networkidtimeout \<timeout\>
2823
2824Set the NETWORK_ID_TIMEOUT parameter used in the Router role.
2825
2826```bash
2827> networkidtimeout 120
2828Done
2829```
2830
2831### networkkey
2832
2833Get the Thread Network Key value.
2834
2835```bash
2836> networkkey
283700112233445566778899aabbccddeeff
2838Done
2839```
2840
2841### networkkey \<key\>
2842
2843Set the Thread Network Key value.
2844
2845```bash
2846> networkkey 00112233445566778899aabbccddeeff
2847Done
2848```
2849
2850### networkname
2851
2852Get the Thread Network Name.
2853
2854```bash
2855> networkname
2856OpenThread
2857Done
2858```
2859
2860### networkname \<name\>
2861
2862Set the Thread Network Name.
2863
2864**NOTE** The current commissioning credential becomes stale after changing this value. Use [pskc](#pskc--p-keypassphrase) to reset.
2865
2866```bash
2867> networkname OpenThread
2868Done
2869```
2870
2871### networktime
2872
2873Get the Thread network time and the time sync parameters.
2874
2875```bash
2876> networktime
2877Network Time:     21084154us (synchronized)
2878Time Sync Period: 100s
2879XTAL Threshold:   300ppm
2880Done
2881```
2882
2883### networktime \<timesyncperiod\> \<xtalthreshold\>
2884
2885Set time sync parameters
2886
2887- timesyncperiod: The time synchronization period, in seconds.
2888- xtalthreshold: The XTAL accuracy threshold for a device to become Router-Capable device, in PPM.
2889
2890```bash
2891> networktime 100 300
2892Done
2893```
2894
2895### nexthop
2896
2897Output the table of allocated Router IDs and the current next hop (as Router ID) and path cost for each ID.
2898
2899```bash
2900> nexthop
2901| ID   |NxtHop| Cost |
2902+------+------+------+
2903|    9 |    9 |    1 |
2904|   25 |   25 |    0 |
2905|   30 |   30 |    1 |
2906|   46 |    - |    - |
2907|   50 |   30 |    3 |
2908|   60 |   30 |    2 |
2909Done
2910```
2911
2912### nexthop \<rloc16\>
2913
2914Get the next hop (as RLOC16) and path cost towards a given RLOC16 destination.
2915
2916```bash
2917> nexthop 0xc000
29180xc000 cost:0
2919Done
2920
2921nexthop 0x8001
29220x2000 cost:3
2923Done
2924```
2925
2926### panid
2927
2928Get the IEEE 802.15.4 PAN ID value.
2929
2930```bash
2931> panid
29320xdead
2933Done
2934```
2935
2936### panid \<panid\>
2937
2938Set the IEEE 802.15.4 PAN ID value.
2939
2940```bash
2941> panid 0xdead
2942Done
2943```
2944
2945### parent
2946
2947Get the diagnostic information for a Thread Router as parent.
2948
2949Note: When operating as a Thread Router when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled, this command will return the cached information from when the device was previously attached as a Thread Child. Returning cached information is necessary to support the Thread Test Harness - Test Scenario 8.2.x requests the former parent (i.e. Joiner Router's) MAC address even if the device has already promoted to a router.
2950
2951```bash
2952> parent
2953Ext Addr: be1857c6c21dce55
2954Rloc: 5c00
2955Link Quality In: 3
2956Link Quality Out: 3
2957Age: 20
2958Version: 4
2959Done
2960```
2961
2962Note: When `OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE` is enabled, this command will return two extra lines with information relevant for CSL Receiver operation.
2963
2964```bash
2965CSL clock accuracy: 20
2966CSL uncertainty: 5
2967```
2968
2969### parentpriority
2970
2971Get the assigned parent priority value, -2 means not assigned.
2972
2973```bash
2974> parentpriority
29751
2976Done
2977```
2978
2979### parentpriority \<parentpriority\>
2980
2981Set the assigned parent priority value: 1, 0, -1 or -2.
2982
2983```bash
2984> parentpriority 1
2985Done
2986```
2987
2988### partitionid
2989
2990Get the Thread Network Partition ID.
2991
2992```bash
2993> partitionid
29944294967295
2995Done
2996```
2997
2998### partitionid preferred
2999
3000Get the preferred Thread Leader Partition ID.
3001
3002`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required.
3003
3004```bash
3005> partitionid preferred
30064294967295
3007Done
3008```
3009
3010### partitionid preferred \<partitionid\>
3011
3012Set the preferred Thread Leader Partition ID.
3013
3014`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required.
3015
3016```bash
3017> partitionid preferred 0xffffffff
3018Done
3019```
3020
3021### ping \[async\] \[-I source\] \[-m] \<ipaddr\> \[size\] \[count\] \[interval\] \[hoplimit\] \[timeout\]
3022
3023Send an ICMPv6 Echo Request.
3024
3025- async: Use the non-blocking mode. New commands are allowed before the ping process terminates.
3026- source: The source IPv6 address of the echo request.
3027- -m: multicast loop, which allows looping back pings to multicast addresses that the device itself is subscribed to.
3028- size: The number of data bytes to be sent.
3029- count: The number of ICMPv6 Echo Requests to be sent.
3030- interval: The interval between two consecutive ICMPv6 Echo Requests in seconds. The value may have fractional form, for example `0.5`.
3031- hoplimit: The hoplimit of ICMPv6 Echo Request to be sent.
3032- timeout: Time in seconds to wait for the final ICMPv6 Echo Reply after sending out the request. The value may have fractional form, for example `3.5`.
3033
3034```bash
3035> ping fd00:db8:0:0:76b:6a05:3ae9:a61a
3036> 16 bytes from fd00:db8:0:0:76b:6a05:3ae9:a61a: icmp_seq=5 hlim=64 time=0ms
30371 packets transmitted, 1 packets received. Packet loss = 0.0%. Round-trip min/avg/max = 0/0.0/0 ms.
3038Done
3039
3040> ping -I fd00:db8:0:0:76b:6a05:3ae9:a61a ff02::1 100 1 1 1
3041> 108 bytes from fd00:db8:0:0:f605:fb4b:d429:d59a: icmp_seq=4 hlim=64 time=7ms
30421 packets transmitted, 1 packets received. Round-trip min/avg/max = 7/7.0/7 ms.
3043Done
3044```
3045
3046The address can be an IPv4 address, which will be synthesized to an IPv6 address using the preferred NAT64 prefix from the network data.
3047
3048> Note: The command will return `InvalidState` when the preferred NAT64 prefix is unavailable.
3049
3050```bash
3051> ping 172.17.0.1
3052Pinging synthesized IPv6 address: fdde:ad00:beef:2:0:0:ac11:1
3053> 16 bytes from fdde:ad00:beef:2:0:0:ac11:1: icmp_seq=5 hlim=64 time=0ms
30541 packets transmitted, 1 packets received. Packet loss = 0.0%. Round-trip min/avg/max = 0/0.0/0 ms.
3055Done
3056```
3057
3058### ping stop
3059
3060Stop sending ICMPv6 Echo Requests.
3061
3062```bash
3063> ping stop
3064Done
3065```
3066
3067### platform
3068
3069Print the current platform
3070
3071```bash
3072> platform
3073NRF52840
3074Done
3075```
3076
3077### pollperiod
3078
3079Get the customized data poll period of sleepy end device (milliseconds). Only for certification test.
3080
3081```bash
3082> pollperiod
30830
3084Done
3085```
3086
3087### pollperiod \<pollperiod\>
3088
3089Set the customized data poll period for sleepy end device (milliseconds >= 10ms). Only for certification test.
3090
3091```bash
3092> pollperiod 10
3093Done
3094```
3095
3096### pskc
3097
3098Get pskc in hex format.
3099
3100```bash
3101> pskc
310200000000000000000000000000000000
3103Done
3104```
3105
3106### pskc [-p] \<key\>|\<passphrase\>
3107
3108With `-p` generate pskc from \<passphrase\> (UTF-8 encoded) together with **current** network name and extended PAN ID, otherwise set pskc as \<key\> (hex format).
3109
3110```bash
3111> pskc 67c0c203aa0b042bfb5381c47aef4d9e
3112Done
3113> pskc -p 123456
3114Done
3115```
3116
3117### pskcref
3118
3119Get pskc key reference.
3120
3121`OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is required.
3122
3123```bash
3124> pskcref
31250x80000000
3126Done
3127```
3128
3129### pskcref \<keyref\>
3130
3131Set pskc key reference as \<keyref\>.
3132
3133`OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is required.
3134
3135```bash
3136> pskcref 0x20017
3137Done
3138```
3139
3140### preferrouterid \<routerid\>
3141
3142Prefer a Router ID when solicit router id from Leader.
3143
3144```bash
3145> preferrouterid 16
3146Done
3147```
3148
3149### prefix
3150
3151Get the prefix list in the local Network Data. Note: For the Thread 1.2 border router with backbone capability, the local Domain Prefix would be listed as well (with flag `D`), with preceding `-` if backbone functionality is disabled.
3152
3153```bash
3154> prefix
31552001:dead:beef:cafe::/64 paros med
3156- fd00:7d03:7d03:7d03::/64 prosD med
3157Done
3158```
3159
3160### prefix add \<prefix\> [padcrosnD][prf]
3161
3162Add a valid prefix to the Network Data.
3163
3164Note: The Domain Prefix flag (`D`) is only available for Thread 1.2.
3165
3166- p: Preferred flag
3167- a: Stateless IPv6 Address Autoconfiguration flag
3168- d: DHCPv6 IPv6 Address Configuration flag
3169- c: DHCPv6 Other Configuration flag
3170- r: Default Route flag
3171- o: On Mesh flag
3172- s: Stable flag
3173- n: Nd Dns flag
3174- D: Domain Prefix flag
3175- prf: Default router preference, which may be 'high', 'med', or 'low'.
3176
3177```bash
3178> prefix add 2001:dead:beef:cafe::/64 paros med
3179Done
3180
3181> prefix add fd00:7d03:7d03:7d03::/64 prosD med
3182Done
3183```
3184
3185### prefix meshlocal
3186
3187Get the mesh local prefix.
3188
3189```bash
3190> prefix meshlocal
3191fdde:ad00:beef:0::/64
3192Done
3193```
3194
3195### prefix meshlocal <prefix>
3196
3197Set the mesh local prefix.
3198
3199```bash
3200> prefix meshlocal fdde:ad00:beef:0::/64
3201Done
3202```
3203
3204### prefix remove \<prefix\>
3205
3206Invalidate a prefix in the Network Data.
3207
3208```bash
3209> prefix remove 2001:dead:beef:cafe::/64
3210Done
3211```
3212
3213### promiscuous
3214
3215Get radio promiscuous property.
3216
3217```bash
3218> promiscuous
3219Disabled
3220Done
3221```
3222
3223### promiscuous enable
3224
3225Enable radio promiscuous operation and print raw packet content.
3226
3227```bash
3228> promiscuous enable
3229Done
3230```
3231
3232### promiscuous disable
3233
3234Disable radio promiscuous operation.
3235
3236```bash
3237> promiscuous disable
3238Done
3239```
3240
3241### radio enable
3242
3243Enable radio.
3244
3245```bash
3246> radio enable
3247Done
3248```
3249
3250### radio disable
3251
3252Disable radio.
3253
3254```bash
3255> radio disable
3256Done
3257```
3258
3259### radio stats
3260
3261`OPENTHREAD_CONFIG_RADIO_STATS_ENABLE` is required. This feature is only available on FTD and MTD.
3262
3263The radio statistics shows the time when the radio is in sleep/tx/rx state. The command will show the time of these states since last reset in unit of microseconds. It will also show the percentage of the time.
3264
3265```bash
3266> radio stats
3267Radio Statistics:
3268Total Time: 67.756s
3269Tx Time: 0.022944s (0.03%)
3270Rx Time: 1.482353s (2.18%)
3271Sleep Time: 66.251128s (97.77%)
3272Disabled Time: 0.000080s (0.00%)
3273Done
3274```
3275
3276### radio stats clear
3277
3278`OPENTHREAD_CONFIG_RADIO_STATS_ENABLE` is required. This feature is only available on FTD and MTD.
3279
3280This command resets the radio statistics. It sets all the time to 0.
3281
3282```bash
3283> radio stats clear
3284Done
3285```
3286
3287### radiofilter
3288
3289`OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` is required.
3290
3291The radio filter is mainly intended for testing. It can be used to temporarily block all tx/rx on the IEEE 802.15.4 radio.
3292
3293When radio filter is enabled, radio is put to sleep instead of receive (to ensure device does not receive any frame and/or potentially send ack). Also the frame transmission requests return immediately without sending the frame over the air (return "no ack" error if ack is requested, otherwise return success).
3294
3295Get radio filter status (enabled or disabled).
3296
3297```bash
3298> radiofilter
3299Disabled
3300Done
3301```
3302
3303### radiofilter enable
3304
3305`OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` is required.
3306
3307Enable radio radio filter.
3308
3309```bash
3310> radiofilter enable
3311Done
3312```
3313
3314### radiofilter disable
3315
3316`OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` is required.
3317
3318Disable radio radio filter.
3319
3320```bash
3321> radiofilter disable
3322Done
3323```
3324
3325### rcp
3326
3327RCP-related commands.
3328
3329### region
3330
3331Set the radio region, this can affect the transmit power limit.
3332
3333```bash
3334> region US
3335Done
3336> region
3337US
3338Done
3339```
3340
3341### rcp version
3342
3343Print RCP version string.
3344
3345```bash
3346> rcp version
3347OPENTHREAD/20191113-00825-g82053cc9d-dirty; SIMULATION; Jun  4 2020 17:53:16
3348Done
3349```
3350
3351### releaserouterid \<routerid\>
3352
3353Release a Router ID that has been allocated by the device in the Leader role.
3354
3355```bash
3356> releaserouterid 16
3357Done
3358```
3359
3360### reset
3361
3362Signal a platform reset.
3363
3364```bash
3365> reset
3366```
3367
3368### reset bootloader
3369
3370Signal a platform reset to bootloader mode, if supported.
3371
3372Requires `OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE`.
3373
3374```bash
3375> reset bootloader
3376Done
3377```
3378
3379### rloc16
3380
3381Get the Thread RLOC16 value.
3382
3383```bash
3384> rloc16
33850xdead
3386Done
3387```
3388
3389### route
3390
3391Get the external route list in the local Network Data.
3392
3393```bash
3394> route
33952001:dead:beef:cafe::/64 s med
3396Done
3397```
3398
3399### route add \<prefix\> [sna][prf]
3400
3401Add a valid external route to the Network Data.
3402
3403- s: Stable flag
3404- n: NAT64 flag
3405- a: Advertising PIO (AP) flag
3406- prf: Default Router Preference, which may be: 'high', 'med', or 'low'.
3407
3408```bash
3409> route add 2001:dead:beef:cafe::/64 s med
3410Done
3411```
3412
3413### route remove \<prefix\>
3414
3415Invalidate a external route in the Network Data.
3416
3417```bash
3418> route remove 2001:dead:beef:cafe::/64
3419Done
3420```
3421
3422### router list
3423
3424List allocated Router IDs.
3425
3426```bash
3427> router list
34288 24 50
3429Done
3430```
3431
3432### router table
3433
3434Print table of routers.
3435
3436```bash
3437> router table
3438| ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC     | Link |
3439+----+--------+----------+-----------+-------+--------+-----+------------------+------+
3440| 22 | 0x5800 |       63 |         0 |     0 |      0 |   0 | 0aeb8196c9f61658 |    0 |
3441| 49 | 0xc400 |       63 |         0 |     3 |      3 |   0 | faa1c03908e2dbf2 |    1 |
3442Done
3443```
3444
3445### router \<id\>
3446
3447Print diagnostic information for a Thread Router. The `id` may be a Router ID or an RLOC16.
3448
3449```bash
3450> router 50
3451Alloc: 1
3452Router ID: 50
3453Rloc: c800
3454Next Hop: c800
3455Link: 1
3456Ext Addr: e2b3540590b0fd87
3457Cost: 0
3458Link Quality In: 3
3459Link Quality Out: 3
3460Age: 3
3461Done
3462```
3463
3464```bash
3465> router 0xc800
3466Alloc: 1
3467Router ID: 50
3468Rloc: c800
3469Next Hop: c800
3470Link: 1
3471Ext Addr: e2b3540590b0fd87
3472Cost: 0
3473Link Quality In: 3
3474Link Quality Out: 3
3475Age: 7
3476Done
3477```
3478
3479### routerdowngradethreshold
3480
3481Get the ROUTER_DOWNGRADE_THRESHOLD value.
3482
3483```bash
3484> routerdowngradethreshold
348523
3486Done
3487```
3488
3489### routerdowngradethreshold \<threshold\>
3490
3491Set the ROUTER_DOWNGRADE_THRESHOLD value.
3492
3493```bash
3494> routerdowngradethreshold 23
3495Done
3496```
3497
3498### routereligible
3499
3500Indicates whether the router role is enabled or disabled.
3501
3502```bash
3503> routereligible
3504Enabled
3505Done
3506```
3507
3508### routereligible enable
3509
3510Enable the router role.
3511
3512```bash
3513> routereligible enable
3514Done
3515```
3516
3517### routereligible disable
3518
3519Disable the router role.
3520
3521```bash
3522> routereligible disable
3523Done
3524```
3525
3526### routerselectionjitter
3527
3528Get the ROUTER_SELECTION_JITTER value.
3529
3530```bash
3531> routerselectionjitter
3532120
3533Done
3534```
3535
3536### routerselectionjitter \<jitter\>
3537
3538Set the ROUTER_SELECTION_JITTER value.
3539
3540```bash
3541> routerselectionjitter 120
3542Done
3543```
3544
3545### routerupgradethreshold
3546
3547Get the ROUTER_UPGRADE_THRESHOLD value.
3548
3549```bash
3550> routerupgradethreshold
355116
3552Done
3553```
3554
3555### routerupgradethreshold \<threshold\>
3556
3557Set the ROUTER_UPGRADE_THRESHOLD value.
3558
3559```bash
3560> routerupgradethreshold 16
3561Done
3562```
3563
3564### childrouterlinks
3565
3566Get the MLE_CHILD_ROUTER_LINKS value.
3567
3568```bash
3569> childrouterlinks
357016
3571Done
3572```
3573
3574### childrouterlinks \<number_of_links\>
3575
3576Set the MLE_CHILD_ROUTER_LINKS value.
3577
3578```bash
3579> childrouterlinks 16
3580Done
3581```
3582
3583### scan \[channel\]
3584
3585Perform an IEEE 802.15.4 Active Scan.
3586
3587- channel: The channel to scan on. If no channel is provided, the active scan will cover all valid channels.
3588
3589```bash
3590> scan
3591| PAN  | MAC Address      | Ch | dBm | LQI |
3592+------+------------------+----+-----+-----+
3593| ffff | f1d92a82c8d8fe43 | 11 | -20 |   0 |
3594Done
3595```
3596
3597### scan energy \[duration\] \[channel\]
3598
3599Perform an IEEE 802.15.4 Energy Scan.
3600
3601- duration: The time in milliseconds to spend scanning each channel.
3602
3603```bash
3604> scan energy 10
3605| Ch | RSSI |
3606+----+------+
3607| 11 |  -59 |
3608| 12 |  -62 |
3609| 13 |  -67 |
3610| 14 |  -61 |
3611| 15 |  -87 |
3612| 16 |  -86 |
3613| 17 |  -86 |
3614| 18 |  -52 |
3615| 19 |  -58 |
3616| 20 |  -82 |
3617| 21 |  -76 |
3618| 22 |  -82 |
3619| 23 |  -74 |
3620| 24 |  -81 |
3621| 25 |  -88 |
3622| 26 |  -71 |
3623Done
3624```
3625
3626```bash
3627> scan energy 10 20
3628| Ch | RSSI |
3629+----+------+
3630| 20 |  -82 |
3631Done
3632```
3633
3634### service
3635
3636Module for controlling service registration in Network Data. Each change in service registration must be sent to leader by `netdata register` command before taking effect.
3637
3638### service add \<enterpriseNumber\> \<serviceData\> [\<serverData\>]
3639
3640Add service to the Network Data.
3641
3642- enterpriseNumber: IANA enterprise number
3643- serviceData: hex-encoded binary service data
3644- serverData: hex-encoded binary server data (empty if not provided)
3645
3646```bash
3647> service add 44970 112233 aabbcc
3648Done
3649> netdata register
3650Done
3651```
3652
3653### service remove \<enterpriseNumber\> \<serviceData\>
3654
3655Remove service from Network Data.
3656
3657- enterpriseNumber: IANA enterprise number
3658- serviceData: hext-encoded binary service data
3659
3660```bash
3661> service remove 44970 112233
3662Done
3663> netdata register
3664Done
3665```
3666
3667### singleton
3668
3669Return true when there are no other nodes in the network, otherwise return false.
3670
3671```bash
3672> singleton
3673true or false
3674Done
3675```
3676
3677### sntp query \[SNTP server IP\] \[SNTP server port\]
3678
3679Send SNTP Query to obtain current unix epoch time (from 1st January 1970). The latter two parameters have following default values:
3680
3681- NTP server IP: 2001:4860:4806:8:: (Google IPv6 NTP Server)
3682- NTP server port: 123
3683
3684```bash
3685> sntp query
3686> SNTP response - Unix time: 1540894725 (era: 0)
3687```
3688
3689You can use NAT64 of OpenThread Border Router to reach e.g. Google IPv4 NTP Server:
3690
3691```bash
3692> sntp query 64:ff9b::d8ef:2308
3693> SNTP response - Unix time: 1540898611 (era: 0)
3694```
3695
3696### state
3697
3698Return state of current state.
3699
3700```bash
3701> state
3702offline, disabled, detached, child, router or leader
3703Done
3704```
3705
3706### state leader
3707
3708Become a leader and start a new partition
3709
3710If the device is not attached, this command will force the device to start as the leader of the network. This use case is only intended for testing and demo purposes, and using the API while the device is detached can make a production application non-compliant with the Thread Specification.
3711
3712If the device is already attached, this API can be used to try to take over as the leader, creating a new partition. For this to work, the local leader weight (`leaderweight`) must be larger than the weight of the current leader (from `leaderdata`). If it is not, error `NotCapable` is outputted to indicate to the caller that they need to adjust the weight.
3713
3714Taking over the leader role in this way is only allowed when triggered by an explicit user action. Using this API without such user action can make a production application non-compliant with the Thread Specification.
3715
3716```bash
3717> leaderdata
3718Partition ID: 1886755069
3719Weighting: 65
3720Data Version: 178
3721Stable Data Version: 48
3722Leader Router ID: 59
3723Done
3724
3725> leaderweight
372664
3727Done
3728
3729> state leader
3730Error 27: NotCapable
3731
3732> leaderweight 66
3733Done
3734
3735> state leader
3736Done
3737```
3738
3739### state <state>
3740
3741Try to switch to state `detached`, `child`, `router`.
3742
3743```bash
3744> state detached
3745Done
3746```
3747
3748### test tmforiginfilter \[enable|disable\]
3749
3750Enable/disable filter that drops UDP messages sent to the TMF port from untrusted origin. Also get the current state of the filter if no argument is specified.
3751
3752Note: This filter is enabled by default.
3753
3754This command is intended for testing only. `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required for all `test` sub-commands.
3755
3756Get the current state of the filter.
3757
3758```
3759> test tmforiginfilter
3760Enabled
3761```
3762
3763Enable or disable the filter.
3764
3765```
3766> test tmforiginfilter enable
3767Done
3768>
3769> test tmforiginfilter
3770Enabled
3771>
3772> test tmforiginfilter disable
3773Done
3774>
3775> test tmforiginfilter
3776Disabled
3777>
3778```
3779
3780### thread start
3781
3782Enable Thread protocol operation and attach to a Thread network.
3783
3784```bash
3785> thread start
3786Done
3787```
3788
3789### thread stop
3790
3791Disable Thread protocol operation and detach from a Thread network.
3792
3793```bash
3794> thread stop
3795Done
3796```
3797
3798### thread version
3799
3800Get the Thread Version number.
3801
3802```bash
3803> thread version
38042
3805Done
3806```
3807
3808### timeinqueue
3809
3810Print the tx queue time-in-queue histogram.
3811
3812Requires `OPENTHREAD_CONFIG_TX_QUEUE_STATISTICS_ENABLE`.
3813
3814The time-in-queue is tracked for direct transmissions only and is measured as the duration from when a message is added to the transmit queue until it is passed to the MAC layer for transmission or dropped.
3815
3816Each table row shows min and max time-in-queue (in milliseconds) followed by number of messages with time-in-queue within the specified min-max range. The histogram information is collected since the OpenThread instance was initialized or since the last time statistics collection was reset by the `timeinqueue reset` command.
3817
3818The collected statistics can be reset by `timeinqueue reset`.
3819
3820```bash
3821> timeinqueue
3822| Min  | Max  |Msg Count|
3823+------+------+---------+
3824|    0 |    9 |    1537 |
3825|   10 |   19 |     156 |
3826|   20 |   29 |      57 |
3827|   30 |   39 |     108 |
3828|   40 |   49 |      60 |
3829|   50 |   59 |      76 |
3830|   60 |   69 |      88 |
3831|   70 |   79 |      51 |
3832|   80 |   89 |      86 |
3833|   90 |   99 |      45 |
3834|  100 |  109 |      43 |
3835|  110 |  119 |      44 |
3836|  120 |  129 |      38 |
3837|  130 |  139 |      44 |
3838|  140 |  149 |      35 |
3839|  150 |  159 |      41 |
3840|  160 |  169 |      34 |
3841|  170 |  179 |      13 |
3842|  180 |  189 |      24 |
3843|  190 |  199 |       3 |
3844|  200 |  209 |       0 |
3845|  210 |  219 |       0 |
3846|  220 |  229 |       2 |
3847|  230 |  239 |       0 |
3848|  240 |  249 |       0 |
3849|  250 |  259 |       0 |
3850|  260 |  269 |       0 |
3851|  270 |  279 |       0 |
3852|  280 |  289 |       0 |
3853|  290 |  299 |       1 |
3854|  300 |  309 |       0 |
3855|  310 |  319 |       0 |
3856|  320 |  329 |       0 |
3857|  330 |  339 |       0 |
3858|  340 |  349 |       0 |
3859|  350 |  359 |       0 |
3860|  360 |  369 |       0 |
3861|  370 |  379 |       0 |
3862|  380 |  389 |       0 |
3863|  390 |  399 |       0 |
3864|  400 |  409 |       0 |
3865|  410 |  419 |       0 |
3866|  420 |  429 |       0 |
3867|  430 |  439 |       0 |
3868|  440 |  449 |       0 |
3869|  450 |  459 |       0 |
3870|  460 |  469 |       0 |
3871|  470 |  479 |       0 |
3872|  480 |  489 |       0 |
3873|  490 |  inf |       0 |
3874Done
3875```
3876
3877### timeinqueue max
3878
3879Print the maximum observed time-in-queue in milliseconds.
3880
3881Requires `OPENTHREAD_CONFIG_TX_QUEUE_STATISTICS_ENABLE`.
3882
3883The time-in-queue is tracked for direct transmissions only and is measured as the duration from when a message is added to the transmit queue until it is passed to the MAC layer for transmission or dropped.
3884
3885```bash
3886> timeinqueue max
3887291
3888```
3889
3890### timeinqueue reset
3891
3892Reset the TX queue time-in-queue statistics.
3893
3894```bash
3895> timeinqueue reset
3896Done
3897```
3898
3899### trel
3900
3901Indicate whether TREL radio operation is enabled or not.
3902
3903`OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE` is required for all `trel` sub-commands.
3904
3905```bash
3906> trel
3907Enabled
3908Done
3909```
3910
3911### trel enable
3912
3913Enable TREL operation.
3914
3915```bash
3916> trel enable
3917Done
3918```
3919
3920### trel disable
3921
3922Disable TREL operation.
3923
3924```bash
3925> trel disable
3926Done
3927```
3928
3929### trel filter
3930
3931Indicate whether TREL filter mode is enabled or not
3932
3933When filter mode is enabled, any rx and tx traffic through TREL interface is silently dropped. This is mainly intended for use during testing.
3934
3935```bash
3936> trel filter
3937Disabled
3938Done
3939```
3940
3941### trel filter enable
3942
3943Enable TREL filter mode.
3944
3945```bash
3946> trel filter enable
3947Done
3948```
3949
3950### trel filter disable
3951
3952Disable TREL filter mode.
3953
3954```bash
3955> trel filter disable
3956Done
3957```
3958
3959### trel peers [list]
3960
3961Get the TREL peer table in table format or as a list.
3962
3963```bash
3964> trel peers
3965| No  | Ext MAC Address  | Ext PAN Id       | IPv6 Socket Address                              |
3966+-----+------------------+------------------+--------------------------------------------------+
3967|   1 | 5e5785ba3a63adb9 | f0d9c001f00d2e43 | [fe80:0:0:0:cc79:2a29:d311:1aea]:9202            |
3968|   2 | ce792a29d3111aea | dead00beef00cafe | [fe80:0:0:0:5c57:85ba:3a63:adb9]:9203            |
3969Done
3970
3971> trel peers list
3972001 ExtAddr:5e5785ba3a63adb9 ExtPanId:f0d9c001f00d2e43 SockAddr:[fe80:0:0:0:cc79:2a29:d311:1aea]:9202
3973002 ExtAddr:ce792a29d3111aea ExtPanId:dead00beef00cafe SockAddr:[fe80:0:0:0:5c57:85ba:3a63:adb9]:9203
3974Done
3975```
3976
3977### trel counters
3978
3979Get the TREL counters.
3980
3981```bash
3982> trel counters
3983Inbound:  Packets 32 Bytes 4000
3984Outbound: Packets 4 Bytes 320 Failures 1
3985Done
3986```
3987
3988### trel counters reset
3989
3990Reset the TREL counters.
3991
3992```bash
3993> trel counters reset
3994Done
3995```
3996
3997### trel port
3998
3999Get the TREL UDP port number.
4000
4001```bash
4002> trel port
400349154
4004Done
4005```
4006
4007### tvcheck enable
4008
4009Enable thread version check when upgrading to router or leader.
4010
4011Note: Thread version check is enabled by default.
4012
4013`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required.
4014
4015```bash
4016> tvcheck enable
4017Done
4018```
4019
4020### tvcheck disable
4021
4022Disable thread version check when upgrading to router or leader.
4023
4024Note: Thread version check is enabled by default.
4025
4026`OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is required.
4027
4028```bash
4029> tvcheck disable
4030Done
4031```
4032
4033### txpower
4034
4035Get the transmit power in dBm.
4036
4037```bash
4038> txpower
4039-10 dBm
4040Done
4041```
4042
4043### txpower \<txpower\>
4044
4045Set the transmit power in dBm.
4046
4047```bash
4048> txpower -10
4049Done
4050```
4051
4052### unsecureport add \<port\>
4053
4054Add a port to the allowed unsecured port list.
4055
4056```bash
4057> unsecureport add 1234
4058Done
4059```
4060
4061### unsecureport remove \<port\>
4062
4063Remove a port from the allowed unsecured port list.
4064
4065```bash
4066> unsecureport remove 1234
4067Done
4068```
4069
4070### unsecureport remove all
4071
4072Remove all ports from the allowed unsecured port list.
4073
4074```bash
4075> unsecureport remove all
4076Done
4077```
4078
4079### unsecureport get
4080
4081Print all ports from the allowed unsecured port list.
4082
4083```bash
4084> unsecureport get
40851234
4086Done
4087```
4088
4089### uptime
4090
4091This command requires `OPENTHREAD_CONFIG_UPTIME_ENABLE` to be enabled.
4092
4093Print the OpenThread stack uptime (duration since OpenThread stack initialization).
4094
4095```bash
4096> uptime
409712:46:35.469
4098Done
4099>
4100```
4101
4102### uptime ms
4103
4104This command requires `OPENTHREAD_CONFIG_UPTIME_ENABLE` to be enabled.
4105
4106Print the OpenThread stack uptime in msec.
4107
4108```bash
4109> uptime ms
4110426238
4111Done
4112>
4113```
4114
4115### vendor name
4116
4117Get the vendor name.
4118
4119```bash
4120> vendor name
4121nest
4122Done
4123```
4124
4125Set the vendor name (requires `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE`).
4126
4127```bash
4128> vendor name nest
4129Done
4130```
4131
4132### vendor model
4133
4134Get the vendor model.
4135
4136```bash
4137> vendor model
4138Hub Max
4139Done
4140```
4141
4142Set the vendor model (requires `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE`).
4143
4144```bash
4145> vendor model Hub\ Max
4146Done
4147```
4148
4149### vendor swversion
4150
4151Get the vendor SW version.
4152
4153```bash
4154> vendor swversion
4155Marble3.5.1
4156Done
4157```
4158
4159Set the vendor SW version (requires `OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE`).
4160
4161```bash
4162> vendor swversion Marble3.5.1
4163Done
4164```
4165
4166### verhoeff calculate
4167
4168Calculates the Verhoeff checksum for a given decimal string.
4169
4170Requires `OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE`.
4171
4172The input string MUST consist of characters in `['0'-'9']`.
4173
4174```bash
4175> verhoeff calculate 30731842
41761
4177Done
4178```
4179
4180### verhoeff validate
4181
4182Validates the Verhoeff checksum for a given decimal string.
4183
4184Requires `OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE`.
4185
4186The input string MUST consist of characters in `['0'-'9']`. The last digit is treated as checksum.
4187
4188```bash
4189> verhoeff validate 307318421
4190Done
4191> verhoeff validate 307318425
4192Error 1: Failed
4193```
4194
4195### version
4196
4197Print the build version information.
4198
4199```bash
4200> version
4201OPENTHREAD/gf4f2f04; Jul  1 2016 17:00:09
4202Done
4203```
4204
4205### version api
4206
4207Print API version number.
4208
4209```bash
4210> version api
421128
4212Done
4213```
4214
4215### mac altshortaddr
4216
4217Get the alternate short address used by MAC layer. Can be `0xfffe` if not set.
4218
4219```bash
4220> mac altshortaddr
42210x4801
4222Done
4223```
4224
4225### mac retries direct
4226
4227Get the number of direct TX retries on the MAC layer.
4228
4229```bash
4230> mac retries direct
42313
4232Done
4233```
4234
4235### mac retries direct \<number\>
4236
4237Set the number of direct TX retries on the MAC layer.
4238
4239```bash
4240> mac retries direct 5
4241Done
4242```
4243
4244### mac retries indirect
4245
4246Get the number of indirect TX retries on the MAC layer.
4247
4248```bash
4249> mac retries indirect
42503
4251Done
4252```
4253
4254### mac retries indirect \<number\>
4255
4256Set the number of indirect TX retries on the MAC layer.
4257
4258```bash
4259> mac retries indirect 5
4260Done
4261```
4262
4263### mac send \<op\>
4264
4265Instruct an Rx-Off-When-Idle device to send a mac frame to its parent. The mac frame could be either a mac data request or an empty mac data frame. Use `datarequest` to send a mac data request and `data` to send an empty mac data. This feature is for certification, it can only be used when `OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE` is enabled.
4266
4267```bash
4268> mac send datarequest
4269Done
4270```
4271
4272```bash
4273> mac send emptydata
4274Done
4275```
4276
4277### macfilter
4278
4279List the macfilter status, including address and received signal strength filter settings.
4280
4281```bash
4282> macfilter
4283Address Mode: Allowlist
42840f6127e33af6b403 : rss -95 (lqi 1)
42850f6127e33af6b402
4286RssIn List:
42870f6127e33af6b403 : rss -95 (lqi 1)
4288Default rss: -50 (lqi 3)
4289Done
4290```
4291
4292### macfilter addr
4293
4294List the address filter status.
4295
4296```bash
4297> macfilter addr
4298Allowlist
42990f6127e33af6b403 : rss -95 (lqi 1)
43000f6127e33af6b402
4301Done
4302```
4303
4304### macfilter addr disable
4305
4306Disable address filter mode.
4307
4308```bash
4309> macfilter addr disable
4310Done
4311```
4312
4313### macfilter addr allowlist
4314
4315Enable allowlist address filter mode.
4316
4317```bash
4318> macfilter addr allowlist
4319Done
4320```
4321
4322### macfilter addr denylist
4323
4324Enable denylist address filter mode.
4325
4326```bash
4327> macfilter addr denylist
4328Done
4329```
4330
4331### macfilter addr add \<extaddr\> \[rss\]
4332
4333Add an IEEE 802.15.4 Extended Address to the address filter, and fixed the received signal strength for the messages from the address if rss is specified.
4334
4335```bash
4336> macfilter addr add 0f6127e33af6b403 -95
4337Done
4338```
4339
4340```bash
4341> macfilter addr add 0f6127e33af6b402
4342Done
4343```
4344
4345### macfilter addr remove \<extaddr\>
4346
4347Remove the IEEE802.15.4 Extended Address from the address filter.
4348
4349```bash
4350> macfilter addr remove 0f6127e33af6b402
4351Done
4352```
4353
4354### macfilter addr clear
4355
4356Clear all the IEEE802.15.4 Extended Addresses from the address filter.
4357
4358```bash
4359> macfilter addr clear
4360Done
4361```
4362
4363### macfilter rss
4364
4365List the rss filter status
4366
4367```bash
4368> macfilter rss
43690f6127e33af6b403 : rss -95 (lqi 1)
4370Default rss: -50 (lqi 3)
4371Done
4372```
4373
4374### macfilter rss add \<extaddr\> \<rss\>
4375
4376Set the received signal strength for the messages from the IEEE802.15.4 Extended Address. If extaddr is \*, default received signal strength for all received messages would be set.
4377
4378```bash
4379> macfilter rss add * -50
4380Done
4381```
4382
4383```bash
4384> macfilter rss add 0f6127e33af6b404 -85
4385Done
4386```
4387
4388### macfilter rss add-lqi \<extaddr\> \<lqi\>
4389
4390Set the received link quality for the messages from the IEEE802.15.4 Extended Address. Valid lqi range [0,3] If extaddr is \*, default received link quality for all received messages would be set. Equivalent with 'filter rss add' with similar usage
4391
4392```bash
4393> macfilter rss add-lqi * 3
4394Done
4395```
4396
4397```bash
4398> macfilter rss add-lqi 0f6127e33af6b404 2
4399Done
4400```
4401
4402### macfilter rss remove \<extaddr\>
4403
4404Removes the received signal strength or received link quality setting on the Extended Address. If extaddr is \*, default received signal strength or link quality for all received messages would be unset.
4405
4406```bash
4407> macfilter rss remove *
4408Done
4409```
4410
4411```bash
4412> macfilter rss remove 0f6127e33af6b404
4413Done
4414```
4415
4416### macfilter rss clear
4417
4418Clear all the received signal strength or received link quality settings.
4419
4420```bash
4421> macfilter rss clear
4422Done
4423```
4424
4425### diag
4426
4427Factory Diagnostics module is enabled only when building OpenThread with `OPENTHREAD_CONFIG_DIAG_ENABLE=1` option. Go [diagnostics module][diag] for more information.
4428
4429[diag]: ../../src/core/diags/README.md
4430
4431### wakeup channel
4432
4433Get the wake-up channel.
4434
4435Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
4436
4437```bash
4438> wakeup channel
443912
4440Done
4441```
4442
4443### wakeup channel \<channel\>
4444
4445Set the wake-up channel.
4446
4447Requires `OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` or `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
4448
4449```bash
4450> wakeup channel 12
4451Done
4452```
4453
4454### wakeup parameters
4455
4456Get the wake-up listen interval and duration.
4457
4458Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
4459
4460```bash
4461> wakeup parameters
4462interval: 1000000us
4463duration: 8000us
4464Done
4465```
4466
4467### wakeup parameters \<interval\> \<duration\>
4468
4469Set the wake-up listen interval and duration.
4470
4471Requires `OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE`.
4472
4473```bash
4474> wakeup parameters 1000000 8000
4475Done
4476```
4477
4478### wakeup listen
4479
4480Show the state of wake-up listening feature.
4481
4482`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
4483
4484```bash
4485> wakeup listen
4486Enabled
4487Done
4488```
4489
4490### wakeup listen \[enable|disable\]
4491
4492Enable/disable listening for wake-up frames.
4493
4494`OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE` is required.
4495
4496```bash
4497> wakeup listen enable
4498Done
4499```
4500
4501### wakeup wake \<extaddr\> \<wakeup-interval\> \<wakeup-duration\>
4502
4503Wakes a Wake-up End Device.
4504
4505`OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE` is required.
4506
4507```bash
4508> wakeup wake 1ece0a6c4653a7c1 7500 1090
4509Done
4510```
4511