# 모듈 참조: 명령 ## bl_update Source: [systemcmds/actuator_test](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/actuator_test) 파일에서 부트로더를 플래시하는 유틸리티 WARNING: remove all props before using this command. ### 사용법 ``` actuator_test [arguments...] Commands: set Set an actuator to a specific output value The actuator can be specified by motor, servo or function directly: [-m ] Motor to test (1...8) [-s ] Servo to test (1...8) [-f ] Specify function directly -v value (-1...1) [-t ] Timeout in seconds (run interactive if not set) default: 0 iterate-motors Iterate all motors starting and stopping one after the other iterate-servos Iterate all servos deflecting one after the other ``` ## dumpfile Source: [systemcmds/bl_update](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/bl_update) Utility to flash the bootloader from a file ### 사용법 ``` bl_update [arguments...] setopt Set option bits to unlock the FLASH (only needed if in locked state) Bootloader bin file ``` ## bsondump Source: [systemcmds/bsondump](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/bsondump) Utility to read BSON from a file and print or output document size. ### 사용법 ``` bsondump [arguments...] The BSON file to decode and print. ``` ## dyn Source: [systemcmds/dumpfile](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/dumpfile) Dump file utility. Prints file size and contents in binary mode (don't replace LF with CR LF) to stdout. ### 사용법 ``` dumpfile [arguments...] File to dump ``` ## esc_calib Source: [systemcmds/dyn](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/dyn) ### 설명 소스: systemcmds/failure ### 예 ``` dyn ./hello.px4mod start ``` ### 사용법 ``` dyn [arguments...] File containing the module [arguments...] Arguments to the module ``` ## failure Source: [systemcmds/failure](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/failure) ### 설명 Inject failures into system. ### 구현 This system command sends a vehicle command over uORB to trigger failure. ### 예 Test the GPS failsafe by stopping GPS: failure gps off ### 사용법 ``` failure [arguments...] help Show this help text gps|... Specify component ok|off|... Specify failure type [-i ] sensor instance (0=all) default: 0 ``` ## gpio Source: [systemcmds/gpio](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/gpio) ### 설명 This command is used to read and write GPIOs ``` gpio read / [PULLDOWN|PULLUP] [--force] gpio write / [PUSHPULL|OPENDRAIN] [--force] ``` ### 예 Read the value on port H pin 4 configured as pullup, and it is high ``` gpio read H4 PULLUP ``` 1 OK Set the output value on Port E pin 7 to high ``` gpio write E7 1 --force ``` Set the output value on device /dev/gpio1 to high ``` gpio write /dev/gpio1 1 ``` ### 사용법 ``` gpio [arguments...] read / GPIO port and pin or device [PULLDOWN|PULLUP] Pulldown/Pullup [--force] Force (ignore board gpio list) write GPIO port and pin Value to write [PUSHPULL|OPENDRAIN] Pushpull/Opendrain [--force] Force (ignore board gpio list) ``` ## hardfault_log Source: [systemcmds/hardfault_log](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/hardfault_log) Hardfault utility Used in startup scripts to handle hardfaults ### 사용법 ``` hardfault_log [arguments...] Commands: check Check if there's an uncommitted hardfault rearm Drop an uncommitted hardfault fault Generate a hardfault (this command crashes the system :) [0|1|2|3] Hardfault type: 0=divide by 0, 1=Assertion, 2=jump to 0x0, 3=write to 0x0 (default=0) commit Write uncommitted hardfault to /fs/microsd/fault_%i.txt (and rearm, but don't reset) count Read the reboot counter, counts the number of reboots of an uncommitted hardfault (returned as the exit code of the program) reset Reset the reboot counter ``` ## hist Source: [systemcmds/hist](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/hist) Command-line tool to show the px4 message history. There are no arguments. ### 사용법 ``` hist [arguments...] ``` ## i2cdetect Source: [systemcmds/i2cdetect](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/i2cdetect) Utility to scan for I2C devices on a particular bus. ### 사용법 ``` i2cdetect [arguments...] [-b ] I2C bus default: 1 ``` ## led_control Source: [systemcmds/led_control](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/led_control) ### 설명 Command-line tool to control & test the (external) LED's. To use it make sure there's a driver running, which handles the led_control uorb topic. There are different priorities, such that for example one module can set a color with low priority, and another module can blink N times with high priority, and the LED's automatically return to the lower priority state after the blinking. The `reset` command can also be used to return to a lower priority. ### 예 Blink the first LED 5 times in blue: ``` led_control blink -c blue -l 0 -n 5 ``` ### 사용법 ``` led_control [arguments...] Commands: test Run a test pattern on Turn LED on off Turn LED off reset Reset LED priority blink Blink LED N times [-n ] Number of blinks default: 3 [-s ] Set blinking speed values: fast|normal|slow, default: normal breathe Continuously fade LED in & out flash Two fast blinks and then off with frequency of 1Hz The following arguments apply to all of the above commands except for 'test': [-c ] color values: red|blue|green|yellow|purple|amber|cyan|white, default: white [-l ] Which LED to control: 0, 1, 2, ... (default=all) [-p ] Priority default: 2 ``` ## listener Source: [systemcmds/topic_listener](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/topic_listener) Utility to listen on uORB topics and print the data to the console. The listener can be exited any time by pressing Ctrl+C, Esc, or Q. ### 사용법 ``` listener [arguments...] Commands: uORB topic name [-i ] Topic instance default: 0 [-n ] Number of messages default: 1 [-r ] Subscription rate (unlimited if 0) default: 0 ``` ## mfd Source: [systemcmds/mft](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mft) Utility interact with the manifest ### 사용법 ``` mfd [arguments...] Commands: query Returns true if not existed ``` ## mft_cfg Source: [systemcmds/mft_cfg](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mft_cfg) Tool to set and get manifest configuration ### 사용법 ``` mft_cfg [arguments...] Commands: get get manifest configuration set set manifest configuration reset reset manifest configuration hwver|hwrev Select type: MTD_MTF_VER|MTD_MTF_REV -i argument to set extended hardware id (id == version for , id == revision for ) ``` ## mtd Source: [systemcmds/mtd](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/mtd) Utility to mount and test partitions (based on FRAM/EEPROM storage as defined by the board) ### 사용법 ``` mtd [arguments...] Commands: status Print status information readtest Perform read test rwtest Perform read-write test erase Erase partition(s) The commands 'readtest' and 'rwtest' have an optional instance index: [-i ] storage index (if the board has multiple storages) default: 0 The commands 'readtest', 'rwtest' and 'erase' have an optional parameter: [ [ ...]] Partition names (eg. /fs/mtd_params), use system default if not provided ``` ## nshterm Source: [systemcmds/nshterm](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/nshterm) Start an NSH shell on a given port. This was previously used to start a shell on the USB serial port. Now there runs mavlink, and it is possible to use a shell over mavlink. ### 사용법 ``` nshterm [arguments...] Device on which to start the shell (eg. /dev/ttyACM0) ``` ## param Source: [systemcmds/param](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/param) ### 설명 Command to access and manipulate parameters via shell or script. This is used for example in the startup script to set airframe-specific parameters. Parameters are automatically saved when changed, eg. with `param set`. They are typically stored to FRAM or to the SD card. `param select` can be used to change the storage location for subsequent saves (this will need to be (re-)configured on every boot). If the FLASH-based backend is enabled (which is done at compile time, e.g. for the Intel Aero or Omnibus), `param select` has no effect and the default is always the FLASH backend. However `param save/load ` can still be used to write to/read from files. Each parameter has a 'used' flag, which is set when it's read during boot. It is used to only show relevant parameters to a ground control station. ### 예 Change the airframe and make sure the airframe's default parameters are loaded: ``` param set SYS_AUTOSTART 4001 param set SYS_AUTOCONFIG 1 reboot ``` ### 사용법 ``` param [arguments...] Commands: load Load params from a file (overwrite all) [] File name (use default if not given) import Import params from a file [] File name (use default if not given) save Save params to a file [] File name (use default if not given) select Select default file [] File name select-backup Select default file [] File name show Show parameter values [-a] Show all parameters (not just used) [-c] Show only changed params (unused too) [-q] quiet mode, print only param value (name needs to be exact) [] Filter by param name (wildcard at end allowed, eg. sys_*) show-for-airframe Show changed params for airframe config status Print status of parameter system set Set parameter to a value Parameter name and value to set [fail] If provided, let the command fail if param is not found set-default Set parameter default to a value [-s] If provided, silent errors if parameter doesn't exists Parameter name and value to set [fail] If provided, let the command fail if param is not found compare Compare a param with a value. Command will succeed if equal [-s] If provided, silent errors if parameter doesn't exists Parameter name and value to compare greater Compare a param with a value. Command will succeed if param is greater than the value [-s] If provided, silent errors if parameter doesn't exists Parameter name and value to compare Parameter name and value to compare touch Mark a parameter as used [ []] Parameter name (one or more) reset Reset only specified params to default [ []] Parameter names to reset (wildcard at end allowed) reset_all Reset all params to default [ []] Do not reset matching params (wildcard at end allowed) index Show param for a given index Index: an integer >= 0 index_used Show used param for a given index Index: an integer >= 0 find Show index of a param param name ``` ## payload_deliverer Source: [modules/payload_deliverer](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules/payload_deliverer) ### 설명 Handles payload delivery with either Gripper or a Winch with an appropriate timeout / feedback sensor setting, and communicates back the delivery result as an acknowledgement internally ### 사용법 ``` payload_deliverer [arguments...] Commands: start gripper_test Tests the Gripper's release & grabbing sequence gripper_open Opens the gripper gripper_close Closes the gripper stop status print status info ``` ## perf Source: [systemcmds/perf](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/perf) Tool to print performance counters ### 사용법 ``` perf [arguments...] reset Reset all counters latency Print HRT timer latency histogram Prints all performance counters if no arguments given ``` ## reboot Source: [systemcmds/reboot](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/reboot) Reboot the system ### 사용법 ``` reboot [arguments...] [-b] Reboot into bootloader [-i] Reboot into ISP (1st stage bootloader) [lock|unlock] Take/release the shutdown lock (for testing) ``` ## sd_bench Source: [systemcmds/sd_bench](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/sd_bench) Test the speed of an SD Card ### 사용법 ``` sd_bench [arguments...] [-b ] Block size for each read/write default: 4096 [-r ] Number of runs default: 5 [-d ] Duration of a run in ms default: 2000 [-k] Keep the test file [-s] Call fsync after each block (default=at end of each run) [-u] Test performance with unaligned data [-U] Test performance with forced byte unaligned data [-v] Verify data and block number ``` ## sd_stress Source: [systemcmds/sd_stress](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/sd_stress) Test operations on an SD Card ### 사용법 ``` sd_stress [arguments...] [-r ] Number of runs default: 5 [-b ] Number of bytes default: 100 ``` ## serial_passthru Source: [systemcmds/serial_passthru](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/serial_passthru) Pass data from one device to another. This can be used to use u-center connected to USB with a GPS on a serial port. ### 사용법 ``` serial_passthru [arguments...] -e External device path values: -d Internal device path values: [-b ] Baudrate default: 115200 [-t] Track the External devices baudrate on internal device ``` ## system_time Source: [systemcmds/system_time](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/system_time) ### 설명 Command-line tool to set and get system time. ### 예 Set the system time and read it back ``` system_time set 1600775044 system_time get ``` ### 사용법 ``` system_time [arguments...] Commands: set Set the system time, provide time in unix epoch time format get Get the system time ``` ## top Source: [systemcmds/top](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/top) Monitor running processes and their CPU, stack usage, priority and state ### 사용법 ``` top [arguments...] once print load only once ``` ## usb_connected Source: [systemcmds/usb_connected](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/usb_connected) Utility to check if USB is connected. Was previously used in startup scripts. A return value of 0 means USB is connected, 1 otherwise. ### 사용법 ``` usb_connected [arguments...] ``` ## ver Source: [systemcmds/ver](https://github.com/PX4/PX4-Autopilot/tree/main/src/systemcmds/ver) Tool to print various version information ### 사용법 ``` ver [arguments...] Commands: hw Hardware architecture mcu MCU info git git version information bdate Build date and time gcc Compiler info bdate Build date and time px4guid PX4 GUID uri Build URI all Print all versions hwcmp Compare hardware version (returns 0 on match) [] Hardware to compare against (eg. PX4_FMU_V4). An OR comparison is used if multiple are specified hwtypecmp Compare hardware type (returns 0 on match) [] Hardware type to compare against (eg. V2). An OR comparison is used if multiple are specified hwbasecmp Compare hardware base (returns 0 on match) [] Hardware type to compare against (eg. V2). An OR comparison is used if multiple are specified ```