From 143e1dda02709d1dd24da0e47b0b2913df431306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20M=C3=BCller?= Date: Fri, 3 Jul 2020 18:43:39 +0200 Subject: [PATCH 1/3] detect -H versions --- NanoVNASaver/Hardware/Hardware.py | 17 ++++++++++------- NanoVNASaver/Hardware/VNA.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NanoVNASaver/Hardware/Hardware.py b/NanoVNASaver/Hardware/Hardware.py index 483e707..996c3de 100644 --- a/NanoVNASaver/Hardware/Hardware.py +++ b/NanoVNASaver/Hardware/Hardware.py @@ -66,7 +66,7 @@ def get_interfaces() -> List[Tuple[str, str]]: port = d.device logger.info("Found %s (%04x %04x) on port %s", t.name, d.vid, d.pid, d.device) - return_ports.append((port, f"{port}({t.name})")) + return_ports.append((port, f"{port} ({t.name})")) return return_ports @@ -91,14 +91,14 @@ def get_VNA(app, serial_port: serial.Serial) -> 'VNA': if firmware.find("NanoVNA-H 4") > 0: logger.info("Type: NanoVNA-H4") vna = NanoVNA_H4(app, serial_port) - if firmware.find("sweep_points 201") > 0: + if vna.readFirmware().find("sweep_points 201") > 0: logger.info("VNA has 201 datapoints capability") vna._datapoints = (201, 101) return vna if firmware.find("NanoVNA-H") > 0: logger.info("Type: NanoVNA-H") vna = NanoVNA_H(app, serial_port) - if firmware.find("sweep_points 201") > 0: + if vna.readFirmware().find("sweep_points 201") > 0: logger.info("VNA has 201 datapoints capability") vna._datapoints = (201, 101) return vna @@ -113,15 +113,18 @@ def get_VNA(app, serial_port: serial.Serial) -> 'VNA': def detect_version(serial_port: serial.Serial) -> str: + data = "" for i in range(RETRIES): drain_serial(serial_port) serial_port.write("\r".encode("ascii")) - data = serial_port.readline().decode("ascii") - if data == "ch> ": + data = serial_port.read(128).decode("ascii") + if data.startswith("ch> "): return "v1" - if data == "2": + # -H versions + if data.startswith("\r\nch> "): + return "vh" + if data.startswith("2"): return "v2" logger.debug("Retry detection: %s", i + 1) logger.error('No VNA detected. Hardware responded to CR with: %s', data) - return "" diff --git a/NanoVNASaver/Hardware/VNA.py b/NanoVNASaver/Hardware/VNA.py index ec1df93..3d61254 100644 --- a/NanoVNASaver/Hardware/VNA.py +++ b/NanoVNASaver/Hardware/VNA.py @@ -155,7 +155,7 @@ class VNA: command, exc) def setSweep(self, start, stop): - self.writeSerial(f"sweep {start} {stop} {self.datapoints}") + self.writeSerial(f"sweep {start} {stop} {self.datapoints}") # TODO: should be dropped and the serial part should be a connection class From 6941d237c4c91da8d75e4928584efcfd7bb0f42d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20M=C3=BCller?= Date: Fri, 3 Jul 2020 18:52:59 +0200 Subject: [PATCH 2/3] Updated README.md / CHANGELOG.md --- CHANGELOG.md | 11 +++++++++++ README.md | 14 +++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f26abcb..c81ced4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +v0.3.4 +====== + +- Refactored Analysis +- Add Antenna Analysis +- Fixed bug in Through Calibration +- Fixed bug in s2p saving +- Fixed crash when clicking connect with no device connected +- Fixed module error with source installation if + pkg\_resources missing + v0.3.3 ====== diff --git a/README.md b/README.md index 520f2e2..d0ab47d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,15 @@ points, and generally display and analyze the resulting data. # Latest Changes -## Changes in v0.3.4RC0 - - Refactored Analysis - - Add Antenna Analysis - - Fix bug in Through Calibration - +## Changes in v0.3.4 +- Refactored Analysis +- Add Antenna Analysis +- Fixed bug in Through Calibration +- Fixed bug in s2p saving +- Fixed crash when clicking connect with no device connected +- Fixed module error with source installation if + pkg\_resources missing + ## Changes in v0.3.3 - Fixed data acquisition with S-A-A-2 / NanoVNA V2 - Refactored calibration code From 9ec71ebc8dbfd35c9075d8e8246442ba60321b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20M=C3=BCller?= Date: Fri, 3 Jul 2020 19:16:45 +0200 Subject: [PATCH 3/3] Bump Version --- NanoVNASaver/About.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NanoVNASaver/About.py b/NanoVNASaver/About.py index c358082..c82718b 100644 --- a/NanoVNASaver/About.py +++ b/NanoVNASaver/About.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -VERSION = "0.3.4-pre" +VERSION = "0.3.4" VERSION_URL = ( "https://raw.githubusercontent.com/" "NanoVNA-Saver/nanovna-saver/master/NanoVNASaver/About.py")