[Patch] OWDevice and OWServer

Begonnen von malc_b, 29 März 2020, 20:45:52

Vorheriges Thema - Nächstes Thema

malc_b

Hi,

Attached are patch files for OWDevice and OWServer, if I have done this right.  These add the following features:

OWServer - set simultaneous/temperature

This kicks all 1-wire thermometers to convert.  This take more power so will only work with powered devices. EN html has been revised but the not the DE.

OWDevice - DS18B20
Set tempres
Get latesttemp

Set tempres sets the resolution on the DS18B20.  The resolution attribute only affects get temperature, making it the same as get temperature9.  Resolution function has been left unchanged for backward compatibility. Get latesttemp works with simultaneous conversion on OWServer.  It gets the latest temperature reading but does not trigger a new conversion so is very fast. EN html has been revised but the not the DE.  These features are all OWFS functions on the latest and the version I have, 3.2p3, but I haven't checked they exist on older versions of owfs.

These changes come about due to doing some timings in a term window on OWFS with DS18B20s

~# owread uncached/28.FF1B40C41704/tempres
           9
~# time owread uncached/28.FF1B40C41704/temperature
      21.375
real    0m0.809s
user    0m0.001s
sys     0m0.020s
~# time owread uncached/28.FF1B40C41704/temperature9
        21.5
real    0m0.329s
user    0m0.001s
sys     0m0.020s
~# time owread uncached/28.FF1B40C41704/temperature9
        21.5
real    0m0.269s
user    0m0.000s
sys     0m0.021s


Note that OWFS, even when tempres is 9 and uncached does not do a fast conversion.  You have to specifically ask for temperature9.  The longer time of 329ms I think is the tempres being changed after the previous conversion. Subsequent temperature9 readings are all shorter.  If I now change the default to 12 bit and retry I get

~# owwrite uncached/28.FF1B40C41704/tempres 12
~# owread uncached/28.FF1B40C41704/tempres
          12
~# time owread uncached/28.FF1B40C41704/temperature9
      21.375
real    0m0.740s
user    0m0.020s
sys     0m0.001s
~# time owread uncached/28.FF1B40C41704/temperature9
      21.375
real    0m0.740s
user    0m0.020s
sys     0m0.001s
~# time owread uncached/28.FF1B40C41704/temperature9
      21.375
real    0m0.742s
user    0m0.003s
sys     0m0.019s


These are all doing 12 bit conversions even though 9 bit is asked for.  I think to reliably get 9 bit conversions you need to set tempres to 9 and do temperature9.  Dropping the uncached complicates the issue but to me it looked like without uncached that OWFS wanted to fill all the resolutions in the cache so always did a 12 bit conversion whatever tempres was set to.

Dr. Boris Neubert

Thanks, will have a look at it but may take some time to respond.
Globaler Moderator, Developer, aktives Mitglied des FHEM e.V. (Marketing, Verwaltung)
Bitte keine unaufgeforderten privaten Nachrichten!