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.
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,
To show the current wireless configuration, type
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:
Changes to the configuration can be stored using
This change will be held in memory but will have an effect when the network settings are reloaded using
You can list the services which can be controlled by running
Common control commands are start, stop, restart, reload, enable, and disable.
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
Usage:
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. iwinfo – another tool for querying/configuring wireless interfaces. Example:
i. iwinfo wlan0 assoclist
e. dmesg – 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