Author Topic: NanoVNA V2 aka S-A-A-2  (Read 98466 times)

0 Members and 1 Guest are viewing this topic.

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #375 on: March 22, 2021, 02:02:09 am »
I have had the same experience with LNAs. either you use a good shield, well grounded at the points bwhere cables go through or no shieding. Half assed shielding often creates problems from stray resonances.
My nanoVNA is flat to a bit over 3GHz, and there are some small bumps between 3 and 4.4 GHz. Not big ones. I use good quality cables.
« Last Edit: March 22, 2021, 02:05:43 am by cdev »
"What the large print giveth, the small print taketh away."
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 416
  • Country: us
Re: NanoVNA V2 aka S-A-A-2
« Reply #376 on: March 22, 2021, 04:55:33 am »
I've got something wanky going on with my NanoVNA S-A-A-2 when I plug in a USB cable. Picture noUSB.JPG shows a highpass filter. When I plug in the USB cable (usb.JPG) there is a thing going on at 3.88 GHz. Without USB connected, and doing a good cal, measurements seem to correlate with my HP VNAs. If I could read the data, then I could show you how well they correlate, but I can't. I just got this thing, and I find it frustrating that I can't make a measurement, then plug in a USB and read the data. It reads the uncorrected data. Why, why, why?  |O The software that's written (all that I've seen) want you to set up the measurement with the software if you want to save the data. But plugging in a USB adds crap to the unit's operation (at least mine, with this computer).
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: NanoVNA V2 aka S-A-A-2
« Reply #377 on: March 22, 2021, 07:09:52 pm »
My understanding is that the USB data are generally not subject to the calibration which was done in the firmware, but a PC appplication has to handle all the calibration stuff itself at application level. Both, the NanoVNA Saver and the NanoVNA-Qt app obviously do that. I.e. you calibrate in the application, and then you do the measurements in the application, and the error terms calculated by the application are not shared with the fimware (and vice versa).

EDIT: My NanoVNA even reboots quite frequenty upon connecting/disconnecting USB while the NanoVNA is turned.
« Last Edit: March 22, 2021, 07:51:20 pm by gf »
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #378 on: March 22, 2021, 07:39:47 pm »
I've got something wanky going on with my NanoVNA S-A-A-2 when I plug in a USB cable. Picture noUSB.JPG shows a highpass filter. When I plug in the USB cable (usb.JPG) there is a thing going on at 3.88 GHz. Without USB connected, and doing a good cal, measurements seem to correlate with my HP VNAs. If I could read the data, then I could show you how well they correlate, but I can't. I just got this thing, and I find it frustrating that I can't make a measurement, then plug in a USB and read the data. It reads the uncorrected data. Why, why, why?  |O The software that's written (all that I've seen) want you to set up the measurement with the software if you want to save the data. But plugging in a USB adds crap to the unit's operation (at least mine, with this computer).

Between 3 and 4.5 GHz there are some peaks. See if the lump you see maps to one of them. It probably does. Thats why you calibrate your VNA, to remove the effects resonances, cable lengths etc. have.

Its always best to save the raw data in its original form, otherwise various rounding errors, and approximations add up. But the way a VNA works does a good job of compensating for the usual discontinuities in the Force, so to speak, when they lie after the calibration plane. .
« Last Edit: March 22, 2021, 07:49:46 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 416
  • Country: us
Re: NanoVNA V2 aka S-A-A-2
« Reply #379 on: March 22, 2021, 08:04:05 pm »
...
Its always best to save the raw data in its original form, otherwise various rounding errors, and approximations add up.

Normally in a measurement instrument, what is displayed is corrected data, and that is what you record. I don't know of any of my instruments (power meters, spectrum analyzers, VNAs, DMMs, vector signal analyzers, modulation analyzer, oscilloscopes) for which I'm interested in reading and saving uncorrected data. I'm disappointed that I can't get to the corrected data that I see on the NanoVNA display, and that if I plug in USB to use one of the software tools I see issues with USB interference. It is going to take some work (either hardware or software) to be able to save good corrected NanoVNA data. Right now I can't (without having USB interference).
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #380 on: March 22, 2021, 10:45:40 pm »
ask user @joeeqsmith , he is working on custom labview compatible software for the nanovna2. Chances are he's dealt with the exact same problem you have.
"What the large print giveth, the small print taketh away."
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #381 on: March 22, 2021, 10:50:04 pm »
When you plug it into the PC it switches to PC mode. SO likely there is a script which runs then to launch the proper changes, load the proper modules, etc. Mine starts behaving a bit strangely when its plugged into USB too. it sweeps continually, over and over. It draws the smith chart .

If I launch the software manually as root it works fine. If its not running as superuser, I get a screen with blank places that don't work properly.

.
My understanding is that the USB data are generally not subject to the calibration which was done in the firmware, but a PC appplication has to handle all the calibration stuff itself at application level. Both, the NanoVNA Saver and the NanoVNA-Qt app obviously do that. I.e. you calibrate in the application, and then you do the measurements in the application, and the error terms calculated by the application are not shared with the fimware (and vice versa).

EDIT: My NanoVNA even reboots quite frequenty upon connecting/disconnecting USB while the NanoVNA is turned.
« Last Edit: March 22, 2021, 10:52:27 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: NanoVNA V2 aka S-A-A-2
« Reply #382 on: March 22, 2021, 11:18:28 pm »
It always sweeps continuously, regardless whether running standalone or controlled from PC software.
Indeed, when the PC software connects to the NanoVNA, the display gets black and shows "USB MODE". Standalone operation is no longer possible then.
(At least this applies to the V2. I don't know wheter it also applies to the original NanoVNA)

On Linux there is a permission problem with ttyACM0:

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Mär 22 23:59 /dev/ttyACM0

So in order to get access to the USB serial port, your user ID needs to belong to the group dialout (or you need to run NanoVNA-Saver/NanoVNA-QT as root).
Alternatively, it were certainly possible to configure some udev rules which assign 0666 permissions to /dev/ttyACM0, but I did not spend time to figure out how to do that exactly.
« Last Edit: March 22, 2021, 11:21:15 pm by gf »
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11934
  • Country: us
Re: NanoVNA V2 aka S-A-A-2
« Reply #383 on: March 23, 2021, 11:53:06 am »
I've got something wanky going on with my NanoVNA S-A-A-2 when I plug in a USB cable. Picture noUSB.JPG shows a highpass filter. When I plug in the USB cable (usb.JPG) there is a thing going on at 3.88 GHz. Without USB connected, and doing a good cal, measurements seem to correlate with my HP VNAs. If I could read the data, then I could show you how well they correlate, but I can't. I just got this thing, and I find it frustrating that I can't make a measurement, then plug in a USB and read the data. It reads the uncorrected data. Why, why, why? |O The software that's written (all that I've seen) want you to set up the measurement with the software if you want to save the data. But plugging in a USB adds crap to the unit's operation (at least mine, with this computer).

ask user @joeeqsmith , he is working on custom labview compatible software for the nanovna2. Chances are he's dealt with the exact same problem you have.


Sorry, I don't have any information on the S-A-A-2.   There are some good groups for the Nano.  Maybe there is one specific to the model you have.  I suggest joining them.   

...
Its always best to save the raw data in its original form, otherwise various rounding errors, and approximations add up.

Normally in a measurement instrument, what is displayed is corrected data, and that is what you record. I don't know of any of my instruments (power meters, spectrum analyzers, VNAs, DMMs, vector signal analyzers, modulation analyzer, oscilloscopes) for which I'm interested in reading and saving uncorrected data. I'm disappointed that I can't get to the corrected data that I see on the NanoVNA display, and that if I plug in USB to use one of the software tools I see issues with USB interference. It is going to take some work (either hardware or software) to be able to save good corrected NanoVNA data. Right now I can't (without having USB interference).

That last sentence makes me wonder, how do you plan to save data from the S-A-A-2 without using USB?  Do you have the slot for a memory card or some other means?   I just use the USB and PC.   

In the case of the V2Plus/4 once you connect to the USB port, everything is uncorrected.  It's up to the software to do the heavy lifting.   At that time, the display, buttons, touchscreen are all disabled.   Your S-A-A-2 sounds more like the original NanoVNA I have.   The peripherals all remain enabled and you can send corrected data if you want.

Offline gf

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: NanoVNA V2 aka S-A-A-2
« Reply #384 on: March 23, 2021, 01:42:24 pm »
In the case of the V2Plus/4 once you connect to the USB port, everything is uncorrected.  It's up to the software to do the heavy lifting.   At that time, the display, buttons, touchscreen are all disabled.   Your S-A-A-2 sounds more like the original NanoVNA I have.   The peripherals all remain enabled and you can send corrected data if you want.

Mine is a V2_2 (likely a Chinese clone, though). On the case it is labeled "S-A-A V2".
Everything gets disabled as well, when a PC app connects via USB to the device.
Firmware for my V2_2 is IMO the same as for the Plus4 model - just compiled with different options.
[ I did compile the latest version of the firmware source code from GitHub for my Nano and it seems works fine. ]
« Last Edit: March 23, 2021, 01:54:11 pm by gf »
 

Offline dougg

  • Regular Contributor
  • *
  • Posts: 73
Re: NanoVNA V2 aka S-A-A-2
« Reply #385 on: March 23, 2021, 02:57:31 pm »

On Linux there is a permission problem with ttyACM0:

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Mär 22 23:59 /dev/ttyACM0

So in order to get access to the USB serial port, your user ID needs to belong to the group dialout (or you need to run NanoVNA-Saver/NanoVNA-QT as root).
Alternatively, it were certainly possible to configure some udev rules which assign 0666 permissions to /dev/ttyACM0, but I did not spend time to figure out how to do that exactly.

Stay away from udev rules if you can. The simple way, is to edit /etc/group (as root) and add your user name to the dialout line:

dialout:x:20:dougg

The terminal you are in then needs to be restarted to pick that up. The "id" command will show the groups that the current user belongs to.
Many user access to devices issues can be fixed with this technique.
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #386 on: March 23, 2021, 05:49:48 pm »
Strange but I was already in the dialout group (and had this problem) and it was nanovna-saver not nanovna_qt that works without my having to become a superuser to run it.


On Linux there is a permission problem with ttyACM0:

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Mär 22 23:59 /dev/ttyACM0

So in order to get access to the USB serial port, your user ID needs to belong to the group dialout (or you need to run NanoVNA-Saver/NanoVNA-QT as root).
Alternatively, it were certainly possible to configure some udev rules which assign 0666 permissions to /dev/ttyACM0, but I did not spend time to figure out how to do that exactly.

Stay away from udev rules if you can. The simple way, is to edit /etc/group (as root) and add your user name to the dialout line:

dialout:x:20:dougg

The terminal you are in then needs to be restarted to pick that up. The "id" command will show the groups that the current user belongs to.
Many user access to devices issues can be fixed with this technique.
"What the large print giveth, the small print taketh away."
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 416
  • Country: us
Re: NanoVNA V2 aka S-A-A-2
« Reply #387 on: March 23, 2021, 06:45:00 pm »
... That last sentence makes me wonder, how do you plan to save data from the S-A-A-2 without using USB? ...

I don't know yet. When I bought this thing I wasn't planning on it being a project. I don't have time (or need) for this project right now.

Solutions would be either:
1. figure out USB interference, fix it, and use nanovna-saver
2. modify firmware to let me stop sweep, then plug in USB and get corrected data
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: NanoVNA V2 aka S-A-A-2
« Reply #388 on: March 23, 2021, 06:59:00 pm »
An easy and informative way to save captured data quickly is to just take a screenshot of the appropriate output.

Most of the data files contain array structures like CSV or JSON so they are easy to convert from one form to another.

They probably can be copied and pasted into a spreadsheet or text editor to get the data out..
"What the large print giveth, the small print taketh away."
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: NanoVNA V2 aka S-A-A-2
« Reply #389 on: March 23, 2021, 07:32:12 pm »
An easy and informative way to save captured data quickly is to just take a screenshot of the appropriate output.

So far, I did not pay attention to nanovna.py. Playing around with this script I noticed that it is possible to grab screenshots from the NanoVNA over USB (nanovna.py -C screenshot.png), without entering USB measurement mode (where the display turns black, and buttons and touchscreen are disabled).
 

Offline rfclown

  • Frequent Contributor
  • **
  • Posts: 416
  • Country: us
Re: NanoVNA V2 aka S-A-A-2
« Reply #390 on: March 23, 2021, 11:43:13 pm »
An easy and informative way to save captured data quickly is to just take a screenshot of the appropriate output.

So far, I did not pay attention to nanovna.py. Playing around with this script I noticed that it is possible to grab screenshots from the NanoVNA over USB (nanovna.py -C screenshot.png), without entering USB measurement mode (where the display turns black, and buttons and touchscreen are disabled).

This looks interesting. I don't do Python, but I just tried downloading it on my Windows 10 machine. Following the Readme.md file, I did the pip3 install -r requirements.txt. So far so good. upgraded pip because it suggested so. When I try the first example "nanovna.py -p" I get:

C:\nanoVNA\python>nanovna.py -p
Traceback (most recent call last):
  File "C:\nanoVNA\python\nanovna.py", line 2, in <module>
    import serial, tty
  File "C:\Users\TD\AppData\Local\Programs\Python\Python39\lib\tty.py", line 5, in <module>
    from termios import *
ModuleNotFoundError: No module named 'termios'

I assume it's because I'm not in linux, and the "tty" isn't associated with my COM port. Or is it because I needed to install another module (termios)? Perused the nanovna.py file, but it's not obvious how to edit this for a Windows COM port. Maybe I need to edit the VIDPIDs? Looks like it's supposed to find the COM port automatically.

When one of my kids had a python class in school a few years ago, I got the book and thought I'd learn along with him. I realized that I'd rather gnaw my arm off than use python (no offense to anyone here who likes python).

The image capture code has:
        self.serial.write([0x20, 0xee, 0x00])
        meta = self.serial.read(2 + 2 + 1)
       
which is writing 0 to register ee, which I don't see specified in the User Manual. The read (0x20) command isn't supposed to return anything, so I don't know what the self.serial.read(2+2+1) is supposed to be doing.

When I send 0x20 0xee 0x00 in a terminal program, it doesn't respond with anything (like the User Manual says). i have 20200926 firmware
« Last Edit: March 24, 2021, 12:01:17 am by rfclown »
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1342
  • Country: de
Re: NanoVNA V2 aka S-A-A-2
« Reply #391 on: March 24, 2021, 09:29:13 am »
Yes, "termios" is a Unix (POSIX) specific interface.
Register 0xee is indeed not documented, but at least in the latest revision of the firmware in Git it is obviously implemented in main2.cpp. Here you can also see the data format sent back.

Code: [Select]
static void cmdRegisterWrite(int address) {
        if(address == 0xee) {
                usbCaptureMode = true;
#pragma pack(push, 1)
                constexpr struct {
                        uint16_t width;
                        uint16_t height;
                        uint8_t pixelFormat;
                } meta = { LCD_WIDTH, LCD_HEIGHT, 16 };
#pragma pack(pop)
                serial.print((char*) &meta, sizeof(meta));

                // use uint16_t ili9341_spi_buffers for read buffer
                static_assert(meta.width * 2 <= sizeof(ili9341_spi_buffers));
                for (int y=0; y < meta.height; y+=1){
                        ili9341_read_memory(0, y, meta.width, 1, ili9341_spi_buffers);
                        serial.print((char*) ili9341_spi_buffers, meta.width * 2 * 1);
                }

                usbCaptureMode = false;
                return;
        }

        [...]
« Last Edit: March 24, 2021, 11:25:36 am by gf »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf