The 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.
The whitespace character (' '
) is used to delimit the command name and the different arguments, together with tab ('\t'
) and new line characters ('\r'
, '\n'
).
Some arguments might require to accept whitespaces on them. For those cases the backslash character ('\'
) can be used to escape separators or the backslash itself.
Example:
> networkname Test\ Network Done > networkname Test Network Done >
Show current Primary Backbone Router information for Thread 1.2 device.
> bbr BBR Primary: server16: 0xE400 seqno: 10 delay: 120 secs timeout: 300 secs Done
> bbr BBR Primary: None Done
Configure 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.
Only for testing/reference device.
known status value:
> bbr mgmt dua 1 2f7c235e5025a2fd Done > bbr mgmt dua 160 Done
Show the Multicast Listeners.
Only for testing/reference Backbone Router device.
> bbr mgmt mlr listener ff04:0:0:0:0:0:0:abcd 3534000 ff04:0:0:0:0:0:0:eeee 3537610 Done
Add a Multicast Listener with a given IPv6 multicast address and timeout (in seconds).
Only for testing/reference Backbone Router device.
> bbr mgmt mlr listener add ff04::1 Done > bbr mgmt mlr listener add ff04::2 300 Done > bbr mgmt mlr listener ff04:0:0:0:0:0:0:2 261 ff04:0:0:0:0:0:0:1 3522 Done
Removes all the Multicast Listeners.
Only for testing/reference Backbone Router device.
> bbr mgmt mlr listener clear Done > bbr mgmt mlr listener Done
Configure the response status for the next MLR.req.
Only for testing/reference device.
Known status values:
> bbr mgmt mlr response 2 Done
Show local Backbone state ([Disabled
,Primary
, Secondary
]) for Thread 1.2 FTD.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr state Disabled Done > bbr state Primary Done > bbr state Secondary Done
Enable Backbone Router Service for Thread 1.2 FTD. SRV_DATA.ntf
would be triggerred for attached device if there is no Backbone Router Service in Thread Network Data.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr enable Done
Disable Backbone Router Service for Thread 1.2 FTD. SRV_DATA.ntf
would be triggerred if Backbone Router is Primary state. o OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr disable Done
Register Backbone Router Service for Thread 1.2 FTD. SRV_DATA.ntf
would be triggerred for attached device.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr register Done
Show local Backbone Router configuration for Thread 1.2 FTD.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr config seqno: 10 delay: 120 secs timeout: 300 secs Done
Configure 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.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr config seqno 20 delay 30 Done
Show jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr jitter 20 Done
Set jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
is required.
> bbr jitter 10 Done
Show current Border Agent information.
Print border agent service port.
> ba port 49152 Done
Print border agent state.
> ba state Started Done
Enbale/disable the Border Routing functionality.
> br enable Done
> br disable Done
Get the randomly generated off-mesh-routable prefix of the Border Router.
> br omrprefix fdfc:1ff5:1512:5622::/64 Done
Get the randomly generated on-link prefix of the Border Router.
> br onlinkprefix fd41:2650:a6f5:0::/64 Done
Get the local NAT64 prefix of the Border Router.
OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
is required.
> br nat64prefix fd14:1078:b3d5:b0b0:0:0::/96 Done
Show the current message buffer information.
total
shows total number of message buffers in pool.free
shows the number of free message buffers.> bufferinfo total: 40 free: 40 6lo send: 0 0 0 6lo reas: 0 0 0 ip6: 0 0 0 mpl: 0 0 0 mle: 0 0 0 coap: 0 0 0 coap secure: 0 0 0 application coap: 0 0 0 Done
Get the CCA threshold in dBm measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.
> ccathreshold -75 dBm Done
Set the CCA threshold measured at antenna connector per IEEE 802.15.4 - 2015 section 10.1.4.
> ccathreshold -62 Done
Get the IEEE 802.15.4 Channel value.
> channel 11 Done
Set the IEEE 802.15.4 Channel value.
> channel 11 Done
Get channel manager state.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
is required.
channel: 11 auto: 1 delay: 120 interval: 10800 supported: { 11-26} favored: { 11-26} Done
Initiate a channel change with the channel manager.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
is required.
> channel manager change 11 channel manager change 11 Done
Request a channel selection with the channel manager.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager select 1 channel manager select 1 Done
Enable/disable the auto-channel-selection functionality.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager auto 1 channel manager auto 1 Done
Set the channel change delay (in seconds).
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager delay 120 channel manager delay 120 Done
Set the auto-channel-selection interval (in seconds).
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager interval 10800 channel manager interval 10800 Done
Set the supported channel mask for the auto-channel-selection.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager supported 0x7fffc00 channel manager supported 0x7fffc00 Done
Set the favored channel mask for the auto-channel-selection.
OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
are required.
> channel manager favored 0x7fffc00 channel manager favored 0x7fffc00 Done
Get current channel monitor state and channel occupancy.
OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
is required.
> channel monitor channel monitor enabled: 1 interval: 41000 threshold: -75 window: 960 count: 10552 occupancies: ch 11 (0x0cb7) 4.96% busy ch 12 (0x2e2b) 18.03% busy ch 13 (0x2f54) 18.48% busy ch 14 (0x0fef) 6.22% busy ch 15 (0x1536) 8.28% busy ch 16 (0x1746) 9.09% busy ch 17 (0x0b8b) 4.50% busy ch 18 (0x60a7) 37.75% busy ch 19 (0x0810) 3.14% busy ch 20 (0x0c2a) 4.75% busy ch 21 (0x08dc) 3.46% busy ch 22 (0x101d) 6.29% busy ch 23 (0x0092) 0.22% busy ch 24 (0x0028) 0.06% busy ch 25 (0x0063) 0.15% busy ch 26 (0x058c) 2.16% busy Done
Start the channel monitor.
OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
is required.
> channel monitor start channel monitor start Done
Stop the channel monitor.
OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
is required.
> channel monitor stop channel monitor stop Done
Get preferred channel mask.
> channel preferred 0x7fff800 Done
Get supported channel mask.
> channel supported 0x7fff800 Done
List attached Child IDs.
> child list 1 2 3 6 7 8 Done
Print table of attached children.
> child table | ID | RLOC16 | Timeout | Age | LQ In | C_VN |R|D|N|Ver|CSL|QMsgCnt| Extended MAC | +-----+--------+------------+------------+-------+------+-+-+-+---+---+-------+------------------+ | 1 | 0xc801 | 240 | 24 | 3 | 131 |1|0|0| 3| 0 | 0 | 4ecede68435358ac | | 2 | 0xc802 | 240 | 2 | 3 | 131 |0|0|0| 3| 1 | 0 | a672a601d2ce37d8 | Done
Print diagnostic information for an attached Thread Child. The id
may be a Child ID or an RLOC16.
> child 1 Child ID: 1 Rloc: 9c01 Ext Addr: e2b3540590b0fd87 Mode: rn Net Data: 184 Timeout: 100 Age: 0 Link Quality In: 3 RSSI: -20 Done
Get the list of IP addresses stored for MTD children.
> childip 3401: fdde:ad00:beef:0:3037:3e03:8c5f:bc0c Done
Get the maximum number of IP addresses that each MTD child may register with this device as parent.
> childip max 4 Done
Set 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.
OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is required.
> childip max 2 Done
Get the Thread maximum number of allowed children.
> childmax 5 Done
Set the Thread maximum number of allowed children.
> childmax 2 Done
Get the Child Supervision Interval value.
Child 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 supervision message (a data message with empty payload) to the child. This command can only be used with FTD devices.
> childsupervision interval 30 Done
Set the Child Supervision Interval value. This command can only be used with FTD devices.
> childsupervision interval 30 Done
Get the Child Supervision Check Timeout value.
If 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).
> childsupervision checktimeout 30 Done
Set the Child Supervision Check Timeout value.
> childsupervision checktimeout 30 Done
Get the Thread Child Timeout value.
> childtimeout 300 Done
Set the Thread Child Timeout value.
> childtimeout 300 Done
Get the CONTEXT_ID_REUSE_DELAY value.
> contextreusedelay 11 Done
Set the CONTEXT_ID_REUSE_DELAY value.
> contextreusedelay 11 Done
Get the supported counter names.
> counters ip mac mle Done
Get the counter value.
> counters mac TxTotal: 10 TxUnicast: 3 TxBroadcast: 7 TxAckRequested: 3 TxAcked: 3 TxNoAckRequested: 7 TxData: 10 TxDataPoll: 0 TxBeacon: 0 TxBeaconRequest: 0 TxOther: 0 TxRetry: 0 TxErrCca: 0 TxErrBusyChannel: 0 RxTotal: 2 RxUnicast: 1 RxBroadcast: 1 RxData: 2 RxDataPoll: 0 RxBeacon: 0 RxBeaconRequest: 0 RxOther: 0 RxAddressFiltered: 0 RxDestAddrFiltered: 0 RxDuplicated: 0 RxErrNoFrame: 0 RxErrNoUnknownNeighbor: 0 RxErrInvalidSrcAddr: 0 RxErrSec: 0 RxErrFcs: 0 RxErrOther: 0 Done > counters mle Role Disabled: 0 Role Detached: 1 Role Child: 0 Role Router: 0 Role Leader: 1 Attach Attempts: 1 Partition Id Changes: 1 Better Partition Attach Attempts: 0 Parent Changes: 0 Done > counters ip TxSuccess: 10 TxFailed: 0 RxSuccess: 5 RxFailed: 0 Done
Reset the counter value.
> counters mac reset Done > counters mle reset Done > counters ip reset Done
Get the CSL configuration.
> csl Channel: 11 Period: 1000 (in units of 10 symbols), 160ms Timeout: 1000s Done
Set CSL channel.
> csl channel 20 Done
Set CSL period in units of 10 symbols. Disable CSL by setting this parameter to 0
.
> csl period 3000 Done
Set the CSL timeout in seconds.
> csl timeout 10 Done
Get the Thread network time and the time sync parameters.
> networktime Network Time: 21084154us (synchronized) Time Sync Period: 100s XTAL Threshold: 300ppm Done
Set time sync parameters
> networktime 100 300 Done
Get the minimal delay timer (in seconds).
> delaytimermin 30 Done
Set the minimal delay timer (in seconds).
> delaytimermin 60 Done
Perform an MLE Discovery operation.
> discover | J | Network Name | Extended PAN | PAN | MAC Address | Ch | dBm | LQI | +---+------------------+------------------+------+------------------+----+-----+-----+ | 0 | OpenThread | dead00beef00cafe | ffff | f1d92a82c8d8fe43 | 11 | -20 | 0 | Done
Get the default query config used by DNS client.
The config includes the server IPv6 address and port, response timeout in msec (wait time to rx response), maximum tx attempts before reporting failure, boolean flag to indicate whether the server can resolve the query recursively or not.
> dns config Server: [fd00:0:0:0:0:0:0:1]:1234 ResponseTimeout: 5000 ms MaxTxAttempts: 2 RecursionDesired: no Done >
Set the default query config.
> dns config fd00::1 1234 5000 2 0 Done > dns config Server: [fd00:0:0:0:0:0:0:1]:1234 ResponseTimeout: 5000 ms MaxTxAttempts: 2 RecursionDesired: no Done
We 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.
> dns config fd00::2 Done > dns config Server: [fd00:0:0:0:0:0:0:2]:53 ResponseTimeout: 3000 ms MaxTxAttempts: 3 RecursionDesired: yes Done
Send DNS Query to obtain IPv6 address for given hostname.
The 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
).
> dns resolve ipv6.google.com > DNS response for ipv6.google.com - 2a00:1450:401b:801:0:0:0:200e TTL: 300
Send a browse (service instance enumeration) DNS query to get the list of services for given service-name.
The 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
).
> dns browse _service._udp.example.com DNS browse response for _service._udp.example.com. inst1 Port:1234, Priority:1, Weight:2, TTL:7200 Host:host.example.com. HostAddress:fd00:0:0:0:0:0:0:abcd TTL:7200 TXT:[a=6531, b=6c12] TTL:7300 instance2 Port:1234, Priority:1, Weight:2, TTL:7200 Host:host.example.com. HostAddress:fd00:0:0:0:0:0:0:abcd TTL:7200 TXT:[a=1234] TTL:7300 Done
Send 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).
The 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
).
Enable/Disable the “DNS name compression” mode.
By 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.
This is intended for testing only and available under REFERENCE_DEVICE
config.
Get the current “DNS name compression” mode.
> dns compression Enabled
Set the “DNS name compression” mode.
> dns compression disable Done > > > dns compression Disabled Done
Get the Thread Domain Name for Thread 1.2 device.
> domainname Thread Done
Set the Thread Domain Name for Thread 1.2 device.
> domainname Test\ Thread Done
Get the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device.
> dua iid 0004000300020001 Done
Set the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device.
> dua iid 0004000300020001 Done
Clear the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device.
> dua iid clear Done
Print the EID-to-RLOC cache entries.
> eidcache fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7d 2000 cache canEvict=1 transTime=0 eid=fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7d fd49:caf4:a29f:dc0e:97fc:69dd:3c16:df7f fffe retry canEvict=1 timeout=10 retryDelay=30 Done
Get the factory-assigned IEEE EUI-64.
> eui64 0615aae900124b00 Done
Get the IEEE 802.15.4 Extended Address.
> extaddr dead00beef00cafe Done
Set the IEEE 802.15.4 Extended Address.
> extaddr dead00beef00cafe dead00beef00cafe Done
Get the Thread Extended PAN ID value.
NOTE The current commissioning credential becomes stale after changing this value. Use pskc to reset.
> extpanid dead00beef00cafe Done
Set the Thread Extended PAN ID value.
> extpanid dead00beef00cafe Done
Delete all stored settings, and signal a platform reset.
> factoryreset
Send fake Thread messages.
Note: Only for certification test.
> fake /a/an fdde:ad00:beef:0:0:ff:fe00:a800 fd00:7d03:7d03:7d03:55f2:bb6a:7a43:a03b 1111222233334444 Done
Get external FEM parameters.
> fem LNA gain 11 dBm Done
Get the Rx LNA gain in dBm of the external FEM.
> fem lnagain 11 Done
Set the Rx LNA gain in dBm of the external FEM.
> fem lnagain 8 Done
Show the status of the IPv6 interface.
> ifconfig down Done
Bring up the IPv6 interface.
> ifconfig up Done
Bring down the IPv6 interface.
> ifconfig down Done
List all IPv6 addresses assigned to the Thread interface.
> ipaddr fdde:ad00:beef:0:0:ff:fe00:0 fdde:ad00:beef:0:558:f56b:d688:799 fe80:0:0:0:f3d9:2a82:c8d8:fe43 Done
Use -v
to get more verbose informations about the address.
> ipaddr -v fdde:ad00:beef:0:0:ff:fe00:0 origin:thread fdde:ad00:beef:0:558:f56b:d688:799 origin:thread fe80:0:0:0:f3d9:2a82:c8d8:fe43 origin:thread Done
Add an IPv6 address to the Thread interface.
> ipaddr add 2001::dead:beef:cafe Done
Delete an IPv6 address from the Thread interface.
> ipaddr del 2001::dead:beef:cafe Done
Print Thread link-local IPv6 address.
> ipaddr linklocal fe80:0:0:0:f3d9:2a82:c8d8:fe43 Done
Print Thread Mesh Local EID address.
> ipaddr mleid fdde:ad00:beef:0:558:f56b:d688:799 Done
Print Thread Routing Locator (RLOC) address.
> ipaddr rloc fdde:ad00:beef:0:0:ff:fe00:0 Done
List all IPv6 multicast addresses subscribed to the Thread interface.
> ipmaddr ff05:0:0:0:0:0:0:1 ff33:40:fdde:ad00:beef:0:0:1 ff32:40:fdde:ad00:beef:0:0:1 Done
Subscribe the Thread interface to the IPv6 multicast address.
> ipmaddr add ff05::1 Done
Unsubscribe the Thread interface to the IPv6 multicast address.
> ipmaddr del ff05::1 Done
Get the Link-Local All Thread Nodes multicast address.
> ipmaddr llatn ff32:40:fdde:ad00:beef:0:0:1 Done
Get multicast promiscuous mode.
> ipmaddr promiscuous Disabled Done
Enable multicast promiscuous mode.
> ipmaddr promiscuous enable Done
Disable multicast promiscuous mode.
> ipmaddr promiscuous disable Done
Get the Realm-Local All Thread Nodes multicast address.
> ipmaddr rlatn ff33:40:fdde:ad00:beef:0:0:1 Done
Set the Joiner port.
> joinerport 1000 Done
Get the Thread Key Sequence Counter.
> keysequence counter 10 Done
Set the Thread Key Sequence Counter.
> keysequence counter 10 Done
Get Thread Key Switch Guard Time (in hours)
> keysequence guardtime 0 Done
Set Thread Key Switch Guard Time (in hours) 0 means Thread Key Switch imediately if key index match
> keysequence guardtime 0 Done
Show the Thread Leader Data.
> leaderdata Partition ID: 1077744240 Weighting: 64 Data Version: 109 Stable Data Version: 211 Leader Router ID: 60 Done
Get the Thread Leader Weight.
> leaderweight 128 Done
Set the Thread Leader Weight.
> leaderweight 128 Done
Send a Link Metrics Management Request to clear an Enhanced-ACK Based Probing.
> linkmetrics mgmt fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack clear Done > Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2 Status: Success
Send a Link Metrics Management Request to register an Enhanced-ACK Based Probing.
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.> linkmetrics mgmt fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack register qm Done > Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2 Status: Success > linkmetrics mgmt fe80:0:0:0:3092:f334:1455:1ad2 enhanced-ack register qm r Done > Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2 Status: Cannot support new series
Send a Link Metrics Management Request to configure a Forward Tracking Series.
> linkmetrics mgmt fe80:0:0:0:3092:f334:1455:1ad2 forward 1 dra pqmr Done > Received Link Metrics Management Response from: fe80:0:0:0:3092:f334:1455:1ad2 Status: SUCCESS
Send a MLE Link Probe message to the peer.
> linkmetrics probe fe80:0:0:0:3092:f334:1455:1ad2 1 10 Done
Perform a Link Metrics query (Single Probe).
> linkmetrics query fe80:0:0:0:3092:f334:1455:1ad2 single qmr Done > Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2 - LQI: 76 (Exponential Moving Average) - Margin: 82 (dB) (Exponential Moving Average) - RSSI: -18 (dBm) (Exponential Moving Average)
Perform a Link Metrics query (Forward Tracking Series).
> linkmetrics query fe80:0:0:0:3092:f334:1455:1ad2 forward 1 Done > Received Link Metrics Report from: fe80:0:0:0:3092:f334:1455:1ad2 - PDU Counter: 2 (Count/Summation) - LQI: 76 (Exponential Moving Average) - Margin: 82 (dB) (Exponential Moving Average) - RSSI: -18 (dBm) (Exponential Moving Average)
Get the link quality on the link to a given extended address.
> linkquality 36c1dd7a4f5201ff 3 Done
Set the link quality on the link to a given extended address.
> linkquality 36c1dd7a4f5201ff 3 Done
Gets the current state (In Progress
or Idle
) of anycast locator.
OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
is required.
> locate Idle Done > locate fdde:ad00:beef:0:0:ff:fe00:fc10 > locate In Progress Done
Locate the closest destination of an anycast address (i.e., find the destination's mesh local EID and RLOC16).
OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
is required.
The closest destination is determined based on the the current routing table and path costs within the Thread mesh.
Locate the leader using its anycast address:
> locate fdde:ad00:beef:0:0:ff:fe00:fc00 fdde:ad00:beef:0:d9d3:9000:16b:d03b 0xc800 Done
Locate the closest destination of a service anycast address:
> srp server enable Done > netdata show Prefixes: Routes: Services: 44970 5d c002 s c800 44970 5d c002 s cc00 Done > locate fdde:ad00:beef:0:0:ff:fe00:fc10 fdde:ad00:beef:0:a477:dc98:a4e4:71ea 0xcc00 done
OPENTHREAD_EXAMPLES_SIMULATION
OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART
Specifies filename to capture otPlatLog() messages, useful when debugging automated test scripts on Linux when logging disrupts the automated test scripts.
Get the log level.
> log level 1 Done
Set the log level.
> log level 4 Done
Set the Mesh Local IID.
It must be used before Thread stack is enabled.
Only for testing/reference device.
> mliid 1122334455667788 Done
Register Multicast Listeners to Primary Backbone Router, with an optional timeout
(in seconds).
Omit timeout
to use the default MLR timeout on the Primary Backbone Router.
Use timeout = 0
to deregister Multicast Listeners.
NOTE: Only for Thread 1.2 Commissioner FTD device.
> mlr reg ff04::1 status 0, 0 failed Done > mlr reg ff04::1 ff04::2 ff02::1 status 2, 1 failed ff02:0:0:0:0:0:0:1 Done > mlr reg ff04::1 ff04::2 1000 status 0, 0 failed Done > mlr reg ff04::1 ff04::2 0 status 0, 0 failed Done
Get the Thread Device Mode value.
> mode rdn Done
Set the Thread Device Mode value.
> mode rdn Done
> mode - Done
Get the list of supported radio links by the device.
This command is always available, even when only a single radio is supported by the device.
> multiradio [15.4, TREL] Done
Get the list of neighbors and their supported radios and their preference.
This command is only available when device supports more than one radio link.
> multiradio neighbor list ExtAddr:3a65bc38dbe4a5be, RLOC16:0xcc00, Radios:[15.4(255), TREL(255)] ExtAddr:17df23452ee4a4be, RLOC16:0x1300, Radios:[15.4(255)] Done
Get the radio info for specific neighbor with a given extended address.
This command is only available when device supports more than one radio link.
> multiradio neighbor 3a65bc38dbe4a5be [15.4(255), TREL(255)] Done
List RLOC16 of neighbors.
> neighbor list 0xcc01 0xc800 0xf000 Done
Print table of neighbors.
> neighbor table | Role | RLOC16 | Age | Avg RSSI | Last RSSI |R|D|N| Extended MAC | +------+--------+-----+----------+-----------+-+-+-+------------------+ | C | 0xcc01 | 96 | -46 | -46 |1|1|1| 1eb9ba8a6522636b | | R | 0xc800 | 2 | -29 | -29 |1|1|1| 9a91556102c39ddb | | R | 0xf000 | 3 | -28 | -28 |1|1|1| 0ad7ed6beaa6016d | Done
List all UDP sockets.
> netstat | Local Address | Peer Address | +-------------------------------------------------+-------------------------------------------------+ | [0:0:0:0:0:0:0:0]:49153 | [0:0:0:0:0:0:0:0]:0 | | [0:0:0:0:0:0:0:0]:49152 | [0:0:0:0:0:0:0:0]:0 | | [0:0:0:0:0:0:0:0]:61631 | [0:0:0:0:0:0:0:0]:0 | | [0:0:0:0:0:0:0:0]:19788 | [0:0:0:0:0:0:0:0]:0 | Done
Send network diagnostic request to retrieve tlv of <type>s.
If <addr> is unicast address, Diagnostic Get
will be sent. if <addr> is multicast address, Diagnostic Query
will be sent.
> networkdiagnostic get fdde:ad00:beef:0:0:ff:fe00:fc00 0 1 6 > DIAG_GET.rsp/ans: 00080e336e1c41494e1c01020c000608640b0f674074c503 Ext Address: '0e336e1c41494e1c' Rloc16: 0x0c00 Leader Data: PartitionId: 0x640b0f67 Weighting: 64 DataVersion: 116 StableDataVersion: 197 LeaderRouterId: 0x03 Done > networkdiagnostic get ff02::1 0 1 > DIAG_GET.rsp/ans: 00080e336e1c41494e1c01020c00 Ext Address: '0e336e1c41494e1c' Rloc16: 0x0c00 Done DIAG_GET.rsp/ans: 00083efcdb7e3f9eb0f201021800 Ext Address: '3efcdb7e3f9eb0f2' Rloc16: 0x1800 Done
Send network diagnostic request to reset <addr>'s tlv of <type>s. Currently only MAC Counters
(9) is supported.
> diagnostic reset fd00:db8::ff:fe00:0 9 Done
Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
> networkidtimeout 120 Done
Set the NETWORK_ID_TIMEOUT parameter used in the Router role.
> networkidtimeout 120 Done
Get the Thread Network Key value.
> networkkey 00112233445566778899aabbccddeeff Done
Set the Thread Network Key value.
> networkkey 00112233445566778899aabbccddeeff Done
Get the Thread Network Name.
> networkname OpenThread Done
Set the Thread Network Name.
NOTE The current commissioning credential becomes stale after changing this value. Use pskc to reset.
> networkname OpenThread Done
Get the IEEE 802.15.4 PAN ID value.
> panid 0xdead Done
Set the IEEE 802.15.4 PAN ID value.
> panid 0xdead Done
Get the diagnostic information for a Thread Router as parent.
Note: When operating as a Thread Router, 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.
> parent Ext Addr: be1857c6c21dce55 Rloc: 5c00 Link Quality In: 3 Link Quality Out: 3 Age: 20 Done
Get the assigned parent priority value, -2 means not assigned.
> parentpriority 1 Done
Set the assigned parent priority value: 1, 0, -1 or -2.
> parentpriority 1 Done
Get the Thread Network Partition ID.
> partitionid 4294967295 Done
Get the preferred Thread Leader Partition ID.
OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is required.
> partitionid preferred 4294967295 Done
Set the preferred Thread Leader Partition ID.
OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is required.
> partitionid preferred 0xffffffff Done
Send an ICMPv6 Echo Request.
0.5
.3.5
.> ping fd00:db8:0:0:76b:6a05:3ae9:a61a > 16 bytes from fd00:db8:0:0:76b:6a05:3ae9:a61a: icmp_seq=5 hlim=64 time=0ms 1 packets transmitted, 1 packets received. Packet loss = 0.0%. Round-trip min/avg/max = 0/0.0/0 ms. Done > ping -I fd00:db8:0:0:76b:6a05:3ae9:a61a ff02::1 100 1 1 1 > 108 bytes from fd00:db8:0:0:f605:fb4b:d429:d59a: icmp_seq=4 hlim=64 time=7ms 1 packets transmitted, 1 packets received. Round-trip min/avg/max = 7/7.0/7 ms. Done
Stop sending ICMPv6 Echo Requests.
> ping stop Done
Get the customized data poll period of sleepy end device (milliseconds). Only for certification test
> pollperiod 0 Done
Set the customized data poll period for sleepy end device (milliseconds >= 10ms). Only for certification test
> pollperiod 10 Done
With -p
generate pskc from <passphrase> (UTF-8 encoded) together with current network name and extended PAN ID, otherwise set pskc as <key> (hex format).
> pskc 67c0c203aa0b042bfb5381c47aef4d9e Done > pskc -p 123456 Done
Prefer a Router ID when solicit router id from Leader.
> preferrouterid 16 Done
Get 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 preceeding -
if backbone functionality is disabled.
> prefix 2001:dead:beef:cafe::/64 paros med - fd00:7d03:7d03:7d03::/64 prosD med Done
Add a valid prefix to the Network Data.
Note: The Domain Prefix flag (D
) is only available for Thread 1.2.
> prefix add 2001:dead:beef:cafe::/64 paros med Done > prefix add fd00:7d03:7d03:7d03::/64 prosD med Done
Get the mesh local prefix.
> prefix meshlocal fdde:ad00:beef:0::/64 Done
Set the mesh local prefix.
> prefix meshlocal fdde:ad00:beef:0::/64 Done
Invalidate a prefix in the Network Data.
> prefix remove 2001:dead:beef:cafe::/64 Done
Get radio promiscuous property.
> promiscuous Disabled Done
Enable radio promiscuous operation and print raw packet content.
> promiscuous enable Done
Disable radio promiscuous operation.
> promiscuous disable Done
OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
is required.
The radio filter is mainly intended for testing. It can be used to temporarily block all tx/rx on the IEEE 802.15.4 radio.
When 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).
Get radio filter status (enabled or disabled).
> radiofilter Disabled Done
OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
is required.
Enable radio radio filter.
> radiofilter enable Done
OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
is required.
Disable radio radio filter.
> radiofilter disable Done
RCP-related commands.
Set the radio region, this can affect the transmit power limit.
> region US Done > region US Done
Print RCP version string.
> rcp version OPENTHREAD/20191113-00825-g82053cc9d-dirty; SIMULATION; Jun 4 2020 17:53:16 Done
Release a Router ID that has been allocated by the device in the Leader role.
> releaserouterid 16 Done
Signal a platform reset.
> reset
Get the Thread RLOC16 value.
> rloc16 0xdead Done
Get the external route list in the local Network Data.
> route 2001:dead:beef:cafe::/64 s med Done
Add a valid external route to the Network Data.
> route add 2001:dead:beef:cafe::/64 s med Done
Invalidate a external route in the Network Data.
> route remove 2001:dead:beef:cafe::/64 Done
List allocated Router IDs.
> router list 8 24 50 Done
Print table of routers.
> router table | ID | RLOC16 | Next Hop | Path Cost | LQ In | LQ Out | Age | Extended MAC | Link | +----+--------+----------+-----------+-------+--------+-----+------------------+------+ | 22 | 0x5800 | 63 | 0 | 0 | 0 | 0 | 0aeb8196c9f61658 | 0 | | 49 | 0xc400 | 63 | 0 | 3 | 3 | 0 | faa1c03908e2dbf2 | 1 | Done
Print diagnostic information for a Thread Router. The id
may be a Router ID or an RLOC16.
> router 50 Alloc: 1 Router ID: 50 Rloc: c800 Next Hop: c800 Link: 1 Ext Addr: e2b3540590b0fd87 Cost: 0 Link Quality In: 3 Link Quality Out: 3 Age: 3 Done
> router 0xc800 Alloc: 1 Router ID: 50 Rloc: c800 Next Hop: c800 Link: 1 Ext Addr: e2b3540590b0fd87 Cost: 0 Link Quality In: 3 Link Quality Out: 3 Age: 7 Done
Get the ROUTER_DOWNGRADE_THRESHOLD value.
> routerdowngradethreshold 23 Done
Set the ROUTER_DOWNGRADE_THRESHOLD value.
> routerdowngradethreshold 23 Done
Indicates whether the router role is enabled or disabled.
> routereligible Enabled Done
Enable the router role.
> routereligible enable Done
Disable the router role.
> routereligible disable Done
Get the ROUTER_SELECTION_JITTER value.
> routerselectionjitter 120 Done
Set the ROUTER_SELECTION_JITTER value.
> routerselectionjitter 120 Done
Get the ROUTER_UPGRADE_THRESHOLD value.
> routerupgradethreshold 16 Done
Set the ROUTER_UPGRADE_THRESHOLD value.
> routerupgradethreshold 16 Done
Perform an IEEE 802.15.4 Active Scan.
> scan | PAN | MAC Address | Ch | dBm | LQI | +------+------------------+----+-----+-----+ | ffff | f1d92a82c8d8fe43 | 11 | -20 | 0 | Done
Perform an IEEE 802.15.4 Energy Scan.
> scan energy 10 | Ch | RSSI | +----+------+ | 11 | -59 | | 12 | -62 | | 13 | -67 | | 14 | -61 | | 15 | -87 | | 16 | -86 | | 17 | -86 | | 18 | -52 | | 19 | -58 | | 20 | -82 | | 21 | -76 | | 22 | -82 | | 23 | -74 | | 24 | -81 | | 25 | -88 | | 26 | -71 | Done
> scan energy 10 20 | Ch | RSSI | +----+------+ | 20 | -82 | Done
Module for controlling service registration in Network Data. Each change in service registration must be sent to leader by netdata register
command before taking effect.
Add service to the Network Data.
> service add 44970 112233 aabbcc Done > netdata register Done
Remove service from Network Data.
> service remove 44970 112233 Done > netdata register Done
Return true when there are no other nodes in the network, otherwise return false.
> singleton true or false Done
Send SNTP Query to obtain current unix epoch time (from 1st January 1970). The latter two parameters have following default values:
> sntp query > SNTP response - Unix time: 1540894725 (era: 0)
You can use NAT64 of OpenThread Border Router to reach e.g. Google IPv4 NTP Server:
> sntp query 64:ff9b::d8ef:2308 > SNTP response - Unix time: 1540898611 (era: 0)
Return state of current state.
> state offline, disabled, detached, child, router or leader Done
Try to switch to state detached
, child
, router
or leader
.
> state leader Done
Enable Thread protocol operation and attach to a Thread network.
> thread start Done
Disable Thread protocol operation and detach from a Thread network.
> thread stop Done
Get the Thread Version number.
> thread version 2 Done
Indicate whether TREL radio operation is enabled or not.
OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
is required for all trel
sub-commands.
> trel Enabled Done
Enable TREL operation.
> trel enable Done
Disable TREL operation.
> trel disable Done
Indicate whether TREL filter mode is enabled or not
When filter mode is enabled, any rx and tx traffic through TREL interface is silently dropped. This is mainly intended for use during testing.
> trel filter Disabled Done
Enable TREL filter mode.
> trel filter enable Done
Disable TREL filter mode.
> trel filter disable Done
Get the TREL peer table in table format or as a list.
> trel peers | No | Ext MAC Address | Ext PAN Id | IPv6 Socket Address | +-----+------------------+------------------+--------------------------------------------------+ | 1 | 5e5785ba3a63adb9 | f0d9c001f00d2e43 | [fe80:0:0:0:cc79:2a29:d311:1aea]:9202 | | 2 | ce792a29d3111aea | dead00beef00cafe | [fe80:0:0:0:5c57:85ba:3a63:adb9]:9203 | Done > trel peers list 001 ExtAddr:5e5785ba3a63adb9 ExtPanId:f0d9c001f00d2e43 SockAddr:[fe80:0:0:0:cc79:2a29:d311:1aea]:9202 002 ExtAddr:ce792a29d3111aea ExtPanId:dead00beef00cafe SockAddr:[fe80:0:0:0:5c57:85ba:3a63:adb9]:9203 >>>>>>> [trel] implement new TREL model using DNS-SD Done
Enable thread version check when upgrading to router or leader.
Note: Thread version check is enabled by default.
OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is required.
> tvcheck enable Done
Enable thread version check when upgrading to router or leader.
Note: Thread version check is enabled by default.
OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is required.
> tvcheck disable Done
Get the transmit power in dBm.
> txpower -10 dBm Done
Set the transmit power in dBm.
> txpower -10 Done
Add a port to the allowed unsecured port list.
> unsecureport add 1234 Done
Remove a port from the allowed unsecured port list.
> unsecureport remove 1234 Done
Remove all ports from the allowed unsecured port list.
> unsecureport remove all Done
Print all ports from the allowed unsecured port list.
> unsecureport get 1234 Done
This command requires OPENTHREAD_CONFIG_UPTIME_ENABLE
to be enabled.
Print the OpenThread stack uptime (duration since OpenThread stack initialization).
> uptime 12:46:35.469 Done >
This command requires OPENTHREAD_CONFIG_UPTIME_ENABLE
to be enabled.
Print the OpenThread stack uptime in msec.
> uptime ms 426238 Done >
Print the build version information.
> version OPENTHREAD/gf4f2f04; Jul 1 2016 17:00:09 Done
Print API version number.
> version api 28 Done
Get the number of direct TX retries on the MAC layer.
> mac retries direct 3 Done
Set the number of direct TX retries on the MAC layer.
> mac retries direct 5 Done
Get the number of indirect TX retries on the MAC layer.
> mac retries indirect 3 Done
Set the number of indirect TX retries on the MAC layer.
> mac retries indirect 5 Done
Instruct 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.
> mac send datarequest Done
> mac send emptydata Done
List the macfilter status, including address and received signal strength filter settings.
> macfilter Address Mode: Allowlist 0f6127e33af6b403 : rss -95 (lqi 1) 0f6127e33af6b402 RssIn List: 0f6127e33af6b403 : rss -95 (lqi 1) Default rss : -50 (lqi 3) Done
List the address filter status.
> macfilter addr Allowlist 0f6127e33af6b403 : rss -95 (lqi 1) 0f6127e33af6b402 Done
Disable address filter mode.
> macfilter addr disable Done
Enable allowlist address filter mode.
> macfilter addr allowlist Done
Enable denylist address filter mode.
> macfilter addr denylist Done
Add an IEEE 802.15.4 Extended Address to the address filter, and fixed the received singal strength for the messages from the address if rss is specified.
> macfilter addr add 0f6127e33af6b403 -95 Done
> macfilter addr add 0f6127e33af6b402 Done
Remove the IEEE802.15.4 Extended Address from the address filter.
> macfilter addr remove 0f6127e33af6b402 Done
Clear all the IEEE802.15.4 Extended Addresses from the address filter.
> macfilter addr clear Done
List the rss filter status
> macfilter rss 0f6127e33af6b403 : rss -95 (lqi 1) Default rss: -50 (lqi 3) Done
Set 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.
> macfilter rss add * -50 Done
> macfilter rss add 0f6127e33af6b404 -85 Done
Set 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
> macfilter rss add-lqi * 3 Done
> macfilter rss add 0f6127e33af6b404 2 Done
Removes 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.
> macfilter rss remove * Done
> macfilter rss remove 0f6127e33af6b404 Done
Clear all the received signal strength or received link quality settings.
> macfilter rss clear Done
Factory Diagnostics module is enabled only when building OpenThread with OPENTHREAD_CONFIG_DIAG_ENABLE=1
option. Go diagnostics module for more information.