Skip to content

config.ini Scripts

The NanoVNA-H can execute shell commands from a config.ini file on the SD card at startup. This allows you to automate settings, create custom configurations, and set up the device for specific measurement tasks.

When the NanoVNA-H boots with an SD card containing config.ini:

  1. The file is read line by line
  2. Each line is executed as a shell command
  3. Commands run in order, top to bottom
  4. The device continues to normal operation
  1. Create a text file named config.ini on your computer
  2. Add shell commands, one per line
  3. Copy the file to the root of the SD card
  4. Insert SD card and power on the NanoVNA-H
# Set frequency range
sweep 144000000 148000000
# Set 201 sweep points
sweep start 144000000
sweep stop 148000000
# Enable marker 1
marker 1 on
# Set trace 0 to SWR
trace 0 swr
# VHF antenna setup
sweep 144000000 148000000 201
trace 0 swr
trace 1 logmag
trace 2 smith
trace 3 off
# Enable marker search
marker 1 on
# Set scale
trace 0 scale 1
trace 0 refpos 0
# Bandpass filter measurement
sweep 140000000 150000000 401
# S21 for insertion loss
trace 0 logmag 1
trace 0 scale 10
trace 0 refpos 8
# S11 for return loss
trace 1 logmag 0
# Enable filter analysis
measure filter
# LC measurement setup
sweep 1000000 100000000 201
trace 0 logmag 1
trace 1 phase 1
measure lcseries

Commands that work in config.ini (marked with CMD_RUN_IN_LOAD flag):

CommandDescription
sweepSet frequency range and points
traceConfigure trace format, channel, scale
markerEnable/position markers
recallLoad saved calibration slot
saveSave current configuration
edelaySet electrical delay
s21offsetSet S21 offset
powerSet output power level
bandwidthSet IF bandwidth
smoothSet smoothing factor
measureEnable measurement mode
configSet configuration options
tcxoSet TCXO frequency
transformConfigure time domain
colorSet display colors
pausePause sweep
resumeResume sweep
vbat_offsetAdjust battery offset
thresholdSet harmonic threshold

Lines starting with # are treated as comments:

# This is a comment
sweep 144000000 148000000
# Another comment
trace 0 swr

Display a message during startup:

# Show startup message (if supported)
msg 2000 "VHF Antenna Mode" "Loading..."

Parameters:

  • First number: Display time in milliseconds
  • First string: Message text
  • Second string: Header text (optional)
  • Invalid commands are silently ignored
  • The file continues processing after errors
  • Check command syntax if settings don’t apply

Create multiple config files for different uses:

config.ini (default, loads on startup)
antenna.ini (antenna mode - rename to config.ini when needed)
filter.ini (filter test mode)
crystal.ini (crystal measurement)
# Recall calibration slot 2
recall 2
# Set 2m band
sweep 144000000 148000000 201
# High resolution mode
sweep 1000000 900000000 401
bandwidth 100
# All traces
trace 0 logmag 0
trace 1 logmag 1
trace 2 smith 0
trace 3 phase 1
# Enable smoothing
smooth 2

If config.ini doesn’t work as expected:

  1. Verify file is named exactly config.ini (case may matter)
  2. Check file is in root directory of SD card
  3. Ensure file uses Unix or Windows line endings
  4. Test each command individually via serial console
  5. Check for typos in command names or parameters