Package: tc2100
TC2100 Thermometer InterfaceReceive measurements from your TC2100 or other compatible digital thermometer
over USB.MotivationThe TC2100 is a digital thermometer which supportstwo simultaneous measurement channels; andseven standard types of thermocouples.Although it is usable as a standalone meter, it also includes a USB interface
for real-time computer output.The manufacturer provides software for the USB interface.This is not it.This is unsupported, third-party software which was developed by reverse
engineering.Thetc2100module is a python 3.9 software development kit for receiving
real-time temperature measurements. It includes a console script,tc2100dump,
for logging measurements tocsvfiles.Supported DevicesAt present, only one device is supported by this module.NameVendor ID (hex)Product ID (hex)TC210010c4ea60Other devices have not been tested and are unlikely to work. If you have another
device which works, open a bug report and ask that it be added to this table.The Fine PrintIn case you missed it above, this project is not affiliated with the original
manufacturer(s). To our knowledge, the telemetry format is not specified in any
[other] public documents. It has been reverse-engineered without assistance or
support from the manufacturer. Read thelicensecarefully, as
it may affect your rights. There is no warranty.Use of these programs in safety-critical applications is strongly discouraged.Installationpip3installtc2100This module requirestwistedandpyserial. The pip
package will automatically install these dependencies.Quick StartUsing the supplied USB cable, connect a TC2100 thermometer to your computer.
Hold down the "PC-Link" button until the meter beeps and the "USB" indicator
illuminates. Then run:tc2100dump--outtemperatures.csvIf you receive "permission denied" errors on Linux, you need to grant your
user account permission to use serial devices. On most distributions, including
Ubuntu and CentOS, this can be accomplished by adding yourself to thedialoutgroup:sudousermod-a-Gdialout"$USER"Once you perform the above modification, you will need to log out and log back
in again. Never run this program as root!When runningtc2100dump, you may omit the--outargument to write
measurements to standard output. You may also call this module as an executable
withpython3-mtc2100--outtemperatures.csvThe script will attempt to auto-detect the correct port for your thermometer.
If auto-detection fails, you may specify the port manually:tc2100dump--port/dev/ttyUSB0--outtemperatures.csvIf the script detects your thermometer, but no data is printed, check to make
sure you have pressed the "PC-Link" button and that the "USB" indicator
is illuminated.Development StatusThis module is likelyfeature-complete. It does what I need it to do, and
additional features are not planned. Bug reports which are broadly categorized
as feature requests will probably be rejected. I am also unable to support the
inclusion of additional devices—even similar ones.If you observe inconsistencies or other issues with the telemetry output, and
can identify them, please submit a bug report. If able, please include a capture
of the serial data stream and the expected behavior with your report.Pull requests within the scope of this project are welcome, especially if they
fix bugs. Please ensure that your PRs include tests and pass the includedtoxchecks.Technical DetailsThe TC2100 incorporates a UART-to-USB chipset, which emulates a serial port over
USB. When plugged in, most computers will automatically detect it as a serial
port, like/dev/ttyUSB0orCOM1. No additional drivers are required.The thermometer has a USB vendor ID of0x10c4and a product ID of0xea60.
The meter's serial adapter uses9600baud with the common8N1format: eight
data bits, no parity, and one stop bit.Once the "PC Link" button is pressed, updates begin to stream immediately, at
regular intervals. Each update is an 18 byte packet which begins with the hex
bytesb"\x65\x14"and ends with a CRLF (b"\x0d\x0a"). Multi-byte quantities
are sentbig endian.This is an example update, in hex:65 14 00 00 00 00 8D 09 0C 01 81 88 40 00 02 05 0D 0ABytes are decoded as follows:Offset (dec)C TypeDescription0uint8[2]Header2uint8[3]Unknown—always zeros5int16Channel 1 measurement7int16Channel 2 measurement9uint8Thermocouple type, other data10uint8Display unit, other data11uint8Channel 1 flags12uint8Channel 2 flags13uint8Hours14uint8Minutes15uint8Seconds16uint8[2]CRLFThe update message cannot be expressed as a C struct, as it lacks the proper
alignment.Measurementvaluesareexpressed in tenths of degreesin sign-magnitude format. The sign bit is part of the flag bytes (11 and 12)expressed in the same units as the thermometer is set to display. Byte 10
indicates the unit of measure.Channelflagsare OR'd together:Valid measurement:0x08Invalid measurement:0x40. Channels which do not have a thermocouple
connected will have this flag.Negative measurement:0x80The thermocoupletypeand temperatureunitsare stored in the least
significant nibble of those bytes. The upper nibble contains other data.The above measurement is in degrees Celsius. The channel 1 measurement is-14.1 °C, and the channel 2 measurement is invalid.Further details are included in the python classtc2100.Observation. Unit
tests include more sample data.License -MIT