| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/comms/nanovna-saver/files/ |
Upload File : |
--- NanoVNASaver/Hardware/Hardware.py.orig 2022-04-01 14:51:11 UTC
+++ NanoVNASaver/Hardware/Hardware.py
@@ -34,6 +34,7 @@ from NanoVNASaver.Hardware.NanoVNA_H4 import NanoVNA_H
from NanoVNASaver.Hardware.NanoVNA_V2 import NanoVNA_V2
from NanoVNASaver.Hardware.TinySA import TinySA
from NanoVNASaver.Hardware.Serial import drain_serial, Interface
+from NanoVNASaver.Hardware.Sysctl import usb_vid_pid
logger = logging.getLogger(__name__)
@@ -80,6 +81,11 @@ def get_interfaces() -> List[Interface]:
for d in list_ports.comports():
if platform.system() == 'Windows' and d.vid is None:
d = _fix_v2_hwinfo(d)
+ if platform.system() == 'FreeBSD':
+ logger.debug("Found FreeBSD USB port %s", d.device)
+ vid_pid = usb_vid_pid(d.device)
+ d.vid = vid_pid[0]
+ d.pid = vid_pid[1]
for t in USBDEVICETYPES:
if d.vid != t.vid or d.pid != t.pid:
continue
@@ -87,14 +93,17 @@ def get_interfaces() -> List[Interface]:
t.name, d.vid, d.pid, d.device)
iface = Interface('serial', t.name)
iface.port = d.device
- iface.open()
+ try:
+ iface.open()
+ except serial.SerialException:
+ logger.warning("Could not open serial port %s", d.device)
+ continue
iface.comment = get_comment(iface)
iface.close()
interfaces.append(iface)
logger.debug("Interfaces: %s", interfaces)
return interfaces
-
def get_VNA(iface: Interface) -> 'VNA':
# serial_port.timeout = TIMEOUT