The OpenThread diagnostics module is a tool for debugging platform hardware manually, and it will also be used during manufacturing process, to verify platform hardware performance.
The diagnostics module supports common diagnostics features that are listed below, and it also provides a mechanism for expanding platform specific diagnostics features.
Show diagnostics mode status.
> diag diagnostics mode is disabled
Start diagnostics mode.
> diag start start diagnostics mode status 0x00
Get the IEEE 802.15.4 Channel value for diagnostics module.
> diag channel channel: 11
Set the IEEE 802.15.4 Channel value for diagnostics module.
> diag channel 11 set channel to 11 status 0x00
Start transmitting continuous carrier wave.
> diag cw start Done
Stop transmitting continuous carrier wave.
> diag cw stop Done
Start transmitting a stream of characters.
> diag stream start Done
Stop transmitting a stream of characters.
> diag stream stop Done
Get the tx power value(dBm) for diagnostics module.
> diag power tx power: -10 dBm
Set the tx power value(dBm) for diagnostics module.
> diag power -10 set tx power to -10 dBm status 0x00
Show the currently used power settings table.
TargetPower
and ActualPower
is 0.01dBm.> diag powersettings | StartCh | EndCh | TargetPower | ActualPower | RawPowerSetting | +---------+-------+-------------+-------------+-----------------+ | 11 | 14 | 1700 | 1000 | 223344 | | 15 | 24 | 2000 | 1900 | 112233 | | 25 | 25 | 1600 | 1000 | 223344 | | 26 | 26 | 1600 | 1500 | 334455 | Done
Show the currently used power settings for the given channel.
> diag powersettings 11 TargetPower(0.01dBm): 1700 ActualPower(0.01dBm): 1000 RawPowerSetting: 223344 Done
Transmit a fixed number of packets with fixed length.
Length parameter has to be in range [3, 127].
> diag send 20 100 sending 0x14 packet(s), length 0x64 status 0x00
Transmit packets repeatedly with a fixed interval.
Length parameter has to be in range [3, 127].
> diag repeat 100 100 sending packets of length 0x64 at the delay of 0x64 ms status 0x00
Stop repeated packet transmission.
> diag repeat stop repeated packet transmission is stopped status 0x00
Enter radio sleep mode.
> diag radio sleep set radio from receive to sleep status 0x00
Set radio from sleep mode to receive mode.
> diag radio receive set radio from sleep to receive on channel 11 status 0x00
Return the state of the radio.
> diag radio state sleep
Show the raw power setting for diagnostics module.
> diag rawpowersetting 112233 Done
Set the raw power setting for diagnostics module.
> diag rawpowersetting 112233 Done
Enable the platform layer to use the value set by the command diag rawpowersetting \<settings\>
.
> diag rawpowersetting enable Done
Disable the platform layer to use the value set by the command diag rawpowersetting \<settings\>
.
> diag rawpowersetting disable Done
Print statistics during diagnostics mode.
> diag stats received packets: 10 sent packets: 10 first received packet: rssi=-65, lqi=101 last received packet: rssi=-64, lqi=98
Clear statistics during diagnostics mode.
> diag stats clear stats cleared
Get the gpio value.
> diag gpio get 0 1 Done
Set the gpio value.
The parameter value
has to be 0
or 1
.
> diag gpio set 0 1 Done
Get the gpio mode.
> diag gpio mode 1 in Done
Sets the given gpio to the input mode without pull resistor.
> diag gpio mode 1 in Done
Sets the given gpio to the output mode.
> diag gpio mode 1 out Done
Stop diagnostics mode and print statistics.
> diag stop received packets: 10 sent packets: 10 first received packet: rssi=-65, lqi=101 last received packet: rssi=-61, lqi=98 stop diagnostics mode status 0x00
RCP-related diagnostics commands. These commands are used for debugging and testing only.
Start RCP diagnostics mode.
> diag rcp start Done
Stop RCP diagnostics mode.
> diag rcp stop Done
Set the RCP IEEE 802.15.4 Channel value for diagnostics module.
> diag rcp channel 11 Done
Set the RCP tx power value(dBm) for diagnostics module.
> diag rcp power 0 Done
RCP echoes the given message.
> diag rcp echo 0123456789 0123456789 Done
RCP echoes the message with the given number of bytes.
> diag rcp echo -n 20 01234567890123456789 Done