Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active February 7, 2021 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstellanova/89fbe0c2a7a860f305da75f0c44c4684 to your computer and use it in GitHub Desktop.
Save tstellanova/89fbe0c2a7a860f305da75f0c44c4684 to your computer and use it in GitHub Desktop.
Serial port enumeration with rust

Assumes Debian-based linux

  • (install rust, eg sudo snap install --classic rustup on Ubuntu, or via bash command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  • Using serialports-rs package
  • requires libudev under linux: sudo apt-get install libudev-dev
  • git clone https://gitlab.com/Susurrus/serialport-rs
  • cargo run --example list_ports
  • With a couple Particle devices attached, output will be something like:
  /dev/ttyACM0
    Type: USB
    VID:2b04 PID:c019
     Serial Number: e00fce68be7218691acb0000
      Manufacturer: Intel Corporation
           Product: B5_SOM_CDC_Mode
  /dev/ttyACM1
    Type: USB
    VID:2b04 PID:c006
     Serial Number: 200027001347343432310000
      Manufacturer: Intel Corporation
           Product: Photon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment