-
-
Notifications
You must be signed in to change notification settings - Fork 264
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 connection syntax out of date in example Measuring a 4-Port With The 1.5-Port NanoVNA V2 #1054
Labels
Comments
The current (not working) version of the data acquisition portion of the example is: import skrf
from skrf.vi import vna
# connect to NanoVNA on /dev/ttyACM0 (Linux)
nanovna = skrf.vi.vna.NanoVNAv2('ASRL/dev/ttyACM0::INSTR')
# for Windows users: ASRL1 for COM1
# nanovna = skrf.vi.vna.NanoVNAv2('ASRL1::INSTR')
# configure frequency sweep (for example 1 MHz to 4.4 GHz in 1 MHz steps)
f_start = 1e6
f_stop = 4.4e9
f_step = 1e6
num = int(1 + (f_stop - f_start) / f_step)
nanovna.set_frequency_sweep(f_start, f_stop, num)
# measure all 12 combinations of the 4-port
n_ports = 4
for i_src in range(n_ports):
for i_sink in range(n_ports):
if i_sink != i_src:
input('Connect vna_p1 -> dut_p{}, vna_p2 -> dut_p{} and press ENTER:'.format(i_src + 1, i_sink + 1))
nw_raw = nanovna.get_snp_network(ports=(0, 1)
nw_raw.write_touchstone('./data_MiniCircuits_splitter/dut_raw_{}{}'.format(i_sink + 1, i_src + 1)) The latest acquisition code doesn't have the import skrf
from skrf.vi.vna import nanovna
from skrf import Frequency
# connect to NanoVNA on /dev/ttyACM0 (Linux)
instr = nanovna.NanoVNA('ASRL/dev/ttyACM0::INSTR')
# for Windows users: ASRL1 for COM1
# instr = nanovna.NanoVNA('ASRL1::INSTR')
# configure frequency sweep (for example 1 MHz to 4.4 GHz in 1 MHz steps)
f_start = 1e6
f_stop = 4.4e9
freq = Frequency(start=f_start, stop=f_stop, npoints=1024,unit='hz')
instr.frequency = freq
# measure all 12 combinations of the 4-port
n_ports = 4
for i_src in range(n_ports):
for i_sink in range(n_ports):
if i_sink != i_src:
input('Connect vna_p1 -> dut_p{}, vna_p2 -> dut_p{} and press ENTER:'.format(i_src + 1, i_sink + 1))
s11, s21 = instr.get_s11_s21()
nw_raw = skrf.network.four_oneports_2_twoport(s11, s21, s21, s11)
nw_raw.write_touchstone('./data_MiniCircuits_splitter/dut_raw_{}{}'.format(i_sink + 1, i_src + 1)) A few questions:
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The example https://scikit-rf.readthedocs.io/en/latest/examples/metrology/NanoVNA_V2_4port-splitter.html#Measuring-a-4-Port-With-The-1.5-Port-NanoVNA-V2 is out of date and uses no longer functional syntax for operating the NanoVNA.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to be able to successfully connect to the NanoVNA. Using the syntax from the comment at the end of #901, I'm able to connect successfully as in the example below:
System
Additional context
I'll submit a PR to update this example when I get a chance. Thanks!
The text was updated successfully, but these errors were encountered: