Date: Wed, 03 Mar 2021 22:13:02 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 253999] comms/nanovna-saver: files/Sysctl.py makes wrong assumptions Message-ID: <bug-253999-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253999 Bug ID: 253999 Summary: comms/nanovna-saver: files/Sysctl.py makes wrong assumptions Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: hamradio@FreeBSD.org Reporter: joerg@FreeBSD.org Assignee: hamradio@FreeBSD.org Flags: maintainer-feedback?(hamradio@FreeBSD.org) When trying to run comms/nanovna-saver, it crashes with: $ NanoVNASaver NanoVNASaver 0.3.8 Copyright (C) 2019, 2020 Rune B. Broberg Copyright (C) 2020 NanoVNA-Saver Authors This program comes with ABSOLUTELY NO WARRANTY This program is licensed under the GNU General Public License version 3 See https://github.com/NanoVNA-Saver/nanovna-saver for further details. Settings: /home/joerg/.config/NanoVNASaver/NanoVNASaver.ini Traceback (most recent call last): File "/usr/local/bin/NanoVNASaver", line 11, in <module> load_entry_point('NanoVNASaver=3D=3D0.3.8', 'console_scripts', 'NanoVNASaver')() File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/__main__.py", l= ine 80, in main window =3D NanoVNASaver() File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/NanoVNASaver.py= ", line 366, in __init__ self.rescanSerialPort() File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/NanoVNASaver.py= ", line 469, in rescanSerialPort for iface in get_interfaces(): File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/Hardware/Hardware.py", line 69, in get_interfaces vid_pid =3D usb_vid_pid(d.device) File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/Hardware/Sysctl.py", l= ine 20, in usb_vid_pid result =3D (posix_sysctlbyname(b'dev.umodem.'+bytes(digit,'ascii')+b'.%pnpinfo')).deco= de('ascii') File "/usr/local/lib/python3.7/site-packages/NanoVNASaver/Hardware/Sysctl.py", l= ine 15, in posix_sysctlbyname raise Exception('sysctlbyname returned with error %s' % result) Exception: sysctlbyname returned with error -1 It turns out it simply uses the digits from the device names, and tries to = use them as indices into sysctl("dev.umodem.<N>.%pnpinfo"). That just does not = work as intended. List of (accessible by users) serial devices here is: $ python3 Python 3.7.9 (default, Oct 16 2020, 21:50:54)=20 [Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c= 611a on freebsd12 Type "help", "copyright", "credits" or "license" for more information. >>> from serial.tools import list_ports >>> s =3D list_ports.comports() >>> for p in s: ... print(p.device) ...=20 /dev/cuau0 /dev/cuaU1 /dev/cuaU3 Actually /dev/cuaU3 is the device in question, which corresponds to dev.umodem.0: $ sysctl dev.umodem.0 dev.umodem.0.ttyports: 1 dev.umodem.0.ttyname: U3 dev.umodem.0.%parent: uhub9 dev.umodem.0.%pnpinfo: vendor=3D0x0483 product=3D0x5740 devclass=3D0x02 devsubclass=3D0x02 devproto=3D0x00 sernum=3D"00000000001A" release=3D0x0200= mode=3Dhost intclass=3D0x02 intsubclass=3D0x02 intprotocol=3D0x01 ttyname=3DU3 ttyports= =3D1 dev.umodem.0.%location: bus=3D5 hubaddr=3D2 port=3D4 devaddr=3D6 interface= =3D0 ugen=3Dugen5.6 dev.umodem.0.%driver: umodem dev.umodem.0.%desc: SYSJOINT NanoVNA-F Virtual COMPort, class 2/2, rev 2.00/2.00, addr 6 When proceeding to digit 1 (from /dev/cuaU1), it hits the above error. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253999-7788>