Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NanoVNA not recognized by Python script #150

Open
0xCoto opened this issue Sep 26, 2021 · 8 comments
Open

NanoVNA not recognized by Python script #150

0xCoto opened this issue Sep 26, 2021 · 8 comments

Comments

@0xCoto
Copy link

0xCoto commented Sep 26, 2021

@edy555 @cho45 I'm trying to run the Python script, but I get

Traceback (most recent call last):
  File "/Users/user/Documents/NetworkOptimizer/./nanovna.py", line 377, in <module>
    nv = NanoVNA(opt.device or getport())
  File "/Users/user/Documents/NetworkOptimizer/./nanovna.py", line 18, in getport
    raise OSError("device not found")
OSError: device not found

Even though my NanoVNA does get recognized fine by NanoVNA-Saver, listing: /dev/cu.usbmodemDEMO1 (S-A-A-2)

Screenshot 2021-09-27 at 2 45 09 AM

Anyone faced this issue or has any idea what the issue could be? I also tried debugging using
print(device_list), and I see a difference:

NanoVNA plugged in:

[<serial.tools.list_ports_common.ListPortInfo object at 0x10d484be0>, <serial.tools.list_ports_common.ListPortInfo object at 0x10d484ca0>]

vs.
Nano VNA not plugged in:

[<serial.tools.list_ports_common.ListPortInfo object at 0x119392b80>]

Thanks in advance!

@0xCoto
Copy link
Author

0xCoto commented Sep 27, 2021

Update: I figured from the NanoVNA-Saver that it uses

VID = 0x04b4
PID = 0x0008

for the S-A-A V2 model, and although at first it seems to work, it doesn't respond. E.g. I run ./nanovna.py -C out.png and it gets stuck on capturing... without any out.png being saved of course. Perhaps there's a better Python script suited S-A-A V2 model?

@0xCoto
Copy link
Author

0xCoto commented Oct 8, 2021

@zarath - In case you have any ideas (since you seem to be familiar with the code you've written for the V2 model), I'd greatly appreciate any input as to how we could adapt this.

(My goal is to export s2p data from the VNA to my machine via Python)

@zarath
Copy link

zarath commented Oct 18, 2021

The V2 firmware doesn't support on device gui when connected to usb. Therefore it has no screenshot option.

@0xCoto
Copy link
Author

0xCoto commented Dec 18, 2021

@zarath One more thing: I've managed to get everything working and I'm able to output touchstone files, plot them etc., but I see that the |S21| values disagree between the NanoVNA alone (i.e. not connected to python/a computer) and the ones the python script is measuring.

My understanding is that once I calibrate the device (SOLT) and connect it to the computer, the python interface does not seem to pick up the latest calibration on file. Is there a simple way to either load the latest calibration on file or manually re-run the SOLT calibration again through python, or do I write something up and save each state (OPEN, SHORT, LOAD, THRU) as a separate sNp file and apply the calibration locally?

@zarath
Copy link

zarath commented Jan 4, 2022

Oh, that's of course a lot more work... V2 just delivers uncalibrated data via usb and it is requiered to do it by ones own.
An idea would be to give the script an option to read in a calibration file, which for example can be created by nanoVNA-saver

@0xCoto
Copy link
Author

0xCoto commented Jan 4, 2022

Solved with scikit-rf's calibration tool, thanks!

@Haydarjammoul
Copy link

Hello
can you share with us how you were able to solve it.
Currently blocked on trying to connect my SAA-2N via python
Thank you in advance

@0xCoto
Copy link
Author

0xCoto commented Apr 30, 2022

@Haydarjammoul I had to change my VIDPIDs to:
VIDPIDs = set([(0x0483, 0x5740), (0x04b4,0x0008)]);
so the SAA V2 device could be recognized. See: https://github.com/0xCoto/OptimizeRF/blob/main/nanovna.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants