nanoVNA shell command usage

most important

threshold or clearconfig cannot be invoked by touchscreen
clearconfig 1234
Really required after firmware installations,
and recommended if behavior is flakey, e.g. bad calibrations.
saveconfig
wanted after e.g. offset, color, vbat_offset, touchcal and threshold. Otherwise,
those changes are lost at reboot, which occurs e.g. by unplugging USB
touchcal
required after saveconfig and otherwise for flakey touchscreen response
touchtest
verify touchcal
threshold 300000000
reduce frequency at which nanoVNA switches to harmonics.
Values larger than 300000000 are not accepted.
Some devices display artifacts for 300000000 threshold.

more often

useful during typical operation
marker
reports current marker configuration
or sets one marker configuration

trace
sets / reports format, channel, display gain and offset for enabled traces

sweep
set recurring start Hz, stop Hz, 1 to 101 points
1 point renders freq command pointless

transform - relevant to trace delay format
Usage: transform {on|off|impulse|step|bandpass|minimum|normal|maximum} [...]

recall
restores values for corresponding save

save
Saves calibration data as well as setting for sweep, trace, marker.
'save 0' is automatically restored at power on/reboot.
The number of saved configurations varies among firmware versions.

color - customize trace colors
click for details
Returns the following with no parameters:
ch> color
usage: color {id} {rgb24}
 -3: 0x77EFBF
 -2: 0xFFFFFF
 -1: 0x878387
 0: 0xFFE31F
 1: 0x00BFE7
 2: 0x1FE300
 3: 0xE7079F
NOTE: Colour parameters need to be entered with ‘0x’ hex prefix:
Example: color 3 0xffffff (This turns trace 4 from purple to white)
Refer to this post: https://groups.io/g/nanovna-users/message/5914
** Only with QRP’s v0.4.2 and higher firmware release
Examples: if you want to change track colors, just use the following commands:
color 0 0xFF0000
 it will change TRACE 0 color to red (web color #FF0000)
color 1 0x00FF00
 will change TRACE 1 color to green (web color #00FF00)
color 2 0x0000FF
 will change TRACE 2 color to blue (web color #0000FF)
color 3 0x808080
 will change TRACE 3 color to gray (web color #808080)
color -1 0xFFFFFF
 will change grid color to white (web color #FFFFFF)
You can play with it and at any time, you can revert colors back just with power off and power on.
If you want to store selected colors permanently, you need to use menu CONFIG => SAVE

vbat
Battery millivolts, provided D2 = 1N4148

cal - alternative to CH0, CH1 calibration by touchscreen
Usage: cal [load|open|short|thru|isoln|done|reset|on|off|in|data]
After calibration, use the save command to save it
in i interpolates for save / restore i
data returns cal_data[0]

tricky

Standalone use is generally counterproductive;
more likely wants app or script invocation:
edelay
impacts calibrations
frequencies
dumps a column of Hz values for current sweep
or (if paused) latest scan or scanraw
data
dumps columns of S11 or S21 in-phase and quadrature (AKA real & imaginary) values corresponding to frequencies; combining these yields .s1p or .s2p Touchstone files.
click for details
example: data
 produces columns of data points according to sweep / scan / scanraw / sample:
0.999902069 -0.003914059
0.999517679 -0.003805434
0.999603867 -0.003855689
0.999514162 -0.004347831
...up to:
0.998815953 -0.006629021
0.997710704 -0.006602317
0.998088240 -0.006423361
0.998069703 -0.006385779
0.998046994 -0.006417039
NOTE: Left & right columns above - the Real part and the Imaginary part, respectively, of the reflection coefficient.
Reading Calibration Data:
The current firmware (edy555-0.2.2) allows dumping the internal calibration
table with the data command:
data [0-6] Where: 0: S11
1: S21
and
2: /* error term directivity */
3: /* error term source match */
4: /* error term reflection tracking */
5: /* error term transmission tracking */
6: /* error term isolation */ 
pause
suspends current sweep; required for data from e.g scan or scanraw
resume
undo pause, back to latest sweep
scanraw - uncalibrated CH0 and/or CH1 values using QRP firmware
click for details
From the NanoVNA’s console interface:
ch> scanraw
usage: scanraw {channel(0|1)} {start(Hz)} {stEp(Hz)} {step-count} [average]
The 'scanraw' command is similar to the 'scan' command,
 which allows you to perform measurements for an unlimited number of points.
 However, 'scanraw' also specifies CH0 or CH1
 along with a user-specified number of points to average - up to 1000x.
NOTE: As with the ‘scan’ command (see depreciated commands section),
 the 'scanraw' command returns raw measured values with no calibration applied
 so you will need to apply your own calibration corrections to the results.
Example: The following command will return S11 measurements
 (with no calibration applied) from 50 kHz to 10.050 MHz with 1 kHz step (10000 points)
 and with 5x averaging:
scanraw 0 50000 1000 10000 5
where:
0 - channel CH0 (S11)
50000 - starting frequency (Hz)
1000 - frequency per step (Hz) 100Hz minimum**
10000 - total number of steps/points
5 = number of times to average each step;  more is not appreciably better
scan
broken in some firmware, otherwise similar to sweep, but only runs once
port
selects tlv320aic3204 DSP port; 0=CH0, 1=CH1 for sample or scan
vbat_offset
compensate for installing the wrong diode as D2
Should be 0 or some number of millivolts based on measurement
that could easily too result in damage.
capture
dumps touchscreen bitmap; wants an app or script to capture and convert for viewing

avoid

unless you already know enough to use these...
gain
tlv320aic3204 DSP left and right gains 0-95
offset - default is 5000 Hz
AKA Intermediate Frequency (IF); difference between SI5351 stimulus and LO
Increasing to 12000 increases performance, according to Erik
Recalibrate after changing this.
power
Si5351A clock generator output 0-3; power -1 default automatically adjusts based on frequency.
power 1 improves results, according to Erik
Recalibrate after changing this.
sample
switches data results from gamma (default) to absolute ADC value for ref or ampl,
which is CH0 or CH1, depending on port
stat
processor status (for debugging)
threads
firmware currently executing (for debugging)

really avoid

basically useless:
dac
sets STM32 micro analog out value; probably not connected..
dump
ADC output of SA602 mixers
exit
restarts nanoVNA shell; if it works, then probably not needed
freq
set CW frequency, redundant to sweep with single step
reset
restarts nanoVNA; if it works, then probably not needed
test
either ignored or hangs nanoVNAs
time
useless