4. System Configuration using the CLI

4. System Configuration using the CLI

System Configuration using the CLI

The Smart Radio runs the Linux kernel, and many Linux utilities such as ifconfig, iw, and ip are pre-installed on the radio. Generally speaking we can divide CLI tasks that a user may wish to perform into persistent configuration changes, and on-the-fly changes or queries.

In this section, we will first discuss the UCI system, which is designed for persistent configuration changes, and afterwards we will discuss how to configure or query the device on the fly. You can SSH into the radio using these commands. 

UCI Overview

Openwrt uses the UCI system for device configuration. The user is encouraged to explore the OpenWrt documentation. Configuring the radio using the UCI system is a slow process especially for the network interface. Configuration changes survive a reboot, but the network interfaces may need to be restarted for changes to take effect, and this could take 20-30 seconds depending on the changes being made. Most of the configuration files can be found here,

root@smartradio:~# ls /etc/config/
batman-adv       diffserv         firewall         network         
openvpn_recipes  system           ucitrack         wireless
dhcp             dropbear         luci             openvpn         
rpcd             ubootenv         uhttpd

To show the current wireless configuration, type

root@smartradio:~# uci show wireless

Only the first four results are shown above. You can do this for any of the files listed. To change a setting, e.g. the wireless channel, use uci set:

root@smartradio:~# uci set wireless.radio0.channel=’10’

Changes to the configuration can be stored using

root@smartradio:~# uci commit

This change will be held in memory but will have an effect when the network settings are reloaded using

root@smartradio:~# /etc/init.d/network reload

You can list the services which can be controlled by running

root@smartradio:~# ls /etc/init.d/

Common control commands are start, stop, restart, reload, enable, and disable

On the Fly Querying and Configuration

The UCI system is the preferred system for persistent configuration of the Smart Radio. Standard Linux tools can be used to make configuration changes in real-time, or query the system state. We will only cover the basics.

1.      Getting help – Most Linux utilities have a help menu which can be access with a --help argument. The help menu typically provides list of commands and options. For example,

root@smartradio:~# iwinfo --help
        iwinfo <device> info
        iwinfo <device> scan
        iwinfo <device> txpowerlist
        iwinfo <device> freqlist
        iwinfo <device> assoclist
        iwinfo <device> countrylist
        iwinfo <device> htmodelist

        iwinfo <backend> phyname <section>

2.      There are various utilities installed which can be used to filter the output like sed, awk, grep, and tr. There is plenty of online resources on each of them. An example would be

root@smartradio:~# iw wlan0 station get 00:30:1a:4e:f3:00 | grep "signal: " | awk '{print $1" "$2" "$5}' | sed 's/signal:/RSSI=/g'

RSSI= -66 dBm

3.      Below are some commonly used utilities. Try running --help on each of them, or try running the example command.1.       

a.      ifconfig – configure/query networking information like IP addresses. Example:

                                                              i.      ifconfig br-wan

b.      ip – another tool to configure/query networking information. Example:

                                                              i.      ip a show dev br-wan

c.       iw – configure/query wireless interfaces. Examples:

                                                              i.      iw wlan0 set bitrates ht-mcs-2.4 0 #sets the bitrate to MCS0

                    ii.   iw wlan0 set bitrates ht-mcs-2.4 0 #resets the bitrate to auto

                  iii.   iw wlan0 station dump #get connection information

                    iv.   iw wlan0 set txpower fixed 2000 #Fixes the output power to 20 dBm (measured in millibels, not decibels)

                      v.   iw wlan0 set txpower auto

d. iwinf​​​o – another tool for querying/configuring wireless interfaces. Example:

i.   iwinfo wlan0 assoclist

e.      dmes​​​g – see kernel messages. No help menu.

f.        batctl – utility for querying/configuring mesh information. Example:

                                                              i.      batctl o #see nodes participating in the mesh, last seen time, the best route, and the transmit quality for each route

    • Related Articles

    • 2. System Overview

      System Overview Fig. 1 shows the default network configuration of the Smart Radio. The radios are pre-configured so that the entire Mesh Rider network acts like one big distributed Ethernet switch. Therefore, devices plugged into Mesh Rider will ...
    • Serial Interface Configuration

      Serial Interface Configuration Start with one of the hardware setups in the section above. A generic setup is shown in Figure 1. Figure 1 – Generic UART hardware connection Configuring the UART port using the GUI The GUI is strictly for configuring ...
    • 1. Introduction to the Smart Radio Configuration Guide

      Introduction The purpose of this guide is to aid in the software configuration of the Smart Radio. This guide is organized as follows. 1.      Smart Radio Settings (For all models) 2.      Model Specific Configuration 3.      System Configuration ...
    • Remote Management Guide for Smart Radio –Appendix D – Common CLI Commands

      Appendix D – Common CLI Commands This section provides commands commonly used in the Smart Radio for configuration and diagnostics. UCI The UCI system is used for configuration. Most UCI files are found at /etc/config/. This is a slow method of ...
    • 7. Centralized Configuration, ACS, and Link Recovery

      Centralized Configuration, ACS, and Link Recovery With the release of the 2022-02 update of the Mesh Rider OS comes a new Centralized Configuration utility along with automatic channel selection (ACS), and link recovery. All three features use the ...