Date: Fri, 27 May 2022 04:01:55 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 264271] comms/nanovna-saver: incorrect /dev/cua* to umodem number mapping Message-ID: <bug-264271-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264271 Bug ID: 264271 Summary: comms/nanovna-saver: incorrect /dev/cua* to umodem number mapping 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: jeffpc@josefsipek.net Flags: maintainer-feedback?(hamradio@FreeBSD.org) Assignee: hamradio@FreeBSD.org While trying to validate an upstream fix to a device enumeration issue [1],= I realized that the ports package has a tweak to get the USB vendor & product= IDs from sysctl [2]. Unfortunately, this code is incorrect since it assumes th= at /dev/cua*N corresponds to dev.umodem.N. For example, on my system I see: $ sysctl -a|grep umodem hw.usb.umodem.debug: 0 dev.umodem.0.ttyports: 1 dev.umodem.0.ttyname: U1 dev.umodem.0.%parent: uhub5 dev.umodem.0.%pnpinfo: vendor=3D0x0483 product=3D0x5740 devclass=3D0x02 devsubclass=3D0x00 devproto=3D0x00 sernum=3D"510" release=3D0x0200 mode=3Dh= ost intclass=3D0x02 intsubclass=3D0x02 intprotocol=3D0x01 ttyname=3DU1 ttyports= =3D1 dev.umodem.0.%location: bus=3D2 hubaddr=3D2 port=3D8 devaddr=3D4 interface= =3D0 ugen=3Dugen2.4 dev.umodem.0.%driver: umodem dev.umodem.0.%desc: STMicroelectronics ChibiOS/RT Virtual COM Port, class 2= /0, rev 1.10/2.00, addr 4 dev.umodem.%parent:=20 The %pnpinfo and ttyname nodes state that dev.umodem.0 corresponds to /dev/cuaU1. As a result, NanoVNA-Saver fails to start with the following backtrace as it finds cuaU1 and then proceeds to attempt to get dev.umodem.1.%pnpinfo sysctl nodes: Traceback (most recent call last): File "/usr/local/bin/NanoVNASaver", line 33, in <module> sys.exit(load_entry_point('NanoVNASaver=3D=3D0.3.10', 'console_scripts', 'NanoVNASaver')()) File "/usr/local/lib/python3.8/site-packages/NanoVNASaver/__main__.py", l= ine 85, in main window =3D NanoVNASaver() File "/usr/local/lib/python3.8/site-packages/NanoVNASaver/NanoVNASaver.py= ", line 92, in __init__ self.serial_control =3D SerialControl(self) File "/usr/local/lib/python3.8/site-packages/NanoVNASaver/Controls/SerialControl= .py", line 37, in __init__ self.rescanSerialPort() File "/usr/local/lib/python3.8/site-packages/NanoVNASaver/Controls/SerialControl= .py", line 67, in rescanSerialPort for iface in get_interfaces(): File "/usr/local/lib/python3.8/site-packages/NanoVNASaver/Hardware/Hardware.py", line 86, in get_interfaces vid_pid =3D usb_vid_pid(d.device) File "/usr/local/lib/python3.8/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.8/site-packages/NanoVNASaver/Hardware/Sysctl.py", l= ine 14, in posix_sysctlbyname raise Exception('sysctlbyname returned with error %s' % result) Exception: sysctlbyname returned with error -1 [1] https://github.com/NanoVNA-Saver/nanovna-saver/issues/502 [2] https://cgit.freebsd.org/ports/tree/comms/nanovna-saver/files --=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-264271-7788>