RAKPiOS Command Line Utility
rakpios-cli is an interactive, menu-driven tool built for RAKPiOS. It does two jobs: it manages the gateway's network connections, and it deploys IoT services from a curated list of Docker containers.
Install and Update
RAKPiOS 0.7 and later come with rakpios-cli pre-installed, so there is normally nothing to do. It lives in ~/.local/bin, which login shells put on the PATH.
On any other machine, or to upgrade an existing installation, use the remote bash execution script.
To install:
curl https://raw.githubusercontent.com/RAKWireless/rakpios-cli/main/rakpios-cli -sSf | bash -s -- --install --silent && source ~/.profile
To update:
curl https://raw.githubusercontent.com/RAKWireless/rakpios-cli/main/rakpios-cli -sSf | bash -s -- --upgrade --silent && source ~/.profile
The tool also checks for new releases of itself and of the service catalogue when it starts, and tells you when one is available.
Basic Usage
Launch it with no arguments:
rak@rakpios:~ $ rakpios-cli
Figure 1: rakpios-cli main menuThe main menu has three options: Manage networks, Deploy services, and List services. Changing network connections needs root privileges, and the service options need the current user to have access to the Docker. On RAKPiOS the rak user already has access.
To display help information, add the flag --help or -h:
rak@rakpios:~ $ rakpios-cli --help
rakpios-cli
The command line tool for RAKPiOS
USAGE:
rakpios-cli [FLAGS]
FLAGS:
-d, --debug Prints debug message
-h, --help Prints help information
-i, --install Install rakpios-cli
-u, --upgrade Upgrade rakpios-cli
-s, --silent Perform install/update silently (no user interaction)
-v, --version Prints version information
--version reports both the tool version and the version of the service catalogue installed.
Network Management
RAKPiOS uses NetworkManager for every interface. For unusual requirements you can write connection profiles by hand, as shown in the WisGate Connect Quick Start, but for ordinary Ethernet, WiFi, and LTE connections rakpios-cli is quicker and harder to get wrong.
Figure 1: rakpios-cli network menu- Ethernet: DHCP or a static address. The tool reconfigures the interface's existing connection profile rather than creating a competing one.
- WiFi: Join an existing network, or turn the gateway into an access point. Scanned networks are listed for you to pick from; leave the passphrase empty to configure an open network.
- LTE: Enter the SIM card's APN (Access Point Name) and, if the card has one, its PIN.
- The APN defines the network path for all cellular data connectivity. Each SIM card provider has its own, which can be obtained from their online portal.
- An incorrect APN results in a loss of cellular data connectivity.
You will need root privileges, or to enter your password, to change any network setting.
Do not manage networking with raspi-config. Two tools writing the same interface is how you end up with an address that comes and goes. Refer to the Tools page.
Service Management
The other half of rakpios-cli deploys and manages Docker services from a catalogue of nearly 40 containers, including LoRaWAN packet forwarders and network servers, MQTT brokers, databases, dashboards, VPNs, and home automation.
Figure 1: rakpios-cli deploy servicesDeploy service picks a service from the catalogue, lets you review and change its environment variables, and starts it. List services shows every container on the device, running or stopped, and lets you start, stop, remove, or follow the logs of any of them.
Figure 1: rakpios-cli list servicesRefer to the RAKPiOS Service Management page for the full walkthrough, the catalogue, and how Portainer fits in.
