Extends serial.Serial to add methods such as auto discovery of available serial ports in Linux, Windows, and Mac OS X.
Project description
About
- Name: serial_interface
- Version: 2.2.0
- Description: Extends serial.Serial to add methods such as auto discovery of available serial ports in Linux, Windows, and Mac OS X.
- License: BSD 3-Clause License
- URL: https://github.com/janelia-pypi/serial_interface_python
- Author: Peter Polidoro
- Email: peter@polidoro.io
- Copyright: 2022 Howard Hughes Medical Institute
- Dependencies:
- pyserial
Example Usage
from serial_interface import SerialInterface, find_serial_interface_ports
find_serial_interface_ports() # Returns list of available serial ports
dev = SerialInterface() # Might automatically find device if one available
# if it is not found automatically, specify port directly
dev = SerialInterface(port='/dev/ttyUSB0') # Linux
dev = SerialInterface(port='/dev/tty.usbmodem262471') # Mac OS X
dev = SerialInterface(port='COM3') # Windows
dev.get_device_info()
from serial_interface import SerialInterfaces
devs = SerialInterfaces() # Might automatically find all available devices
# if they are not found automatically, specify ports to use
devs = SerialInterfaces(use_ports=['/dev/ttyUSB0','/dev/ttyUSB1']) # Linux
devs = SerialInterfaces(use_ports=['/dev/tty.usbmodem262471','/dev/tty.usbmodem262472']) # Mac OS X
devs = SerialInterfaces(use_ports=['COM3','COM4']) # Windows
devs.get_devices_info()
devs.sort_by_port()
dev = devs[0]
dev.get_device_info()
Installation
https://github.com/janelia-pypi/python_setup
Linux
pip
python3 -m venv ~/venvs/serial_interface
source ~/venvs/serial_interface/bin/activate
pip install serial_interface
guix
Setup guix-janelia channel:
https://github.com/guix-janelia/guix-janelia
guix install python-serial-interface
Windows
drivers
Download and install Windows driver:
Loadstar Sensors Windows Driver
pip
python3 -m venv C:\venvs\serial_interface
C:\venvs\serial_interface\Scripts\activate
pip install serial_interface
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
serial_interface-2.2.0.tar.gz
(7.8 kB
view hashes)
Built Distribution
Close
Hashes for serial_interface-2.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21acddce07738b425ee6fef19c9a30c16eb8dbf64c9f576810d0fe2fbef9d673 |
|
MD5 | 969af4e42c4526e1c04a7da940555f4e |
|
BLAKE2b-256 | 2ac18bfd816733b290e9a2dfeddae3ab247134875b905536c6aea966cd9bc274 |