AeroCoder Logo

Cheatsheets

PX4 Shell Commands Cheat Sheet

NSH and MAVLink shell commands for runtime inspection, module control, and debugging.

Cheat Sheet — PX4 Shell Commands

Essential NSH (NuttX Shell) and MAVLink shell commands for runtime inspection, debugging, and module control.

text

╔══════════════════════════════════════════════════════════════════════════════╗
║  SYSTEM INSPECTION                                                           ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ Command                   │ Description                                     ║
╠═══════════════════════════╪═════════════════════════════════════════════════╣
║ top                       │ Show running tasks, CPU load, stack usage       ║
║ free                      │ Display available RAM                           ║
║ uorb top                  │ List all uORB topics with publication rates     ║
║ uorb top -1               │ Single snapshot of uORB rates                   ║
║ listener <topic>          │ Print live values from a uORB topic             ║
║ listener <topic> <n>      │ Print n samples then stop                       ║
║ work_queue status         │ Show active work queue tasks                    ║
║ ver all                   │ Show firmware version, git hash, board info     ║
║ dmesg                     │ Print kernel/boot log messages                  ║
╠══════════════════════════════════════════════════════════════════════════════╣
║  MODULE CONTROL                                                              ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ <module> start            │ Start a module (e.g. mavlink start)             ║
║ <module> stop             │ Stop a module                                   ║
║ <module> status           │ Show module status                              ║
║ commander arm             │ Arm the vehicle                                 ║
║ commander disarm          │ Disarm the vehicle                              ║
║ commander takeoff         │ Initiate takeoff                                ║
║ commander land            │ Initiate landing                                ║
║ commander mode <name>     │ Switch flight mode (posctl, altctl, auto:rtl)   ║
║ navigator start           │ (Re)start the navigator module                  ║
╠══════════════════════════════════════════════════════════════════════════════╣
║  PARAMETERS                                                                  ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ param show <pattern>      │ List matching params (e.g. param show MC_*)     ║
║ param set <name> <value>  │ Change param at runtime                         ║
║ param set-default <n> <v> │ Set default value (used in airframe scripts)    ║
║ param save                │ Persist current params to flash                  ║
║ param reset_all           │ Reset all params to defaults                    ║
║ param export <file>       │ Export params to file                            ║
║ param import <file>       │ Import params from file                          ║
╠══════════════════════════════════════════════════════════════════════════════╣
║  LOGGING & FILES                                                             ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ logger start              │ Start ULog logger                               ║
║ logger stop               │ Stop logger                                     ║
║ logger status             │ Show logger status and file path                ║
║ ls /fs/microsd/log        │ List log files on SD card                       ║
║ cat /fs/microsd/etc/config│ View SD card config file                        ║
║ perf reset                │ Reset performance counters                      ║
║ perf latency              │ Show latency statistics                         ║
╠══════════════════════════════════════════════════════════════════════════════╣
║  SENSOR CALIBRATION                                                          ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ commander calibrate gyro  │ Calibrate gyroscope                             ║
║ commander calibrate accel │ Calibrate accelerometer                         ║
║ commander calibrate mag   │ Calibrate magnetometer                          ║
║ commander calibrate level │ Level horizon calibration                       ║
║ commander check           │ Run preflight checks                            ║
╚══════════════════════════════════════════════════════════════════════════════╝

Accessing the shell

System console: connect via USB to the flight controller debug port. MAVLink shell: available in QGroundControl under Analyze Tools > MAVLink Console, or via SITL terminal (pxh> prompt). SITL: the px4 process prints a shell directly. All commands above work in any of these shells.

← Previous

Key uORB Topics Cheat Sheet

Source: docs.px4.io ↗

On This Page

Cheat Sheet — PX4 Shell CommandsAccessing the shell

© 2024 AeroCoder. All rights reserved

TwitterYouTubeInstagram