-
Notifications
You must be signed in to change notification settings - Fork 50
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
A hack to support TEMPer2 / TEMPerX_V3.2 / 413d:2107 #51
Comments
Hi, and thanks for your hack. To elaborate on my case. I bought this this, also having the rather unknown vendor- and product id
When i press the little button on the thingy it pastes to by computer (as a HID):
I also opened the sensor to see if their where indication of what sensor it used but all that was imprinted on the card was «TEMPerX_P5» and the date «20170901». |
This hack worked for me too. Apparently I have the same device; nothing else would work for it but this. Nice, thanks. |
I have a temper2 with the ID 413d:2107. The hack works for me when using the command "hid-query /dev/hidraw1 0x01 0x80 0x33 0x01 0x00 0x00 0x00 0x00" to read back the raw data in bytes. However, when applying the hack so TEMPERed gives back the right data in Celsius I get the internal sensor data repeated twice, ie. no external data! Here is what I have done.
|
"However, when applying the hack so TEMPERed gives back the right data in Celsius I get the internal sensor data repeated twice, ie. no external data!" As a possible clue, in my case the device sends two responses instead of one (yes, not a double-length response, but two responses). I couldn't figure out a straightforward way to modify the TEMPered framework to accomodate this strange case, which is why I hacked hid-query instead. Perhaps your humidity issue is similar? I'm attaching a copy of my hacked utils/hid-query.c and libtempered/temper_type.c. |
I also get data repeated twice (also the temp is wrong).
What I am not sure about is that and yet .....
Any pointers in general direction to fix the temp reading, also to be able to read the humidity would be greatly appreciated |
If you wanna stop seeing two sensors in the response try this:
That's a modification on the snipped @kenkma shared. |
First, thanks all for your previous posts. I managed to read both temperatures from a USB TEMPerX_V3.2.
Then, update temper_type.c to use the correct offset :
And finally in tempered_type_hid_get_temperature_fm75 : |
Thanks guys! I have one of these that reports as "TEMPerGold_V3.1". It has a simple temp sensor and no button. With the patch above it works fine. |
@garyemiller please could you share your patched source bundle? |
I'm not sure what has gone wrong with my patching but these are my results for a
but
The latter works fine and can be crudely parsed so i'm happy with that. |
I was having issues with 413d:2107 and found that https://github.com/mreymann/temperx supports 413d:2107 beatifully. |
I have a TemperX232with 413d:2107, but cannot write data to it, as I just described here. |
I dockerfied the project in https://github.com/hbt/TEMPered so you only need to type Tested with 413d:2107 only |
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". |
You need to switch to a US keyboard layout to fix this output. |
Hi guys, |
I purchased this USB stick with an external sensor, and did not have any luck finding Linux drivers.
After a few hours I managed to hack a way to read the temperatures.. it's ugly, but it works and gives identical readings to the "TXT" feature controlled by caps lock and num lock.
Initially running TEMPERed gave the error "Failed to enumerate devices: (null)". lsusb shows the device has ID 413d:2107, so I opened temper_type.c and tried changing the vendor and product id for the "TEMPerV1.2 or TEMPer2V1.3" section from 0c45:7401 to 413d:2107 to see what would happen.
Then I got the error "/dev/hidraw1: Could not open device: Unknown device subtype ID: 0x04". I added a new subtype block with id = 4, based on the id = 2 section. That got TEMPered to recognize and talk to the device, however the two temperatures shown when running the "tempered" command are incorrect.
"hid-query /dev/hidraw1 0x01 0x86 0xff 0x01 0x00 0x00 0x00 0x00" returns hex values for the string:
"TEMPerX_V3.2 "
Similar to what was noted in the description of a different device, a single query results in two responses:
"hid-query /dev/hidraw1 0x01 0x80 0x33 0x01 0x00 0x00 0x00 0x00" returns::
Response from device (8 bytes):
80 80 09 98 4e 20 00 00
Response from device (8 bytes):
80 01 07 c9 4e 20 00 00
Here the internal temperture is represented by "09 98", and the external temperature by "07 c9". Below is the C code to convert these to the actual values in degrees celsius:
unsigned char high_byte = data[2];
unsigned char high_byte = data[3];
int temp = (high_byte <<8) + low_byte;
float tempC = (float)temp / 100.0;
I was unable to devise a simple way to make TEMPer handle the two responses properly under its existing framework, so instead I quickly hacked the hid-query.c utility to decode and display the temperatures on its own.
The text was updated successfully, but these errors were encountered: