Skip to content

bug: Combo-box in device settings has only 101 option for valid sweep points for NanoVNA-F_V2 #816

@superduty

Description

@superduty

Bug Report

NanoVNA-Saver version:
0.7.3 Windows 10

Current behavior:
After connecting to Com port _F_V2 and selecting "Manage" to set sweep points, only selection is "101". Upon running with debug option, I can see "variable not iterable "error:

Expected behavior:

Combo-box should have all the points options as per the source code in NanoVNA_F_V2.

Steps to reproduce:
Select manage with device NanoVNA-F-V2 from Sysjoint connected, using -d option to get error above. I can only test in windows 10 currently.

Related code:

Traceback (most recent call last):
File "C:\Users\john\Desktop\vna\nanovna-saver\src\NanoVNASaver\Controls\SerialControl.py", line 70, in
lambda: self.app.display_window("device_settings")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\john\Desktop\vna\nanovna-saver\src\NanoVNASaver\NanoVNASaver.py", line 640, in display_window
self.windows[name].show()
File "C:\Users\john\Desktop\vna\nanovna-saver\src\NanoVNASaver\Windows\DeviceSettings.py", line 145, in show
self.updateFields()
File "C:\Users\john\Desktop\vna\nanovna-saver\src\NanoVNASaver\Windows\DeviceSettings.py", line 171, in updateFields
for item in features:
^^^^^^^^
TypeError: 'NoneType' object is not iterable

Code from GitHub:

class NanoVNA_F_V2(NanoVNA):
    name = "NanoVNA-F_V2"
    screenwidth = 800
    screenheight = 480
    valid_datapoints: tuple[int, ...] = (101, 11, 51, 201, 301)
    sweep_points_min = 11
    sweep_points_max = 301

Other information:
My device is a Sysjoint NanoVNA-F_V2 with firmware 0.5.4

I debugged the error by cloning to my PC locally. It appears that the issue is simply a missing return statement at the end of the Hardware/NanoVNA_F_V2.py, get_features function.

Code:
def get_features(self):
super().get_features()
result = " ".join(self.exec_command("help")).split()
if "sn:" or "SN:" in result:
self.features.add("SN")
self.SN = self.getSerialNumber()
****************should have "return self.features" here ****************
def getSerialNumber(self) -> str: I can edit the module adding "return self.features" at the end and re-building.

I probably should do a pull request and push the fix, but I am just learning the "GIT" environment and haven't yet done that "official" process.

I struggled with the build process for Windows but eventually stumbled accross the instructions for using "uv"!

As a side issue, I keep seeing that with 0.5.4 firmware its supposed to handle 301 sweep points and that is what is currently shown in the software. However, my unit seems to time-out whet I set it to 301. Works fine at 201.

Thanks to everyone who has contributed to the excellent software package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions