ccwienk / temper

Simple python for accessing TEMPer USB thermometers
MIT License
35 stars 27 forks source link

Unknown firmware TEMPerHUM_V3.9: b'8020096d18d80000' #14

Closed mgutierrezp closed 1 year ago

mgutierrezp commented 2 years ago

Hi,

I'm getting this message: Bus 001 Dev 006 1a86:e025 TEMPerHUM_V3.9 Error: Unknown firmware TEMPerHUM_V3.9: b'8020096d18d80000'

any idea?

EDIT: has nothing to do with a kernel update. It never worked

adubravac commented 1 year ago

i added following code at line 234 (empty line), watch intendation:

if info['firmware'][:16] == 'TEMPerHUM_V3.9':
  info['firmware'] = info['firmware'][:16]
  #Bytes 3-4 hold the device temp, divide by 100
  self._parse_bytes('internal temperature', 2, 100.0, bytes, info, self.verbose)
  #Bytes 11-12 hold the external temp, divide by 100
  self._parse_bytes('external temperature', 10, 100.0, bytes, info, self.verbose)
  #Bytes 5-6 hold the device humidity, divide by 100
  self._parse_bytes('internal humidity', 4, 100.0, bytes, info)      
  return info

print(info['firmware'][:16])
mgutierrezp commented 1 year ago

i added following code at line 234 (empty line), watch intendation:

if info['firmware'][:16] == 'TEMPerHUM_V3.9':
  info['firmware'] = info['firmware'][:16]
  #Bytes 3-4 hold the device temp, divide by 100
  self._parse_bytes('internal temperature', 2, 100.0, bytes, info, self.verbose)
  #Bytes 11-12 hold the external temp, divide by 100
  self._parse_bytes('external temperature', 10, 100.0, bytes, info, self.verbose)
  #Bytes 5-6 hold the device humidity, divide by 100
  self._parse_bytes('internal humidity', 4, 100.0, bytes, info)      
  return info

print(info['firmware'][:16])

works great! thanks for the tip!

eode commented 1 year ago

@mgutierrezp Is the humidity sensor internal or external? Can you describe the device physically or post a couple pictures? I'd like to add it to the device grid and fill out the details.

mgutierrezp commented 1 year ago

the sensor is internal. This is the device:

image image

m

eode commented 1 year ago

Awesome. Thank you, I've updated the code and will release a new version shortly.

eode commented 1 year ago

@mgutierrezp by the way, does this have a temperature sensor as well, or humidity only?

mgutierrezp commented 1 year ago

@mgutierrezp by the way, does this have a temperature sensor as well, or humidity only?

temperature and humidity (internal). I can read both values correctly with the code above

eode commented 1 year ago

Thanks. The PyPi package ~skills~ should work for you now.

mgutierrezp commented 1 year ago

great, thanks for your kind support!