Shell Command Overview
The NanoVNA-H provides a command-line shell interface over USB CDC (Virtual COM Port) or serial USART. This page lists all available commands with brief descriptions.
Connecting to the Shell
Section titled “Connecting to the Shell”USB Connection
Section titled “USB Connection”Connect via USB and open a serial terminal:
- Windows: Use PuTTY, Tera Term, or similar with the COM port
- Linux:
screen /dev/ttyACM0 115200orminicom - macOS:
screen /dev/tty.usbmodem*
Serial Connection
Section titled “Serial Connection”USART1 (PA9 TX, PA10 RX) at configured baud rate (default 115200).
Shell Prompt
Section titled “Shell Prompt”ch>Interactive Command Table
Section titled “Interactive Command Table” 61 commands
| Command | Description | Category | Flags |
|---|---|---|---|
scan | Perform frequency scan and output data | Sweep & Measurement | mutexbreak |
scan_bin * | Binary format frequency scan output | Sweep & Measurement | mutexbreak |
freq | Set or query center frequency | Sweep & Measurement | mutexbreakuiload |
sweep | Set sweep start/stop/center/span/points | Sweep & Measurement | mutexbreakuiload |
power | Set Si5351 output drive strength | Sweep & Measurement | load |
offset * | Set IF offset frequency | Sweep & Measurement | mutexuiload |
bandwidth | Set measurement bandwidth (sample count) | Sweep & Measurement | load |
pause | Pause sweep | Sweep & Measurement | breakuiload |
resume | Resume sweep | Sweep & Measurement | mutexbreakuiload |
cal | Perform calibration steps (open/short/load/thru) | Calibration | mutex |
save | Save calibration to flash slot | Calibration | load |
recall | Recall calibration from flash slot | Calibration | mutexbreakuiload |
trace | Configure trace format, channel, enable/disable | Trace & Marker | load |
marker | Set marker position and properties | Trace & Marker | load |
edelay | Set electrical delay compensation | Trace & Marker | load |
s21offset | Set S21 port-through offset (dB) | Trace & Marker | load |
smooth * | Set trace smoothing level | Trace & Marker | mutexbreakuiload |
transform * | Configure time domain transform | Trace & Marker | load |
config * | Set device configuration options | Configuration | mutexbreakuiload |
saveconfig | Save current configuration to flash | Configuration | load |
clearconfig | Reset configuration to factory defaults | Configuration | load |
tcxo | Set TCXO reference frequency for calibration | Configuration | load |
threshold | Set harmonic frequency threshold | Configuration | load |
vbat | Read battery voltage | Configuration | load |
vbat_offset * | Calibrate battery voltage ADC offset | Configuration | load |
color * | Set trace/UI color palette | Configuration | load |
time * | Set or read RTC date/time | Configuration | ui |
usart_cfg * | Configure serial port parameters | Configuration | mutexbreakuiload |
usart * | Send data via serial port | Configuration | mutexbreakuiload |
data | Output measured S-parameter data | Data Export | |
frequencies | Output sweep frequency list | Data Export | |
capture | Output screen capture as bitmap | Data Export | mutexbreakui |
gamma | Output raw gamma (reflection coefficient) data | Data Export | |
sample * | Output raw ADC samples | Data Export | |
dump * | Dump raw memory/register data | Data Export | mutexbreak |
measure * | Run measurement module (LC/crystal/filter/cable) | Data Export | mutexbreakuiload |
sd_list * | List files on SD card | SD Card | mutexbreakui |
sd_read * | Read/execute file from SD card | SD Card | mutexbreakui |
sd_delete * | Delete file from SD card | SD Card | mutexbreakui |
msg * | Display message on screen from SD script | SD Card | mutexbreakload |
reset | Reset the device | Debug & System | mutexbreakload |
help | List available commands | Debug & System | |
version | Show firmware version | Debug & System | |
info * | Show device information and build details | Debug & System | |
test * | Run hardware self-test | Debug & System | |
stat * | Show sweep timing statistics | Debug & System | mutex |
threads * | Show ChibiOS thread status | Debug & System | |
port * | Select audio codec input port (TX/RX) | Debug & System | load |
touchcal | Calibrate touchscreen | Debug & System | mutexbreak |
touchtest | Test touchscreen input | Debug & System | mutexbreak |
dac * | Set DAC output value | Debug & System | load |
gain * | Set codec analog gain | Debug & System | mutex |
i2c * | Raw I2C bus operations | Debug & System | mutex |
si * | Write Si5351 registers directly | Debug & System | mutex |
lcd * | LCD controller commands | Debug & System | mutex |
b * | Show/set frequency band configuration | Debug & System | mutex |
t * | Configure Si5351 timing parameters | Debug & System | mutex |
i * | Configure I2C bus timing parameters | Debug & System | mutex |
refresh * | Send screen framebuffer to PC | Debug & System | mutexbreakui |
touch * | Simulate touch press at coordinates | Debug & System | mutexbreakui |
release * | Simulate touch release | Debug & System | mutexbreakui |
Command Quick Reference
Section titled “Command Quick Reference”Sweep and Measurement
Section titled “Sweep and Measurement”| Command | Description | Page |
|---|---|---|
scan | Perform sweep, output data | Sweep |
scan_bin | Binary output scan | Sweep |
freq | Set/get CW frequency | Sweep |
sweep | Set/get sweep range and points | Sweep |
power | Set/get output power | Sweep |
bandwidth | Set/get IF bandwidth | Sweep |
pause | Pause sweep | Sweep |
resume | Resume sweep | Sweep |
Calibration
Section titled “Calibration”| Command | Description | Page |
|---|---|---|
cal | Calibration operations | Calibration |
save | Save calibration to slot | Calibration |
recall | Load calibration from slot | Calibration |
Trace and Marker
Section titled “Trace and Marker”| Command | Description | Page |
|---|---|---|
trace | Configure traces | Trace/Marker |
marker | Configure markers | Trace/Marker |
edelay | Set electrical delay | Trace/Marker |
s21offset | Set S21 offset | Trace/Marker |
transform | Time domain settings | Trace/Marker |
smooth | Data smoothing | Trace/Marker |
Configuration
Section titled “Configuration”| Command | Description | Page |
|---|---|---|
config | Get/set configuration | Configuration |
saveconfig | Save configuration to flash | Configuration |
clearconfig | Reset configuration | Configuration |
tcxo | Set TCXO frequency | Configuration |
threshold | Set harmonic threshold | Configuration |
vbat | Read battery voltage | Configuration |
vbat_offset | Set battery offset | Configuration |
color | Set display colors | Configuration |
usart | Serial console control | Configuration |
usart_cfg | Serial port configuration | Configuration |
time | RTC date/time | Configuration |
touchcal | Touch screen calibration | Configuration |
touchtest | Touch screen test | Configuration |
Data Export
Section titled “Data Export”| Command | Description | Page |
|---|---|---|
data | Output measured data | Data Export |
frequencies | Output frequency list | Data Export |
capture | Screen capture (binary) | Data Export |
dump | Dump raw ADC samples | Data Export |
measure | Measurement results | Data Export |
SD Card
Section titled “SD Card”| Command | Description | Page |
|---|---|---|
sd_list | List SD card files | SD Card |
sd_read | Read SD card file | SD Card |
sd_delete | Delete SD card file | SD Card |
Debug and System
Section titled “Debug and System”| Command | Description | Page |
|---|---|---|
info | Device information | Debug |
version | Firmware version | Debug |
help | List commands | Debug |
reset | Reset device | Debug |
threads | Thread info (debug) | Debug |
Remote Desktop
Section titled “Remote Desktop”| Command | Description | Page |
|---|---|---|
refresh | Get screen data | Debug |
touch | Simulate touch | Debug |
release | Simulate touch release | Debug |
Command Flags
Section titled “Command Flags”Commands have execution flags that control when they can run:
| Flag | Description |
|---|---|
CMD_WAIT_MUTEX | Must run in sweep thread with mutex |
CMD_BREAK_SWEEP | Interrupts ongoing sweep |
CMD_RUN_IN_UI | Can run while UI is processing |
CMD_RUN_IN_LOAD | Can run from SD card script |
Complete Command List
Section titled “Complete Command List”All commands available in firmware v1.2.44:
scan scan_bin data frequencies freq sweep power bandwidthtime sd_list sd_read sd_delete saveconfig clearconfig dumptouchcal touchtest pause resume cal save recall trace markeredelay s21offset capture measure refresh touch release vbattcxo reset smooth config usart_cfg usart vbat_offset transformthreshold help info version colorShell Syntax
Section titled “Shell Syntax”General Format
Section titled “General Format”command [arg1] [arg2] [arg3] [arg4]Maximum 4 arguments, 64 characters per line.
Frequency Format
Section titled “Frequency Format”Frequencies can be entered as:
- Plain number:
1000000(1 MHz) - With k suffix:
1000k(1 MHz) - With M suffix:
1M(1 MHz) - With G suffix:
1.5G(1.5 GHz)
Numeric Arguments
Section titled “Numeric Arguments”- Integers:
101,4000 - Floats:
1.5,-3.2 - Hex:
0xFF
Example Session
Section titled “Example Session”ch> infoBoard: NanoVNA-H2019-2025 Copyright NanoVNA.comVersion: 1.2.44
ch> sweep 1M 100M 101ch> cal opench> cal shortch> cal loadch> cal donech> save 0ch> data 00.001234 0.0056780.001245 0.005689...ch> pausech> resumeSource Code Reference
Section titled “Source Code Reference”Command definitions are located in:
- Command table:
main.clines 2912-3033 - Command implementations:
main.c(various locations) - Shell processing:
main.clines 3050-3200