NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
comms/py-serial in NetBSD vs Linux differences
Hello,
I am trying to make nanovnasaver program work under NetBSD. NanoVNA is
a cheap Vector Network Analyzer (30$ only) that connects to the USB
port. Nanovnasaver is a python program that manages the device and make
very useful RF S-parameters measurements, graphing and data saving. The
code is at Github here:
https://github.com/NanoVNA-Saver
Device detection fails in NetBSD, in Linux it works just fine (also
FreeBSD fails).
Device detection and communication relies on py-serial python module.
Under Linux, device is /dev/ttyAMC0, in NetBSD device is /dev/ttyU0 and
/dev/dtyU0 (never understood which to use). I have given permission to
the device and can perfectly be accesed with the cu program as a normal
user (both ttyU0 and dtyU0 work):
netbsd-x260$ cu -l /dev/ttyU0
Connected
ChibiOS/RT Shell
ch> help
Commands: help exit info threads version reset freq offset time dac
saveconfig clearconfig data dump frequencies port stat gain power sample
scan sweep test touchcal touchtest pause resume cal save recall trace
marker edelay capture vbat transform threshold
ch> info
Kernel: 4.0.0
Compiler: GCC 8.2.1 20181213 (release) [gcc-8-branch revision 267074]
Architecture: ARMv6-M
Core Variant: Cortex-M0
Port Info: Preemption through NMI
Platform: STM32F072xB Entry Level Medium Density devices
Board: NanoVNA-H
Build time: Oct 18 2019 - 16:10:54
ch> ~
[EOT]
netbsd-x260$
Nanovnaserver uses py-serial python module to communicate, but in NetBSD
nanovnasaver program is confused with py-serial detection functions
output, they do not work the same as in Linux.
LINUX detects theese ports:
ramiro@debian-x260:~$ pyserial-ports -v
/dev/ttyACM0
desc: ChibiOS/RT Virtual COM Port
hwid: USB VID:PID=0483:5740 SER=400 LOCATION=1-1:1.0
/dev/ttyS0
desc: n/a
hwid: n/a
2 ports found
ramiro@debian-x260:~$
On the other hand, in NetBSD py-serial detects 121 of devices but no
useful information on /dev/ttyU0 and /dev/dtyU0
NETBSD:
netbsd-x260$ pyserial-ports-3.12
/dev/dty00
/dev/dty01
/dev/dty02
/dev/dty03
/dev/dtyCY000
...
...
/dev/dtyCZ0000
...
...
/dev/dtyCZ0063
/dev/dtyHS0.00
...
...
/dev/dtyHS0.10
/dev/dtyU0
/dev/dtyU1
/dev/dtyU2
/dev/dtyU3
/dev/dtyU4
/dev/dtyU5
/dev/dtyU6
/dev/dtyU7
/dev/dtyY0
/dev/dtyY1
121 ports found
netbsd-x260$
If more detail is requested it does not output more details:
netbsd-x260# pyserial-ports-3.12 -v
/dev/dty00
desc: n/a
hwid: n/a
..
..
/dev/dtyU0
desc: n/a
hwid: n/a
/dev/dtyU1
desc: n/a
hwid: n/a
/dev/dtyU2
desc: n/a
hwid: n/a
/dev/dtyU3
desc: n/a
hwid: n/a
/dev/dtyU4
desc: n/a
hwid: n/a
/dev/dtyU5
desc: n/a
hwid: n/a
/dev/dtyU6
desc: n/a
hwid: n/a
/dev/dtyU7
desc: n/a
hwid: n/a
/dev/dtyY0
desc: n/a
hwid: n/a
/dev/dtyY1
desc: n/a
hwid: n/a
121 ports found
netbsd-x260#
If I run this simple python program that scan the ports using py-serial
python module:
netbsd-x260$ cat test.py
import serial
from serial.tools import list_ports
from serial.tools.list_ports_common import ListPortInfo
for d in list_ports.comports(include_links=True):
print('device',d.device)
print('name',d.name)
print('description',d.description)
print('hwid',d.hwid)
print('vid',d.vid)
print('pid',d.pid)
print('serial_number',d.serial_number)
print('location',d.location)
print('manufacturer',d.manufacturer)
print('product',d.product)
print('interface',d.interface)
LINUX output:
device /dev/ttyACM0
name ttyACM0
description ChibiOS/RT Virtual COM Port
hwid USB VID:PID=0483:5740 SER=400 LOCATION=1-1.2:1.0
vid 1155
pid 22336
serial_number 400
location 1-1.2:1.0
manufacturer STMicroelectronics
product ChibiOS/RT Virtual COM Port
interface None
NETBSD outputs 121 devices but I only print below the device of interest
There is no information about the description, hwid, vendor, product and
serial number:
device /dev/dtyU0
name dtyU0
description n/a
hwid n/a
vid None
pid None
serial_number None
location None
manufacturer None
prpy313-libusb1oduct None
interface None
Have you noticed this behaviour in py-serial under NetBSD or am I
missing something?
I can fool nanovnasaver entering the detection data literaly in the code
and go further but first want to know if py-serial behaviour is right.
Thanks.
Ramiro.
Home |
Main Index |
Thread Index |
Old Index