The chromapi command gathers all of the robot’s tools. It is used over SSH on the robot, or on your computer for simulation.

chromapi --help              # list of commands
chromapi <command> --help    # options of a command

Tip

The python -m chromapi command works too!

Warning!

On the real robot, the web app holds the motherboard’s serial port. Before using a command that talks to the motherboard, stop it via Settings › Power › Developer mode. To restart it, run sudo systemctl start chromapi@$USER, or reboot the robot.

Commands that talk to the motherboard (version, health, flash, calibrate) accept --port if it is not on the default serial port, /dev/ttyAMA0.

Overview

CommandPurpose
chromapi runStart Chromapi and its web app
chromapi simRun the simulation on its own, for scripts using backend="sim-server"
chromapi versionShow the SDK, firmware and protocol versions
chromapi healthCheck the robot’s health
chromapi reportWrite a support report
chromapi flashUpdate the motherboard firmware
chromapi motors setupSet up the servos
chromapi calibrate servosCalibrate the servo centers
chromapi calibrate imuCalibrate the IMU
chromapi gamepad pairPair a Bluetooth controller
chromapi access resetForget the web app’s access code

chromapi run

Starts the robot and its web app. On the robot, the chromapi@<user> service runs chromapi run automatically on power-up.

chromapi run          # on the robot
chromapi run --sim    # on a PC, in simulation
OptionEffect
--simSimulated robot in MuJoCo
--portApp port (5000 by default)
--hostListen address (0.0.0.0 by default)
--no-cameraDo not open the camera
--camera-indexIndex of the camera to open
--record-dirFolder for recorded videos (~/chromapi_recordings by default)
--httpServe the page over HTTP instead of HTTPS. The phone’s microphone no longer works, and traffic is readable on the network

chromapi sim

Runs the simulation on its own, on your computer. Your scripts connect to it with backend="sim-server", and can stop and restart without closing it.

chromapi sim
OptionEffect
--followThe camera follows the robot
--headlessNo window (Ctrl+C to stop the simulator)

chromapi version

Shows the SDK and firmware versions, and the protocol version each one speaks. If they differ, the command says so: one of them needs to be updated. The command returns code 1 if the versions are incompatible or if the motherboard does not respond.

chromapi health

Checks the robot without moving anything: serial port, sound card, fan, calibrations, motherboard, firmware, battery, IMU and servos. Each line is OK, WARN or FAIL, with what to do.

The command returns code 1 if a check fails. See troubleshooting.

chromapi report

Writes a support report to ~/chromapi_report_<date>.txt: versions, robot state, calibration, services and recent logs. It contains no password or network configuration, and local network addresses are masked. Attach it to your message on Discord to get help.

OptionEffect
--outputReport file path (~/chromapi_report_<date>.txt by default)

chromapi flash

Installs on the motherboard the firmware shipped with the SDK, or a .hex file of your choice.

chromapi flash
chromapi flash path/to/firmware.hex

The servos go limp during the operation: make the robot lie down first. --yes skips the confirmation.

chromapi motors setup

Assigns an ID to each servo and configures its settings automatically.

chromapi motors setup          # new servos: only one plugged in at a time
chromapi motors setup --all    # assembled robot: rewrites the settings of all 12, without changing IDs
chromapi motors setup --id 5   # the new servo (ID 1) becomes number 5, no questions asked

chromapi calibrate

chromapi calibrate servos --all            # all joints
chromapi calibrate servos --joint tl_2     # a single one
chromapi calibrate imu

calibrate servos looks for the center of each joint by moving it to its mechanical end stops.

Warning!

Before running calibrate servos, lift the robot and place it in a clear space: no leg must be able to touch anything.

calibrate imu measures the board’s tilt relative to the floor to apply a correction: place the robot on a flat floor and do not touch it.

OptionCommandEffect
--dry-runBothMeasure and display, without saving anything
--jointservosJoint to calibrate, repeatable
--yesservosSkip all confirmations
--verboseservosShow the details of each step
--step, --marginservosEnd-stop search settings, if a joint stops too early or not at all
--durationimuMeasurement duration (5 s by default)

Calibrations are saved in ~/.config/chromapi/calibration.yaml.

chromapi gamepad pair

Pairs the first Bluetooth controller found in pairing mode. Put the controller in pairing mode before running the command. --scan sets the search duration (20 s by default).

chromapi access reset

Forgets the web app’s access code: the next visitor will be able to choose a new one.