-
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
TEMPer1F H1 not working #39
Comments
it seems that we could trick the code somewhere at libtempered/type_hid/common.c to allow more compatible string ID to pass through before it is formally supported, But I am too old (too long ago) coding the C driver, Could someone help? Cheers |
When I ran tempered I got the following response: /dev/hidraw6: Could not open device: Unknown device subtype string: TEMPer1F_H1V1.5F However this is the following output from lsusb -v -s us 003 Device 075: ID 0c45:7402 Microdia TEMPerHUM Temperature & Humidity Sensor After a bit of playing around I added the following to temper_type.c, and recompiled:
Running tempered produced the following result: /dev/hidraw6 0: temperature 153.62 °C, relative humidity 87.7%, dew point 148.9 °C So it's reading the device but not returning the right results. |
Change the following lines:
Because in this humidity usb sensor the SHT20 sensor is used. I think that should work. |
Using the following patch: diff --git a/libtempered/temper_type.c b/libtempered/temper_type.c
index 1b00b20..ab416f9 100644
--- a/libtempered/temper_type.c
+++ b/libtempered/temper_type.c
@@ -37,6 +37,7 @@ struct temper_type known_temper_types[]={
.subtype_strings = (char *[]){
"TEMPerHumV1.0rHu",
"TEMPerHumM12V1.0",
+ "TEMPer1F_H1V1.5F",
NULL
}
},
@@ -103,6 +104,37 @@ struct temper_type known_temper_types[]={
}
}
},
+ (struct temper_subtype*)&(struct temper_subtype_hid){
+ .base = {
+ .id = 0x02 ,
+ .name = "TEMPer1F_H1V1.5F",
+ .open = tempered_type_hid_subtype_open,
+ .read_sensors = tempered_type_hid_read_sensors,
+ .get_temperature = tempered_type_hid_get_temperature,
+ .get_humidity = tempered_type_hid_get_humidity
+ },
+ .sensor_group_count = 1,
+ .sensor_groups = (struct tempered_type_hid_sensor_group[]){
+ {
+ .query = {
+ .length = 9,
+ .data = (unsigned char[]){ 0, 1, 0x80, 0x33, 1, 0, 0, 0, 0 }
+ },
+ .read_sensors = tempered_type_hid_read_sensor_group,
+ .sensor_count = 1,
+ .sensors = (struct tempered_type_hid_sensor[]){
+ {
+ .get_temperature = tempered_type_hid_get_temperature_sht1x,
+ .get_humidity = tempered_type_hid_get_humidity_sht1x,
+ .temperature_high_byte_offset = 2,
+ .temperature_low_byte_offset = 3,
+ .humidity_high_byte_offset = 4,
+ .humidity_low_byte_offset = 5
+ }
+ }
+ }
+ }
+ },
NULL // List terminator for subtypes
}
}, I get the following readings:
The temperature is way off; a standalone thermometer agrees with the external sensor (1) on the 1st USB device, that the temperature in the room is around 22.5°C. |
Yes I have the same problem. The temperature in this senor is not very accurate :-(. |
The patch from yrro fixed the issue for me. The device was received today from aliexpress. Maybe this is the new version. I can also confirm, that the sensors are pretty bad calibrated. Temperature shown is about 3-4°C too high and humidity about 20% too high. |
Just did some more tests with this device. I'm currently getting a temperature reading of 25.47 °C and a humidity reading of 49% when reading the device from Linux. However, if I plug it into a Windows system and press the button it it to activate the keyboard input function, it dutifully types out a temperature of 22.35 °C and a humidity reading of 39.9%. these readings are a lot closer to those given by the other devices I have lying around, although the temperature is still a little high. It's frustrating that the device itself seems to have calibration data locked away somewhere inside, without giving the user the ability to access it! |
Hi, Firstly, is this project still alive? I can see few quite recent comments but the last commit was about 5 years ago. There are pending pull requests starting from 2013. Now, if anybody is still maintaining this project I got this device working (for another project). I don't have the time to write the driver as I do not use this project but here are all the details that are needed for someone to add the support for this device as well: I opened the device and found an SHT20 sensor inside. As far as I know no other TEMPer device is using this sensor. The data is read using one of the standard reading commands, { 0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00 }. The data arrives in the usual 6-byte format, the temperature high & low is at offsets 2 & 3 while the humidity is at 4 & 5. The code to get the temperature and humidity may look like this (in c#):
Important: The Windows software that came with the device DOES NOT work correctly. I hope this helps someone. |
Hey @axsdenied, the project seems inactive but the wiki is still a useful place to note your discoveries - assuming it's 0c45:7402 then add it to TEMPer2HumiV1.x (or maybe a separate page under 0C45:7402, since the name is different... and I admittedly haven't done this for my 1.5 device yet... 🙇) Actually it's interesting that you note you have an SHT20 inside your device. Are the reading conversion formulas different from those of the SHT1x?. Perhaps that explains why the readings from my device are so off... And don't worry about the Windows software--it's complete nonfunctional garbage. It doesn't run on my system, so I made the mistake of decompiling it... never again... ;) |
Hi @yrro, thank you for the update. I will update the wiki. The conversion formulas are different for SHT1x and for SHT20. If I use the SHT1x formulas with my device the measured temperature is about 3 degrees C higher than the real temperature and also the humidity was about 10-15% higher (the difference is not constant and will vary with the ambient temperature and humidity). This difference is similar to what you mentioned in your comments above. Chances are that your device is using SHT20 as well. You should try changing the formula to what I had above, I am curious to see if it fixes the problem. |
I have added pages for SHT20 and TEMPer1F_H1_V1.x. @yrro, if your v1.5 device works with the new formulas for SHT20 you can just add it to TEMPer1F_H1_V1.x |
Hello folks,
the tempered package I installed actually is functioning because I could do all utils and examples code for this one, all work.
http://goods.ruten.com.tw/item/show?21439300929462
But I have another temp + external humidity usb sensor TEMPer1F H1
http://www.pcsensor.com/usb-hygrometer/temper1f_h1.html
the following problems show it is currently unspported
./enumerate
Found device: 0c45:7402 1 | /dev/hidraw1 | TEMPer2HumiV1.x
./read-all
Device /dev/hidraw1 : USB IDs 0c45:7402, interface 1
Enumeration type name: TEMPer2HumiV1.x
Open failed, error: Unknown device subtype string: TEMPer1F_H1V1.4F
./read-repeat /dev/hidraw1
Opening /dev/hidraw1 failed, error: Unknown device subtype string: TEMPer1F_H1V1.4F
./tempered
/dev/hidraw1: Could not open device: Unknown device subtype string: TEMPer1F_H1V1.4F
hid-query -e
/dev/hidraw0 : 0c45:7402 interface 0 : RDing TEMPer1F_H1_V1.4
/dev/hidraw1 : 0c45:7402 interface 1 : RDing TEMPer1F_H1_V1.4
Fortunately query did get response
hid-query /dev/hidraw1 1 0x80 0x33 1
Device /dev/hidraw1 : 0c45:7402 interface 1 : RDing TEMPer1F_H1_V1.4
Writing data (9 bytes):
00 01 80 33 01 00 00 00 00
Response from device (8 bytes):
80 04 19 1c 05 e6 34 46
it seems that only the subtype things unknown,
the query format is actually working.
I wonder how I could go further to make it work, could someone point me out what should I do (to provide more test for you? to setup/change something you need?)
Thanks in advance.
Cheers
Joshua
P.S. I am testing it in Centos 7.1 x86_64 with all git latest version of hidapi and
libusbx-devel-1.0.15-4
libgudev1-219-19
cmake-2.8.11-4
dmesg said
[18084.109650] usb 3-1: new low-speed USB device number 11 using xhci_hcd
[18084.280555] usb 3-1: New USB device found, idVendor=0c45, idProduct=7402
[18084.280565] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[18084.280570] usb 3-1: Product: TEMPer1F_H1_V1.4
[18084.280574] usb 3-1: Manufacturer: RDing
[18084.283588] usb 3-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[18084.283604] usb 3-1: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[18084.286921] input: RDing TEMPer1F_H1_V1.4 as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/input/input22
[18084.287708] hid-generic 0003:0C45:7402.0013: input,hidraw0: USB HID v1.10 Keyboard [RDing TEMPer1F_H1_V1.4] on usb-0000:00:14.0-1/input0
[18084.290523] hid-generic 0003:0C45:7402.0014: hiddev0,hidraw1: USB HID v1.10 Device [RDing TEMPer1F_H1_V1.4] on usb-0000:00:14.0-1/input1
[18185.162168] usb 3-1: USB disconnect, device number 11
[18185.508670] usb 3-1: new low-speed USB device number 12 using xhci_hcd
[18185.679617] usb 3-1: New USB device found, idVendor=0c45, idProduct=7402
[18185.679628] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[18185.679634] usb 3-1: Product: TEMPer1F_H1_V1.4
[18185.679639] usb 3-1: Manufacturer: RDing
[18185.680209] usb 3-1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[18185.680234] usb 3-1: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes
[18185.684449] input: RDing TEMPer1F_H1_V1.4 as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/input/input23
[18185.685312] hid-generic 0003:0C45:7402.0015: input,hidraw0: USB HID v1.10 Keyboard [RDing TEMPer1F_H1_V1.4] on usb-0000:00:14.0-1/input0
[18185.687767] hid-generic 0003:0C45:7402.0016: hiddev0,hidraw1: USB HID v1.10 Device [RDing TEMPer1F_H1_V1.4] on usb-0000:00:14.0-1/input1
The text was updated successfully, but these errors were encountered: