Serial protocol to send and receive data effortlessly
Project description
Easy Serial 😎
What is this?
This is a thread safe Python3 implementation of an high level serial protocol currently used in the Forecast project.
This package core functionality is to grant ease of use to end users unfamiliar with the protocol through different layers of abstraction. It is currently built on top of the more known library PySerial, which offers an easy interface to compliant posix/win32 serials.
A simple logger script is also included, which is callable from console:
easyserial-logger
or
easyserial-logger -p <PORT> -b <BAUDRATE>
Installation
From pypi
pip install easyserial
From source
- Clone the repository
- Run the following commands
cd easy-serial
# Using pipenv
pipenv install
# or just using pip
pip install -e .
Example
import easyserial
port = "/dev/ttyACM0"
baudrate = 115200
with easyserial.Serial(port=port, baud=baudrate) as serial:
# Read package example
# tries specifies the number of attempts to read from serial a full package (default: infinite)
package_type, payload = serial.read_package(tries=1)
# In case you want to skip unescaping and checksum checks
package = serial.read(tries=1)
# In order to write to serial
serial.write(package)
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
easyserial-0.1.0.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file easyserial-0.1.0.tar.gz
.
File metadata
- Download URL: easyserial-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c4405288dee722b57713528ee80a38aa35cd3e5eb4a2b8c6137e95fffc1dc0 |
|
MD5 | 34c21c436f1b8d8049dc21495729d6de |
|
BLAKE2b-256 | d563c21fa69fc416ecc5059dd6be59cdeceee85f4a05919e90fb93e0ea4fe207 |
Provenance
File details
Details for the file easyserial-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: easyserial-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed671642ba63d89d85024c64f16a276407a8692d02200ad8626b33d8515c468 |
|
MD5 | a92e3d6133f4bbc56894ba146dca022d |
|
BLAKE2b-256 | 38295b4b1ded1e562636681d3dd58e3effed38fa2acba954688f423813ee5474 |