python-tsic
Receive temperature readings from TSic sensor chips connected to Raspberry Pi GPIO.
Supported:
- TSic 206/306
- TSic 506
- TSic 716
Don't forget the bypass capacitor as near as possible to the sensor's power supply pins to get stable behavior.
Dependencies
The package tsic requires Python 3 and the great library pigpio for GPIO access with precise timing. Note that Python 2 will not work.
Installation
Install from Python package index PyPI:
pip3 install tsic
Usage
The module tsic provides the following classes:
TsicInputChannelreceive temperature measurementsMeasurementa temperature measurementTsicTypeTSic type definition with instancesTSIC206,TSIC306,TSIC506,TSIC716(206 and 306 are currently equivalent)ZacWireInputChannelreceive byte packets over ZACWire protocol (low-level handler forTsicInputChannel)
Command Line Test Tool
Run tsic <gpio-bcm> [--type {206,506,716,306}] [--loop] to read temperatures from a GPIO pin (Broadcom numbering). See tsic --help for command line usage.
pi@raspi3:~ $ sudo tsic 19 --type 306
Receiving data from TSic 206/306...
Measurement 17.90°C at 2018-11-10 16:16:11.419573
Examples
From file example.py:
import time
import pigpio
from tsic import TsicInputChannel, Measurement, TSIC306
# TsicInputChannel and ZacWireInputChannel require pigpio
# for GPIO access with precise timing:
pi = pigpio.pi()
tsic = TsicInputChannel(pigpio_pi=pi, gpio=17, tsic_type=TSIC306)
print('\nA. Single measurement:')
print(tsic.measure_once(timeout=1.0))
print('\nB. All measurements for 1 second:')
tsic.start(lambda measurement: print(measurement))
time.sleep(1)
tsic.stop()
print('\nC. One measurement per second for 3 seconds:')
# start receiving in a context:
with tsic:
for i in range(3):
time.sleep(1)
measurement = tsic.measurement
if measurement == Measurement.UNDEF:
print(measurement)
else:
print('{:d} {:.1f}°C'.format(i+1, measurement.degree_celsius))
pi.stop()
Source Code
Hosted on github.com/grillbaer/python-tsic
With greetings from Bavaria, Holger
Metadata
Release files for tsic 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tsic-2.0.2.tar.gz | 6.4 kB | Without provenance | Details for tsic-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tsic-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for tsic-2.0.2-py3-none-any.whl |
Total release size: 17.3 kB
Release files / tsic-2.0.2.tar.gz
| Download URL | tsic-2.0.2.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ca50ce54eb46b19af3352817eeda6ac4f026d11e1825a2ca9cf271ac8f3f013
|
|
BLAKE2b-256 checksum How to use checksums |
825000d68c05392e75cde83aa862083c784ba34ff9f6dbb5608412ba7174dafc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.4
|
Release files / tsic-2.0.2-py3-none-any.whl
| Download URL | tsic-2.0.2-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad4e75359f129903fe0b97da6e4f6660c08eb41add236af95e796f90b10ef566
|
|
BLAKE2b-256 checksum How to use checksums |
ed3946f0dfc0cbf00c40562f23de585c2a733298aae73b9e276561c6027a722a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.4
|
Security for tsic 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.