Read Temperature data from TEMPerX USB device (413d:2107) (aka TEMPer V26.1) and write data to InfluxDB. Graph temperature data in Grafana.
Ran into issues getting newer versions of TEMPerX device (413d:2107) (aka TEMPer V26.1) to work in Python3 on Raspberry Pi.
Tried using:
- PyUSB - Complicated and sometimes worked, sometimes didn't.
- python3-hid - Crappy support on Raspian Stretch.
Probably other attempts not mentioned here. All failed horribly, and were huge time vampires.
Discovered hid-query C program could do the job with some simple hex binary bit shift calculation. Rather than rewrite entirely in C, decided to write a hacky wrapper for hid-query in Python3.
Install dependencies and Compile hid-query C library
make
Update Hard-coded InfluxDBClient Variables in init of class function (I realize there's better ways to do this).
Install to /usr/local/sbin (should be in $PATH now).
sudo make install
python3 temperatureMon.py
Uninstall
sudo make uninstall
sudo apt install -y python3 git
Dependencies (assuming you're building on Raspberry Pi or apt package manager based system).
sudo apt install -y make cmake libhidapi-libusb0 libhidapi-dev libhidapi-hidraw0 libusb-dev libusb-1.0-0
Grab the latest TEMPered library if there is a latest. Last I checked it was 5+ years old). Included is a clone from 2018/10.
rm -rf ./TEMPered
git clone https://github.com/edorfaus/TEMPered.git
Run cmake and make inside cloned ./TEMPered directory
cd ./TEMPered
cmake CMakeLists.txt
make
You should now have a compiled version of ./TEMPered/utils/hid-query.
Update Hard-coded InfluxDBClient Variables in init of class function (I realize there's better ways to do this).
python3 temperatureMon.py
Used to keep the script running in the background and restart if there's an issue.
*/5 * * * * root tempMonWatchdog.sh &> /dev/null
Grafana Query settings
Grafana Legend Settings
Grafana Display Settings
References:
- edorfaus/TEMPered#51
- https://github.com/edorfaus/TEMPered.git # Repo where I grabbed hid-query.



