Command Line Interface#

The CLI provides an alternative interface to the LCD screen with additional features and test scripting. In addition to exposing a broader API, the CLI enables you to:

  • Configure the network name, network size, and TX output power.

  • Control the connection state.

  • Connect or disconnect the Wi-SUN node.

  • Input IPv6 addresses to perform ping tests with devices other than the border router, parent, and children.

  • Configure IPv6 UDP iperf tests

The Wi-SUN Network Measurement application leverages the common Wi-SUN application CLI for standard Wi-SUN actions. It adds a specific “measure” command that can start ping tests equivalent to the one triggered from the LCD screen interface.

Three command domains are available: about, wisun, and iperf. You can list these by executing help:

> help

about                         Get info about the running app
iperf                         iPerf2 commands
wisun                         Wi-SUN commands

The about command domain is limited to displaying information about the current application (it is provided by the ‘app info’ component).

about
Wi-SUN Network Measurement Application
Versions:
  * Compiler (GCC): 10.3.1
  * Micrium OS kernel: 5.12.1
  * Wi-SUN: 1.1.0
  * mbed TLS: 3.1.0

\>

You can access the list of wisun commands by executing wisun help at the command prompt:

> wisun help

join_fan10                    Connect to a Wi-SUN network using FAN1.0 settings
join_fan11                    Connect to a Wi-SUN network using FAN1.1 settings
join_explicit                 Connect to a Wi-SUN network using explicit PHY settings
disconnect                    Disconnect from the Wi-SUN network
set                           Set a variable
                              [*] empty | help | [string] Key [string] Value
get                           Get a variable
                              [*] empty | help | [string] Key
save                          Save variables to non-volatile storage
reset                         Reset variables to default settings
measure                       Measure a remote host or quick measurement
                              [string] Remote address or 'all' or 'parent' or 'br'
                              [uint16] Count of measurement packets
                              [uint16] Measurement packet length
ping                          Ping a remote host

                              [string] Remote address

And the list of iperf commands by executing iperf help at the command prompt:

> iperf help
  get                           Get configuration parameters
                                [*] empty | [string] Key
  set                           Set configuration parameters
                                [*] empty | [string] Key [string] Value
  server                        Start preconfigured iPerf Server test
                                [*] help
  client                        Start preconfigured iPerf Client test
                                [*] help

For wisun or iperf command domains, set and get functions are available to check (<domain\> get) or change (<domain\> set) current settings. To only list existing settings, use <domain> get <subdomain> help.

The Wi-SUN Network Measurement application maintains Wi-SUN network settings that you can access by executing wisun get wisun. This returns all the settings available in the Wi-SUN CLI component. You can check whether a setting is only readable by executing wisun get wisun help or if it can be modified (by executing wisun set) as shown in the following examples.

> wisun get wisun help

[rw] wisun.network_name
[rw] wisun.network_size
[rw] wisun.tx_power
[rw] wisun.regulatory_domain
[rw] wisun.operating_class
[rw] wisun.operating_mode
[ro] wisun.connection_state
[ro] wisun.ip_address_global
[ro] wisun.ip_address_link_local
[ro] wisun.ip_address_border_router
[rw] wisun.regulation                                         Regional regulation [uint8]
[rw] wisun.regulation_warning_threshold                       Transmission warning threshold in
                                                              percent (-1 to disable) [int8]

[rw] wisun.regulation_alert_threshold                         Transmission alert threshold in percent
                                                              (-1 to disable) [int8]

Similarly, the writable settings are listed when you execute wisun set wisun help.

> wisun set wisun help

[rw] wisun.network_name
[rw] wisun.network_size
[rw] wisun.tx_power
[rw] wisun.regulatory_domain
[rw] wisun.operating_class
[rw] wisun.operating_mode
[rw] wisun.regulation                                         Regional regulation [uint8]
[rw] wisun.regulation_warning_threshold                       Transmission warning threshold in
                                                              percent (-1 to disable) [int8]
[rw] wisun.regulation_alert_threshold                         Transmission alert threshold in percent

                                                              (-1 to disable) [int8]

This list is the same as the get list without the read-only ([ro]) values.

The iperf command domain has additional help about the possible parameters, accessible using iperf get help.

> iperf get help
Help of iperf 'get' and 'set' methods

Available sub-domains :
 options
 results

[csut]: corresponds to client/server/udp/tcp. Indicates in which case the parameter applies

Type 'iperf [get or set] \<sub-domain\> help'

eg. 'iperf get options help' to get the help of all options
    'iperf get options' for all current options values
    'iperf get results' for test results
    'iperf get options.\<option\>' for a specific option value

This shows that there are 2 iperf sub-domains: options and results.

Since options may differ depending on the test case (Client or Server, UDP or TCP), an indicator is added on each line:

[csut]: corresponds to client/server/udp/tcp. Indicates in which case the parameter applies

So, options can be displayed using iperf get options help.

iperf get options help
[csu ] options.port                     Server port to listen on/connect to [uint16] (default 5001)
[c u ] options.remote_addr              IPv6 remote host address  [string]
[c u ] options.bandwidth                Unused if packet_number is set. Otherwise used to compute
                                        Packet_number as bandwidth\*duration/buffer_length  [uint32]
                                        (default 20000)
[csu ] options.bw_format                Unused if packet_number is set. One of [bits/s, Kbits/s,
                                        Mbits/s, Gbits/s, bytes/s, Kbytes/s, Mbytes/s, Gbytes/s]
                                        [string] (default bits/s)
[c u ] options.packet_number            Number of packets to send. (Rules out bandwidth)  [uint16]
                                        (default 0=unset)
[c u ] options.buffer_length            buffer_length
[c u ] options.duration                 Test duration in seconds [uint16] (default 10)
[csu ] options.interval                 Seconds between periodic bandwidth reports  [uint16]
                                        (default 1)
>

Above, we see that the iperf server has only a limited number of options: port, bw_format, and interval, while the iperf client has more.

By default, options.packet_number is not set, and the actual value used during an iperf client test is computed based on bandwidth, duration, and buffer_length. This is used for most tests.

Similarly, results can be displayed using iperf get results help.

> iperf get results help
[csu ] results.json                     Last test result in json format
[csu ] results.text                     Last test result in text format