Driver for Sensirion SCC1 USB cable
Project description
python-uart-scc1
This repository provides a Python driver for Sensirion SCC1-USB Cable. The detailed technical description of the SCC1-USB cable is provided in the datasheet.
Feature overview
On one hand the SCC1-USB exposes an API to efficiently use the supported sensors. So far support is only added for the SLF3x-Sensor family.
On the other hand the cable can be used as USB to I2c bridge for any Sensirion I2c sensor that can be plugged to the cable.
For both scenarios an example is available in the example subfolder of this repository.
Note: Using the cable as USB to I2c bridge will not allow to achieve the same throughput as with the embedded API.
The API of the driver is described on the documentation page of this repository
Getting started
Installation
It is recommended to use a virtual environment. In any case you can install the package via pip by typing:
pip install sensirion-uart-scc1
If you have cloned the repository you can install the package and all it dependencies using poetry.
poetry install
Running the examples
We provide two examples to show two basic usage scenarios of the driver
-
SLF3x Usage This example does not require any additional dependency. Once the package
sensirion-uart-scc1
is installed the example is run by typing:python ./examples/scc1_slf3x_example/slf3x_usage.py --serial-port <your-com-port>
-
USB-I2c-Bridge This example shows how a public python driver can be used with the SCC1-USB cable. The example uses the public driver
sensirion_i2c_sf06_lf
. Before you run the example you need to install this driver.pip install sensirion_i2c_sf06_lf
After having installed the driver the example is run by typing:
python ./examples/scc1_usb_to_i2c/scc1_usb_2_i2c_usage.py --serial-port <your-com-port>
Contributing
You are very welcome to open issues and to create pull requests.
Nevertheless you need to understand that we cannot consider pull request that do not pass the CI-pipeline.
This section explains in short how you can make sure that your contribution passes all the checks of the CI pipeline.
The repository uses poetry for dependency management. It is used in the CI pipeline as well. The easiest way to be conformant to our coding style will be to use poetry for your contributions as well. This will allow to test and check your contributions locally before creating pull requests.
Installing and running tests
For testing some extra dependencies are required that need to be installed.
poetry install --with test
The tests (including those that are marked) can be executed by tying:
poetry run pytest
Note: On github no tests that require hardware can be run. Test cases that rely on attached hardware need to be decorated with @pytest.mark.needs_hardware
Checking code-formatting
Make sure that you code is properly formatted. The CI pipeline will check and fail if this is not the case. To check the code-formatting before pushing to the repository type:
poetry run flake8
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
Built Distribution
File details
Details for the file sensirion_uart_scc1-1.1.1.tar.gz
.
File metadata
- Download URL: sensirion_uart_scc1-1.1.1.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1007cc282116fe26a966e8b11cbde41bfc8850e574aed8c671e37b1a28ed8be9 |
|
MD5 | 4aabcae82e6306225f69416717b7d14e |
|
BLAKE2b-256 | 8b4f34babd004df07cdf65b0bec2c1a8f0c487a25a16a194cf6e9e7059598e77 |
File details
Details for the file sensirion_uart_scc1-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: sensirion_uart_scc1-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1780bcc31f9baac588d66a9c94bd612683a8fb3742604899ce28bcd3faec688c |
|
MD5 | a130fee0f60a2e9e8f40e1c615e5e4e4 |
|
BLAKE2b-256 | ac429701e733ad51519af28dff127adf064853ed3701bc9828cb58feb8fbb947 |