-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RaspberryPi: Available ports are not containing the correct info #48
Comments
PySerial reads its port information from sysfs, which I believe will typically agree with udev's ID_VENDOR and ID_MODEL. However, serialport-rs has prefered *_FROM_DATABASE for about two years, which is not information reported directly from the device. I believe that udev reads these strings from a binary-blob database that is based on the usb.ids file, so I wonder if Enttec is squatting on an ID that they don't actually own... However, your dmesg makes me think that FTDI's information should be what's printed -- can you clone the repository and run the
|
Sure
From the usb.ids file the vid and pid would lead to this: |
I might be having a similar problem. I wrote a pair of programs (both in the same repo) to control leds on the Neo Trinkey, one of which runs on the trinkey and exposes it as a serial device, the other connects using serialport-rs. This works fine on macos but not on raspios, the devices are not found by serialport-rs (I even added a debug-list option to show all serial devices which returns nothing). I can see the device in dmesg:
I can also see that raspios detects the correct baud rate on the device
I've done a lot of google but can't find anything that seems useful. (Note this also doesn't work on Windows but I only just tried windows tonight and its not a platform I was aiming to support 🤷🏻♂️ ) |
@Gisleburt mlsvrts@ubuntu:~/serialport-rs$ sudo apt list --installed | grep libudev
libudev-dev/focal-updates,now 245.4-4ubuntu3.17 armhf [installed]
libudev1/focal-updates,now 245.4-4ubuntu3.17 armhf [installed,automatic]
mlsvrts@ubuntu:~/serialport-rs$ uname -ar
Linux ubuntu 5.4.0-1060-raspi #68-Ubuntu SMP PREEMPT Tue Apr 26 09:34:31 UTC 2022 armv7l armv7l armv7l GNU/Linux
mlsvrts@ubuntu:~/serialport-rs$ cargo run --example list_ports
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/examples/list_ports`
Found 3 ports:
/dev/ttyUSB0
Type: USB
VID:067b PID:2303
Serial Number:
Manufacturer: Prolific Technology, Inc.
Product: PL2303 Serial Port
Interface: 00
/dev/ttyAMA0
Type: Unknown
/dev/ttyS0
Type: Unknown
mlsvrts@ubuntu:~/serialport-rs$ cargo run --no-default-features --example list_ports
Compiling serialport v4.2.1-alpha.0 (/home/mlsvrts/serialport-rs)
Finished dev [unoptimized + debuginfo] target(s) in 5.55s
Running `target/debug/examples/list_ports`
Found 1 port:
/sys/class/tty/ttyUSB0
Type: Unknown |
Just to update, thank you for the quick response, and sorry I haven't been able to get back to you properly. I've run into a problem as I'm running a k3s cluster on the pi's and trying to avoid putting things like the rust toolchain on it. I was using gitlab ci runners running in the cluster to do things like building rust images and applications however right after you sent me the message the helm chart broke, and I haven't figured out how to fix it 🙄 One thing I did wonder is I'm compiling targeting I'll try to update you when my gitlab ci is working again (or I might just buy another Pi specifically to compile on 🤷🏻♂️ ), sorry thats not much help. |
Seems like a dup of #17? Anyway, my workaround has been to match on serial number |
I am working on a Raspberry Pi 4 and trying to use a DMX interface with rust and serialport.
When listing available ports I noticed that the info is not collected properly.
The USB DMX Interface is by Enttec and called DMXIS. It is available through ttyUSB0 and plugged in through the onboard usb ports of the RaspberryPi.
When listing available Ports and printing the info I get the following output:
main.rs
Output:
However when I run a python script with pyserial I get the correct info:
My guess is that the serialport implementation confuses the actual serialport info with the data from the built in usb hub of the RaspberryPi.
One thing I noticed was that the
serial_number
seemed to be correct at least it matched the number reported when executingudevadm info --query all --name /dev/ttyUSB0 --attribute-walk
Technical data:
The text was updated successfully, but these errors were encountered: