Replies: 8 comments 4 replies
-
This sounds confusing and I can not quite follow it.
Not sure what you mean by "upload". Do you mean you want to retrieve the data from the LibreVNA? And when is this calibration applied? I don't see anything related to the calibration in your program. Do you run the program once before loading the calibration (manually through the GUI) and everything works but when you run your program again after loading the calibration you do not get the data?
Did you check these issues related to the touchstone command? #101 and #108 Do you see data in the graphs of the GUI after loading the calibration?
I find that hard to believe. There is nothing being stored persistently on the device that is related at all to the calibration. Even if you run into issues with loading the calibration, you should be able to power cycle the LibreVNA and restart the GUI to get back to the same state you had before loading the calibration. Are you sure that the problem only reverts once you flash the firmware again? |
Beta Was this translation helpful? Give feedback.
-
Thank you for helping. I am confused by myself, so probably my answers are not fully aligned. |
Beta Was this translation helpful? Give feedback.
-
Okay, but can you describe exactly what you are doing? My understanding at the moment is this:
Not sure if this is all correct. After this, I am getting really confused:
I am sure that at least some steps are missing or I understood them wrong. Especially the update fixing the issue makes no sense at all. So please write me a list like this, listing every single action you perform in the GUI and attach your program. I must be able to replicate the exact same procedure without having to guess what you did exactly or in what order. |
Beta Was this translation helpful? Give feedback.
-
How can they confuse you, you are the one performing them? I am not talking about confusing results, that can obviously happen. But you must know what you are doing. So can you please write a list (in your own) words what exactly you are doing and what results you are getting from your program? Broken down into as many details as you can. I'd be happy with a description of every single button press or mouse click if necessary. Alternatively, a screen capture video might also work. I am absolutely still not sure what you are doing and I also do not know how I can make it any more clear that your description so far is not sufficient for me to understand it. And if I don't know the precise steps, I can't even start to think about helping with the problem. You seem to be able to repeat the problem at least some of the time. This is good and I would like to do the same.
Power cycle the LibreVNA and restart the GUI. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I am confused in the sense that I am not sure what exact steps I did after steps 1-5. I played with it a lot and can't be sure anymore. Therefore, I will repower the device and repeat steps 1-5 trying to recreate the problem. I will report you then. |
Beta Was this translation helpful? Give feedback.
-
Answer to this reply: Perfect, I can reproduce that as well. I got confused earlier because I asked "Do you see data in the graphs of the GUI after loading the calibration?" and the only thing I could interpret as a reply to this was "When I try to use LibreVNA-GUI I can see traces updating." Which is not true at the time when your script does not return data anymore. Also, nothing in your steps refers to any calibration which you mentioned in the original post and which also really confused me. If you had provided this list of steps from the beginning, it would have been a really easy thing to solve. Anyway, lets get into the issue. Here is what I see when I replicate your steps (and yes, this is the level of detail that I would ideally like from you):
Okay, looks like the same problem you are reporting. Now lets look at your script in more detail: # Set up the sweep parameters
send_scpi_command(":DEV:MODE VNA")
send_scpi_command(":VNA:SWEEP FREQUENCY")
send_scpi_command(":VNA:ACQ:IFBW 10000")
send_scpi_command(":VNA:ACQ:AVG 1")
send_scpi_command(":VNA:ACQ:POINTS 201")
send_scpi_command(":VNA:FREQuency:START 4000000000")
send_scpi_command(":VNA:FREQuency:STOP 6000000000") All good, the sweep is configured now. Next you want to capture four consecutive sweeps and print the data from them: # Sweeps loop
for n in range(4):
send_scpi_command(":VNA:ACQuisition:SINGLE TRUE")
# Wait for the sweep to finish
while query_scpi_command(":VNA:ACQ:FIN?") == "FALSE":
time.sleep(0.1)
# Grab the data of trace S11
npts = int(query_scpi_command(":VNA:ACQ:POINTS?")) + 1
tmp = query_scpi_command(":VNA:TRACE:TOUCHSTONE? S11")
print(npts)
print(tmp) You start the sweeps by enabling single sweeps. The programming guide has this to say about it:
Okay, setting VNA:ACQ:SINGLE to TRUE is a valid way to trigger a new sweep. After triggering a new sweep, you wait for it to finish and then grab the data. Everything is working and you also report that you are getting the data in your step 1. Then you perform step 2. You disconnect the device. You mention that you do that
I can't quite follow the logic here. You just used your script successfully in step 1 while the device was connected. And now you think you have to disconnect the device to use your script? But okay, sure, you can disconnect your device at this point if you want to. And now comes step 3. Well, yes: if you want to get data from the device, please leave it connected!Alternatively you can disconnect it and still read the old data but in this case please do not trigger a new sweep (which will clear all old data first) Honestly, I am struggling to understand the logic here. And yes, I get that there is a learning curve to the software and you are new to it. But helping here has been soooooo annoying for me. Not only has the calibration nothing to do with the problem at all (which really pointed me in the wrong direction). I also had to pull every single fact out of you by asking multiple times. And all that time you did not mention a single time that you are trying to run your script while the device is disconnect (which is the whole problem. How do you expect to get new data?) So please excuse the sarcasm and overall annoyed tone in this reply. That is not my usual way of handling questions. And please also do not hesitate to create new discussions/issues in the future. The LibreVNA is a passion project of mine and I love helping people use it and the feedback I get is also very helpful for improving the software. But also understand that I just spent a significant amount of time trying to understand your problem and getting all the information. This honestly feels as if you intentionally kept the one crucial detail from me that would explain everything immediately (I know it wasn't intentional but it sure feels like it was). For future problems: Give me a detailed step-by-step guide on how to reproduce the problem in your first post. With way, way more details than here. It is my job to help with these things. It is your job to provide clear and unambiguous descriptions of what you are doing. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Jan. |
Beta Was this translation helpful? Give feedback.
-
Sure, please report if you find other problems. Maybe this helps with clearing up some confusion: your script is never communicating with the LibreVNA directly. It is communicating with the GUI and the GUI in turn is communicating with the device. So as soon as you disconnect the device in the GUI, that connection is gone. Your script can still communicate with the GUI but if you ask the GUI to start a new sweep, it can't do that anymore. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a simple Python program to read the data from LibreVNA. I can upload the data before the calibration, but right after the calbration no data is coming. I only get the "# GHZ S RI R 50.000000000000". In order to bring the data again I need to reburn the firmware. I am uploading the calibration externally from the premeasured file with LibreVNA-GUI.
Thank you.
Here is the program I use:
import socket
import time
Create a socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Connect to the LibreVNA
HOST = '127.0.0.1' # local host
PORT = 19542 # LibreVNA port
s.connect((HOST, PORT))
Function to send SCPI commands
def send_scpi_command(cmd):
s.sendall((cmd + '\n').encode())
time.sleep(0.12) # Wait for the command to be processed
Function to query SCPI commands
def query_scpi_command(cmd):
send_scpi_command(cmd)
return s.recv(16384).decode()
Set up the sweep parameters
send_scpi_command(":DEV:MODE VNA")
send_scpi_command(":VNA:SWEEP FREQUENCY")
send_scpi_command(":VNA:ACQ:IFBW 10000")
send_scpi_command(":VNA:ACQ:AVG 1")
send_scpi_command(":VNA:ACQ:POINTS 201")
send_scpi_command(":VNA:FREQuency:START 4000000000")
send_scpi_command(":VNA:FREQuency:STOP 6000000000")
Sweeps loop
for n in range(4):
send_scpi_command(":VNA:ACQuisition:SINGLE TRUE")
Close the socket
s.close()
Beta Was this translation helpful? Give feedback.
All reactions