Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CounterFit Shims - PySerial

PySerial Shim PyPI

Shims for the PySerial to read sensors that use a virtual serial port

See the PySerial Docs for the API documentation.

Getting started

To use these shims, you will need to install CounterFit and have it running, with the appropriate hardware created.

  • Install this package from pip:

    pip install counterfit-shims-serial
    
  • Import PySerial using the counterfit_shims_serial package instead of the serial package, as well as importing the CounterFitConnection from the counterfit_shims_grove.counterfit_connection module:

    from counterfit_connection import CounterFitConnection
    import counterfit_shims_serial
    
  • Configure the connection to the CounterFit app. Change the hostname and port to where you are running it:

    CounterFitConnection.init('127.0.0.1', 5000)
    
  • Write your PySerial code as usual, setting the port to match the one you set in the CounterFit app.

    For example, create a UART sensor on port /dev/ttyAMA0:

    serial = counterfit_shims_serial.Serial('/dev/ttyAMA0', 9600, timeout=1)
    

    The baud and timeout settings are ignored.

Metadata

Release files for counterfit-shims-serial 0.1.0.dev3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for counterfit-shims-serial 0.1.0.dev3
File Interpreter ABI Platform
counterfit_shims_serial-0.1.0.dev3-py3-none-any.whl Python 3 none any Details

Release files / counterfit_shims_serial-0.1.0.dev3-py3-none-any.whl

Download URL counterfit_shims_serial-0.1.0.dev3-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65a452b596f9bda1306bcb3ee9704e692ad51632bceb9f3febd412a2344c7950
BLAKE2b-256 checksum
How to use checksums
da22cbb69ead8778af00e6535e3cb379c9ba6e59f1b7bfdc1cb7d7cb8a83da77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page