Messaging (over USB-C) between nanovna and PC client - documented (or could be)?



This is somewhat prompted by a recent question about PC application function/capabilities.

Is the (USB Communications) messaging between the nanovna unit and the host PC -

1. Documented?
2. Could be documented or reverse engineered (i.e., not encrypted or obfuscated)?

If the messaging is or can be documented, that suggests some new capabilities such as headless/scripted operation in a linux host environment (something I could make use of.)

Thanks,

Dave



Hi David,
The simplest way is to read the Python source code example.
9600 bauds seems to be a right choice for USB communication speed.
Regards,
David, F4HTQ.



David,

Refer to my initial posting (a few posts back from this one) of the NanoVNA Console command listing as well as the Python sourcecode just mentioned.
That should be more than enough info to figure out how to control and extract data from the device over the USB interface.

Regards,
Larry



Hi Larry,

The NanoVNA command listing you posted is all that is needed to communicate with the NanoVNA.

I am writing an article on the NanoVNA as well as writing software to perform all the functions of the NanoVNA Sharp and more. My emphasis is on impedance calculations, checking filters, measuring crystals and equivalent circuit models. I do not care for depending on NET.framework or Python. So my software runs on old/cheap laptops running Win XP. These laptops work well in my lab environment and this low-cost VNA does a good job for me.

Regards,
George



Hi George,
I scarfed the commands by going through main.c (and a few posts here) and there is some ambiguity on how to format a few of them as well as how executing some might affect others.

If you could verify and/or notate the command list while writing your application, I'm sure others would appreciate it.

Also, there are 3 versions of nanoVNA firmware but no one has released the sources for them (that I can find) and I'm sure there may be new commands or options not listed in the original git repository. For this I'm going to go through the binaries for more info.

Thanks
Larry



Hi Larry,

You did a good job with the command list. No problems found!

Yes, there are several versions of the NanoVNA firmware. I have found that the June 12 version is the best. It fixes the problem of communication/interpolation while recalling Cal settings. Not sure how you would find commands from the binaries.

My application is running now on PC Win XP laptop. So far, I am impressed with the little NanoVNA. I have two versions, the black version (gen111.taobao.com) and the white clone (Gecko) model. Picked up the Gecko at auction for US$28. I wanted to compare the two models.

They are very similar but Taobao model seems a bit better. It has stronger type C USB connector vs micro on Gecko. Boot pads on PCB are much bigger on Taobao model. On/off switch is nicer on Taobao, with nicer feel that Gecko. Battery is larger on Taobao and the PCB looks better too, more finished. But both units seem to work. Calibration kit accessories are better on Taobao and you get a set of sma cables, thru connector and USB cable too, things not included with Gecko.

But if you have big hands/fingers you might find the units too tiny to use comfortably.

I have transferred June 12 firmware to Taobao VNA and it works well. Will do same with Gecko soon.

In next few days (or so) will be using my app to compare the impedance measuring accuracy of NanoVNA to my trusty AIM4160 impedance analyzer, which goes to 180 MHz.. As I said, this tiny little unit is amazing so far. It has already proved its worth in measuring crystals and plotting transfer functions of filters.

When measuring things like SWR for antennas in the field the handheld NanoVNA works well. Several of my antennas were found to be spot on compared to my other analyzers. But in my home lab, I like to use PC app (like NanoVNA Sharp or my own app) with the NanoVNA to measure components like coils, crystals, filters and so on.

Regards,
George



I just ordered the black unit with cables and battery and you're right, the Gecko unit is slightly inferior.
Have you found the source code repository for the June 12 versions of F/W? All I have are DFU files dated June 11.
You were lucky with the auction - several vendors have reserve bids that are almost the same as the normal selling price.

Regards,
Larry



The dates are slightly different when firmware is installed. I used the firmware dated June 11 (20190611). But when I checked the firmware info inside the NanoVNA it said June 12, so that is what I quoted to you. So we probably have used the same software. Sorry for the confusion.

Most of the NanoVNAs being sold have the older F/W. So there is the question, that many users face, of upgrading the F/W .

Yes, I was very lucky with the Gecko auction. It ended late at night with many of the other bidders probably asleep!



Hi George Could i perhaps loop in with you ... looking to build something better for Linux seems silly to double up the work if i can 'adjust' your code ... also thinking an Android app might be a nice idea for portable use (take measurements and save them to your cloud etc in the field?).

Cheers

Tim

1 Людина сподобалось це


Hi Tim

My main purpose in experimenting with the NanoVNA was to see if it could make a good impedance analyzer.

Unfortunately, results so far indicate that it does not perform well in this respect. As you probably know, a VNA can be used to measure impedance using the reflecting bridge to measure S11. Comparing results from the Nano to a professional impedance analyzer with the same SOL calibration shows substantial differences.

It did perform well measuring small inductors (1 uH ) from 50 KHz to 1 MHz. Above that frequency errors increased substantially.

There are several possible reasons for the disappointing results. We can discuss this more if you are interested.

But, because of this performance I cannot, in good conscience, release a program that misleads users by producing inferior results. If you or someone else pursues this path, please make sure you have a good impedance analyzer and some good reference components for comparison.

Regards,

George



I have commercial mismatches specified up to 4GHz with N-cnnectors (m). After calibration with the supplied SMA calset I mesured the mismatches connected via an SMA (m) to N(f) adapter.
The result was very convincing, see enclosed plot.
Ernst



Ernst,

I have done something similar. I will see if I can gather up the worse case that I have considered. A calibrated 1 dB SMA pad terminated in a short. Hence, a 2 dB return loss, a reflection coefficient of ~ 0.8

________________________________
From: nanovna-users@groups.io <nanovna-users@groups.io> on behalf of dk1vi <dk1vi@...>
Sent: Saturday, July 6, 2019 8:35 PM
To: nanovna-users@groups.io
Subject: Re: [nanovna-users] Messaging (over USB-C) between nanovna and PC client - documented (or could be)?

I have commercial mismatches specified up to 4GHz with N-cnnectors (m). After calibration with the supplied SMA calset I mesured the mismatches connected via an SMA (m) to N(f) adapter.
The result was very convincing, see enclosed plot.
Ernst



Here is a 1 dB SMA pad terminated in a short. The cal was done at the end of a SMA connector saver. The 1 dB pad connected to the saver and the pad shorted with their short SMA cal. The Gamma should be 0.87, the marker read out is ~ 0.83-to-0.85 for the most part till 900 MHz where the Gamma drops to ~ 0.8.

Alan

________________________________
From: nanovna-users@groups.io <nanovna-users@groups.io> on behalf of alan victor <avictor73@...>
Sent: Saturday, July 6, 2019 9:34 PM
To: nanovna-users@groups.io
Subject: Re: [nanovna-users] Messaging (over USB-C) between nanovna and PC client - documented (or could be)?

Ernst,

I have done something similar. I will see if I can gather up the worse case that I have considered. A calibrated 1 dB SMA pad terminated in a short. Hence, a 2 dB return loss, a reflection coefficient of ~ 0.8

________________________________
From: nanovna-users@groups.io <nanovna-users@groups.io> on behalf of dk1vi <dk1vi@...>
Sent: Saturday, July 6, 2019 8:35 PM
To: nanovna-users@groups.io
Subject: Re: [nanovna-users] Messaging (over USB-C) between nanovna and PC client - documented (or could be)?

I have commercial mismatches specified up to 4GHz with N-cnnectors (m). After calibration with the supplied SMA calset I mesured the mismatches connected via an SMA (m) to N(f) adapter.
The result was very convincing, see enclosed plot.
Ernst



On Sat, Jul 6, 2019 at 03:07 PM, alan victor wrote:


Here is a 1 dB SMA pad terminated in a short. The cal was done at the end of a
SMA connector saver. The 1 dB pad connected to the saver and the pad shorted
with their short SMA cal. The Gamma should be 0.87, the marker read out is ~
0.83-to-0.85 for the most part till 900 MHz where the Gamma drops to ~ 0.8.