Skip to content
/ lstty Public
forked from atctwo/lstty

A simple terminal tool to list serial ports

License

Notifications You must be signed in to change notification settings

barcesat/lstty

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lstty

lstty is a Python-based command-line tool to list available serial ports. It prints the name of the serial port, the type of port, and if it's a USB port, it will include the VID, PID, and product name. Currently, there are no command-line parameters—just run lstty to see the output.

Features

  • Cross-platform tool (tested on Linux and Win 10).
  • Lists available serial ports.
  • Displays port type (e.g., USB, Bluetooth, PCI, etc.).
  • Includes USB-specific details like VID, PID, and product description.
  • Outputs information in a clear ASCII table format.

Example Output

Linux:

$ lstty
Port            Type       Details
----------------------------------------------------------------------
/dev/ttyS0      unknown    
/dev/ttyS1      unknown    
/dev/ttyACM0    usb        VID:PID=2E8A RaspberryPi Pico

Windows:

> lstty
Port            |       Type            |       Details
----------------------------------------------------------------------
COM24           |       bluetooth       |       Standard Serial over Bluetooth link (COM24)
COM6            |       usb             |       VID:PID=413C DW5821e Snapdragon X20 LTE Diagnostic (COM6)
COM22           |       bluetooth       |       Standard Serial over Bluetooth link (COM22)
COM3            |       usb             |       VID:PID=0403 USB Serial Port (COM3)
COM7            |       usb             |       VID:PID=413C DW5821e Snapdragon X20 LTE Modem

Installation

To install lstty, clone this repository and run:

pip install .

Currently, lstty is not available on PyPI.

Dependencies

This tool relies on the following Python libraries:

  • pyserial – for serial port information.
  • click – for the command-line interface.

Install them via pip:

pip install pyserial click

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

Acknowledgments

This tool was inspired by the original lstty project by @atctwo. Special thanks to the original author for creating the Rust-based implementation that served as the foundation for this Python adaptation.

About

A simple terminal tool to list serial ports

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%