Skip to content
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

Add support for TemperHUM_V3.8 #34

Open
telmich opened this issue Mar 2, 2022 · 4 comments
Open

Add support for TemperHUM_V3.8 #34

telmich opened this issue Mar 2, 2022 · 4 comments

Comments

@telmich
Copy link

telmich commented Mar 2, 2022

The latest shipment has an updated firmware:

(venv) [13:47] server102.place10:~/temper# python temper.py -l
Bus 001 Dev 001 1d6b:0002   xHCI Host Controller ['hidraw0', 'hidraw1']
Bus 001 Dev 002 046d:0825    
Bus 001 Dev 003 1b3f:2247   GENERAL WEBCAM 
Bus 001 Dev 004 1a86:e025    ['hidraw0', 'hidraw1']
Bus 002 Dev 001 1d6b:0003   xHCI Host Controller 
(venv) [13:47] server102.place10:~/temper# python temper.py --force 1a86:e025
Bus 001 Dev 004 1a86:e025 TEMPerHUM_V3.8 Error: Unknown firmware TEMPerHUM_V3.8: b'8020065a0c360000'

This looks exactly the same as the previous white temperhum devices

@telmich
Copy link
Author

telmich commented Mar 2, 2022

From what I can see the following patch could already be enough for parsing:

@@ -206,7 +208,7 @@ class USBRead(object):
       self._parse_bytes('internal temperature', 2, 100.0, bytes, info)
       return info
 
-    if info['firmware'][:12] in [ 'TEMPerX_V3.1', 'TEMPerX_V3.3' ]:
+    if info['firmware'][:12] in [ 'TEMPerX_V3.1', 'TEMPerX_V3.3', 'TEMPerHUM_V3'  ]:
       info['firmware'] = info['firmware'][:12]
       self._parse_bytes('internal temperature', 2, 100.0, bytes, info)
       self._parse_bytes('internal humidity', 4, 100.0, bytes, info)

We could alternatively also parse for the whole TEMPerHUM_V3.8 string.

As well as adding the valid id list:

    if vendorid == 0x1a86 and productid == 0xe025:
      return True

Adding those two makes temper.py work for me:

(venv) [13:55] server102.place10:~/temper# python temper.py
Bus 001 Dev 004 1a86:e025 TEMPerHUM_V3 15.82C 60.48F 29% - - -

Can you advise which format you'd like for parsing the Firmware ID? Full string (TEMPerHUM_V3.8) or
abbreviated string (TEMPerHUM_V3)? I'll then submit a MR.

@telmich
Copy link
Author

telmich commented Jun 22, 2022

@urwen There are many PRs and issues open - would you be open for somebody else to take over the project? I can fork it, but I have seen that there is another stale fork at https://github.com/ccwienk/temper/ and I'd prefer avoiding to create another fork.

@pierrenicolas-porcinraux

@telmich thanks, I just ran into this new updated firmware this morning, and you patch seems to be working well.
I suggest you send a PR to the fork at https://github.com/ccwienk/temper/ because that fork has more recent activity.

@eode
Copy link
Contributor

eode commented Nov 23, 2022

@telmich We're still taking PRs and issues over on ccwienk/temper. No guaranteed turnaround time, but we do get around to handling them.

We also publish the PyPi package temper_py.

Edit: I started working with that repo after no response from original author here. Given that it has been a good long while, I'm going to actually start deviating where it makes sense to do so rather than keeping the difference to this repo minimal. I.e., rather than just accepting a device add here and there, I might make structural changes where it makes sense to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants