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 telegen-shims-serial
    
  • Import PySerial using the counterfit_shims_serial package instead of the serial package, as well as importing the TeleGenConnection from the counterfit_shims_grove.counterfit_connection module:

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

    TeleGenConnection.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 Distribution

telegen_shims_serial-0.1.0.dev4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

telegen_shims_serial-0.1.0.dev4-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file telegen_shims_serial-0.1.0.dev4.tar.gz.

File metadata

File hashes

Hashes for telegen_shims_serial-0.1.0.dev4.tar.gz
Algorithm Hash digest
SHA256 594a4fdc307c37986b003a8fbf7429750d2dad56b20fe6c1f7502a7d7372c7cb
MD5 c1810d4abc5d5b7c574945e603b623cc
BLAKE2b-256 a57de0409434a3a191255630ac4cf4f205c51dbe62f1f91ddb387493faa09c30

See more details on using hashes here.

File details

Details for the file telegen_shims_serial-0.1.0.dev4-py3-none-any.whl.

File metadata

File hashes

Hashes for telegen_shims_serial-0.1.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 60d7afe6dd8e195e92cc67631ccf75712aa7061f27bf546a28ec06f69126cd6f
MD5 baf51fd6677c5c4582d4367565998bce
BLAKE2b-256 5a40683588b5c3327bbca522ee5133d2f2d5ed7e0cf32da50b764ee7f4fbc27a

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