CLI

The RobotHub Agent comes with a command-line interface (CLI) that allows you to interact with and manage the agent and its connected devices. This section covers the usage and available commands for the CLI.

To use the CLI, open your terminal and run the following command:

1robothub-ctl [command] [options]

bash

Replace [command] with one of the available commands described below and [options] with any applicable command-specific options.

Available Commands

CommandDescription
robothub-ctl appsProvides commands to manage installed apps.
robothub-ctl cloudProvides commands to manage agents connection to RobotHub.
robothub-ctl devicesDisplays discovered devices.
robothub-ctl logsDisplays logs from the agent process.
robothub-ctl restartRestarts the agent.
robothub-ctl startStarts the agent.
robothub-ctl startupEnables or disables automatic launch of the agent on startup.
robothub-ctl statusDisplays the status of the agent.
robothub-ctl stopStops the agent.
robothub-ctl upload-supportUploads data to help debug issues.
robothub-ctl versionDisplays the installed agent version.

Apps Subcommands

SubcommandDescription
clear-adoption-tokenDisconnects agent from RobotHub Cloud.
connectProvides instructions on adding the robot to your team.
disconnectDisconnects agent from RobotHub Cloud.
force-syncForces manual synchronization with RobotHub Cloud.
helpDisplays help for command.
listDisplays a list of running apps.
log <appId>Displays logs of the selected app.
restart <appId>Restarts the selected app.
start <appId>Starts the selected app.
stop <appId>Stops the selected app.

Bootstrap Configuration

RobotHub Agent is bootstrapped from a configuration file located at /home/robothub/agent.toml. This file is read before starting the agent and allows for customization specific to your usecase. The configuration has the following sections:

Global

1# Root directory under which agent stores all data.
2root = "/home/robothub"
3
4# What type of devices to scan for
5# Options are "rvc3-remote", "rvc3-local", "rvc2-usb", "rvc2-poe"
6scanFor = ["rvc2-usb", "rvc2-poe"]
7
8# How often to scan for devices (in milliseconds)
9scanEvery = 15000
10
11# Logging level (useful for debugging)
12logLevel = "info" # trace, debug, info, warn, error
13
14# Trust root certificates from the system trust store
15useSystemCertificateStore = true

toml

Podman (containers)

Learn more about containers here.

1[podman]
2# Enables/disables use of `robothub-ctl podman`
3allowAccessWithCli = false
4
5# Allows you to mount additional directories to all apps
6# Example: ["/opt/my-dir"]
7additionalMounts = []
8
9# Allows you to add capabilities to all apps
10# (https://man7.org/linux/man-pages/man7/capabilities.7.html)
11additionalCapabilites = []

toml

Local Web

RobotHub gives the users the ability to construct a web application to control the app and view the live stream.

1[localWeb]
2# The port on which the local web server is listening
3port = 9010
4
5# Whether or not to include
6# `Access-Control-Allow-Origin: *`
7enableCors = false
8
9# Whether or not to disable `/web-terminal`
10disableWebTerminal = false

toml

Local Broker

Devices communicate with Agent through an MQTT protocol.

1[localBroker]
2# Enables/disables verbose logging of the local MQTT broker
3# (useful for debugging)
4verbose = false
5
6# Enables/disables developer access to the local MQTT broker
7# user: developer, password: developer (full R/W access to any topic)
8allowDeveloperAccess = false

toml

Cloud

1[hub]
2# ID of the team the agent is expected to connect to
3# This makes the robot show up in the web UI as ready for adoption
4expectedTeamId = "00000000-0000-0000-0000-000000000000"

toml

Events

Learn more about events here.

1[events]
2# Percentage of disk space filled, by which agent starts deleting oldest events
3usageThreshold = 80

toml

Streaming

1[streaming]
2# Forces relay mode (TURN) for WebRTC streaming
3forceRelay = false
4
5# If you want to define your own ICE servers (TURN/STUN)
6[[streaming.additionalIceServers]]
7hostname = "google.com"
8port = 1234
9username = "test"
10password = "test"

toml

Built-in Application

Settings for the preinstalled application that runs on devices after connecting the to RobotHub.

1[builtInApp]
2# Enables/disables the built-in application
3enable = true

toml