Skip to main content

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


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.2.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

easyserial-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file easyserial-0.2.0.tar.gz.

File metadata

  • Download URL: easyserial-0.2.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for easyserial-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2f49361522a238eb4ea493c31193780ec81389f27b5f3642fa87958ad2da7052
MD5 741aa8525d88bdede4558d1399cb0879
BLAKE2b-256 f8bcafeff12d445dd5cd5d89fcb84d953fad7fe80348c9b044a1d7932e54fbe9

See more details on using hashes here.

File details

Details for the file easyserial-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: easyserial-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.1 CPython/3.8.5

File hashes

Hashes for easyserial-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c1b12860428548efd9240285cac05b1907e89c75c27c98e6801b7427331c8b6
MD5 f0a7c1e13d665b54a9402caa1fcf968a
BLAKE2b-256 72755895a7e0588908f9fc0dc0746ae4e5104c6af8d710ee8502f4792e63ec4d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page