-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for product ID 413d:2107 #84
Comments
Yes same need. I have a TEMPerX232 (thermo-hygrometer) with that ID and I can't make it work as my others Temper1F. |
Hi I use temper-python with my Microdia TEMPer Temperature Sensor (0c45:7401) and it works like a charm. I, as well, was too adventurous when buying an obscure "TEMPerHUM" (413d:2107). It would be great to have support for this device in temper-python! Thanks for your work! |
I've created a working Munin plugin for our device using hid-query: https://github.com/mreymann/temperx |
Hoping that this comment will help temper-python to support devices with id 413d:2107 I should note that running this hid-query gives you the temperature (hid-query is part of https://github.com/edorfaus/TEMPered more info bellow):
P.S. Until temper-python supports them here's a complete set of commands to print the temperature:
The above are 99% based on TEMPered#51 "hack" from digiboule mentioned above. To install TEMPered (that contains the hid-query utility) download it and see this post edorfaus/TEMPered#35 (comment) P.S.3: I must admit that I'm really confused by who forked what version of TEMPered to support which device type. P.S.4: Here's a copy of my bash session that ended up on the above commands:
|
As I mentioned at edorfaus/TEMPered#35 (comment) I have one of these new 413d:2107 devices which the Windows "TEMPer V26.1" software calls "Firmware: TEMPerGold_V3.1" and mine is I think temperature only, although the hidapi testgui app shows two devices with that VID:PID. The eight-byte hex string posted by ndemou above, does work when manually entered from the hidapi testgui. However the TEMPered project "hid-query" tool does not see the device at all (only sees my keyboard and mouse) so I don't know how to script this. |
@jbeale1: mine is also temperature only and if you notice in the transcript above I also see two devices and one of them doesn't respond. |
It does work! After keyboard and mouse, it's hidraw3 on my system. Also needs 'sudo'
|
Edit: awk works for float division, or after doing "sudo apt-get install bc"
|
Bash script to print time & temp every ~15 sec, with readTEMPer.sh being my script in above comment:
example output:
|
Thanks @jbeale1 for noticing the bug with integer arithmetic. I fixed my script (just used awk instead of bc because it works perfectly for such low precision calculations and is pre-installed almost everywhere) |
On my raspberry pi, 'awk' is apparently mawk 1.3.3 and it always gives me 0.0 for example:
Edit: after 'sudo apt-get install gawk' then it all works as intended. |
Right again. A cross platform way seems to be
(I've updated my script) |
I also have a 413d:2107 device. It is supposed to do both T and R.H.: vendor, Amazon. By pressing the button, I can get it to operate like a keyboard and just dump its output to My biggest issue right now is that I should add that my device is called "TemperX232". I know that some other devices also use the same 413d:2107 USB identifier (for instance the newer "TemperHum" devices). |
@schniepp have you tried all devices that |
Yes. The other two ones are only my external keyboard and mouse. The one that I am using reports the correct USB ID. |
After logging for two days, I see the output of my TEMPer has a nominal 0.06 C resolution. I haven't done a careful calibration, but the plot shows big flat spots at fixed values like it gets stuck. It is not, but clearly it can not reliably measure changes smaller than 0.5 C. Example plot: https://photos.app.goo.gl/HEiZdxNJTLN1RLUf7 |
I received a 413d:2107 from amazon, and though it reports two USB devices (keyboard/USB device), I can only seem to get data from the usb device. I don't have a button to send keyboard input. The temp it reports back is way too high to make sense. It was commented elsewhere that there is an internal and external temp that can be reported. I'm worried that I'm only seeing the internal temp, if that's the case. |
same here, got the 413d:2107 version and really like to see this usbstick supported 😄 |
I am currently using this script to read the raw USB values from the 413d:2107
I built TEMPered, and it has an hid-query, which I can use to get the raw sensor values. |
This totally fixed my problems: urwen/temper. What brought me on this track: the Firmware version using the Windows software reads as "TEMPerX232_V2.0". |
A fork of it has several improvements. It also has a setup.py so it can be installed in a python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install --upgrade https://github.com/ccwienk/temper/archive/master.zip
And used as a module instead of a command (in Python) like: from temper import Temper
tmpr = Temper()
if not hasattr(tmpr, 'usb_devices'):
print("You have the wrong temper. Get ccwienk/temper (or the old urwen/temper).")
devices = tmpr.read()
for i in range(len(devices)):
print("{} C".format(devices[i]['internal temperature'])) |
I was able to get my Temper2 device working in windows. You will need to download libusb-1.0.26-binaries and unzip it in the project directory. For windows, this is what I needed. This device is VID 0x431D PID 0x2107. There is no product name in the USB descriptor, so there's no good way to tell it apart from any of the others except for VID/PID. It does have 2 endpoints. The first is a keyboard endpoint. The other is the temperature interface. This device has a button on it. It has an internal temp measurement and an external measurement probe. To get both sensor readings, you write the USB commands for init, then send USB command to read temp, then complete 2 reads. The first read is the internal temp (offset 2 in the 8 byte data) then divide by 100.0. The second read is the external temp (offset 2 in the 8 byte data) then divide by 100.0. I've attached a modified temper.py file. I'm sorry it is such a hack, but I just needed something quick. This at least gives the coders maintaining this to potentially add it. Though I'm not sure if it'll work since all the others have product names. This one does not and that is how they are differentiated in the code. This one is definitely different than the others. Again, my apologies for the hack job of this beautiful code, but I also wanted to give back since this gave me a great starting point. |
@acs4design Thanks for sharing this. Is your sensor like one of the ones here?: https://usb-ids.gowdy.us/read/UD/413d/2107 Please could you double check the description strings to see if there's anything uniquely identifiable about the sensor that we can use to select the correct decoding? I don't have one of these sensors so I'm also looking for someone who can help me with testing a patch for this new sensor. |
I can't find anything in the descriptor itself. Perhaps, there are other
methods to determine a way to discriminate it from the others by receiving
the output reports. Their software somehow knows which Temper device it is
because their software supports all of their USB sticks. I used the
application that came with the stick to get it running while I did a USB
capture. I used USBlyzer software to capture the USB data while it was
recording temperatures. You can open the .ulz file with that software and
see the captured data.
I have attached the complete Device Descriptor (.html in zip), USB packet
capture(.ulz in zip) and pictures :)
![Temper2-Back](https://user-images.githubusercontent.com/41488313/198361257-b986c482-e7bb-4e90-9662-a242d2d1c554.jpg)
![Temper2-Front](https://user-images.githubusercontent.com/41488313/198361260-b237e83a-098d-4de2-8cd4-43a23fb66cd6.jpg)
[USB Captures.zip](https://github.com/padelt/temper-python/files/9881946/USB.Captures.zip)
|
Most recent sensors seems to have a new ID, 413d:2107.
Has anyone successfully hacked the code to work with it?
this C hack seems to work.
edorfaus/TEMPered#51
Thank you.
The text was updated successfully, but these errors were encountered: