I think I already wrote here what averaging is on the nana side. Perhaps the wrong term here is averaging.
This value affects the bandwidth in which the measurement is performed (this is not exactly what you do in your program, but it looks like)
Let’s be more specific, nana digitizes the signal for say 10 periods, this data is sent for processing for calculation. But if you take not 10 periods but 20, then the value will be calculated more accurately. If we consider this as a spectrum analyzer, then the analogy is a decrease in RBW during measurement, this reduces the noise level, but unfortunately more samples need to be taken.
So in any cases you get RAW data
>Can you replicate it?
I can test only in NanoVNA-App.
If i set 1000 points and x100 avg, then run sweep and disconnect - then Nano not hang, after reconnect i can run.
As i see nanoVNA-App reset sweep before disconnect and on sweep start (by send 18 30 00)
Here program log in this case:
10.159 tx: setting scan parameters
10.163 tx: 00 00 00 00 00 00 00 00 23 00 80 D1 F0 08 00 00 00 00 23 10 CB 41 57 00 00 00 00 00 21 20 00 04 21 22 01 00
10.166 tx: requesting 1024 points ..
10.168 tx: 18 30 00 <- Here i disconnect
11.966 tx: clearing FIFO buffer
11.969 tx: 00 00 00 00 00 00 00 00
11.972 tx: leave USB data mode
11.975 tx: 20 26 02
11.978 tx: polling - requesting hw-revision and fw-version
11.981 tx: 10 F2 10 F3 10 F4
11.984 disconnect: serial port disconnected
15.305 connect: serial port connecting ..
15.308 connect: serial port connected <-- reconnect
15.337 tx: leave USB data mode
15.340 tx: 00 00 00 00 00 00 00 00 20 26 02
15.343 tx: are you a V2 ?
15.346 tx: 0D
15.349 rx: 32 .. ACK OK
15.352 tx: requesting device variant
15.354 tx: 10 F0
15.357 rx: 02 .. DEVICE VARIANT OK
15.360 tx: requesting serial protocol version
15.363 tx: 10 F1
15.399 rx: 01 .. PROTOCOL VERSION OK
15.402 tx: requesting hw-revision and fw-version
15.405 tx: 10 F2 10 F3 10 F4
15.460 rx: 02 ..... HARDWARE REVISION
15.463 rx: 02 02 .. FIRMWARE VERSION
15.466 rx: [connected to a V2]
>Maybe it's unique to this firmware.
No i nothing change in fw related to protocol (command and data processing equal as on any V2, just added additional commands).
Test on Current version of your software, i manually set on Lite avg = 80x, run sweep on software, then disconnect (remove cable), connect cable back and reconnect, after i can run sweep as before
But if i run sweep stop it, restart. In some cases sweep not start. Also i see after restart sweep point counter (point index) not start from 0 after sweep resume after stop on 50 for example after resum it can start from 120 (not sended reset sweep?) But if disconnect in software and reconnect, sweep start from 0.
PS But then test USART connection to LiteVNA (connect to Lite over Bluetooth and WiFi), i found bugs - on low speed connection V2 does not have time to send data, and fills its buffer for measurements, as a result, it overflows and data is lost, as it is overwritten with new ones. I fixed this by pausing measurements while filling.