Giter Club home page Giter Club logo

Comments (6)

mlsvrts avatar mlsvrts commented on May 30, 2024

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 list_ports example?

git clone https://github.com/serialport/serialport-rs && cd serialport-rs
cargo run --example list_ports

from serialport-rs.

teikmeier avatar teikmeier commented on May 30, 2024

Sure
The output looks like this:

     Running `target/debug/examples/list_ports`
Found 2 ports:
  /dev/ttyUSB0
    Type: USB
    VID:0403 PID:6001
     Serial Number: ENVVVCOF
      Manufacturer: VIA Technologies, Inc.
           Product: VL805 USB 3.0 Host Controller
  /dev/ttyAMA0
    Type: Unknown

From the usb.ids file the vid and pid would lead to this:
0403 --> Future Technology Devices International, Ltd
6001 --> FT232 Serial (UART) IC

from serialport-rs.

Gisleburt avatar Gisleburt commented on May 30, 2024

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:

[    3.064356] usb 1-1.3: New USB device found, idVendor=0000, idProduct=0000, bcdDevice= 0.10
[    3.072896] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.080344] usb 1-1.3: Product: Status Lights
[    3.084787] usb 1-1.3: Manufacturer: Gisleburt
[    3.089318] usb 1-1.3: SerialNumber: Gisleburt Neo Trinkey Status Lights

I can also see that raspios detects the correct baud rate on the device

$ stty -F /dev/ttyACM0
speed 9600 baud; line = 0;
-brkint -imaxbel

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 🤷🏻‍♂️ )

from serialport-rs.

mlsvrts avatar mlsvrts commented on May 30, 2024

@Gisleburt serialport-rs uses a pretty thin wrapper over libudev for enumeration; can you provide some information about the system you're running on? I can list ports correctly on a CM4 running Ubuntu 20.04 (armv7l):

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

from serialport-rs.

Gisleburt avatar Gisleburt commented on May 30, 2024

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 aarch64-unknown-linux-musl and wondered if that might cause problems with libudev but I don't get any errors when running (either in k3s or copying the statically linked executable to the pi directly).

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.

from serialport-rs.

ZanderBrown avatar ZanderBrown commented on May 30, 2024

Seems like a dup of #17? Anyway, my workaround has been to match on serial number

from serialport-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.