Skip to main content

Shims for the PySerial library for the CounterFit virtual IoT device app

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

counterfit_shims_serial-0.1.0.dev1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file counterfit_shims_serial-0.1.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: counterfit_shims_serial-0.1.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for counterfit_shims_serial-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 afc356d1d83dbeeb9112a373df6e1a5693498a7b39fbc1124f2452e7f368bc46
MD5 1d1e9bed1a333291a59a3c5edfad62f3
BLAKE2b-256 d9c6a288f92330510a3189a794f794baded68725aaec512597d90ae5def06774

See more details on using hashes here.

Supported by

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