mcsakoff / pydigitemp

Python implementation of 1-Wire protocol.
Other
16 stars 11 forks source link

Issue with DS18S20 device #7

Closed ssjoholm closed 3 years ago

ssjoholm commented 6 years ago

When reading via pyDigiTemp I get inconsistent results, compared to DigiTemp.

PyDigiTemp;

root@sbcctrl:~/digitemp# python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from digitemp.master import UART_Adapter
>>> from digitemp.device import DS1820
>>> bus = UART_Adapter('/dev/ttyUSB5')
>>> sensor = DS1820(bus)
>>> print sensor.info()
Bus: /dev/ttyUSB5
Device: DS18S20 - High-precision Digital Termometer
ROM Code: 1048293103080071
Power Mode: external
Connection Mode: single-drop
Alarms: high = +75 C, low = +70 C
None
>>> print sensor.get_temperature()
17.38
>>> print sensor.get_temperature()
15.5
>>> print sensor.get_temperature()
16.13
>>> print sensor.get_temperature()
14.06
>>> print sensor.get_temperature()
16.19
>>> 
root@sbcctrl:~/digitemp#

DigiTemp;

root@sbcctrl:~/digitemp# digitemp_DS9097 -i -s /dev/ttyUSB5 -a
DigiTemp v3.7.1 Copyright 1996-2015 by Brian C. Lane
GNU General Public License v2.0 - http://www.digitemp.com
Turning off all DS2409 Couplers
.
Searching the 1-Wire LAN
1048293103080071 : DS1820/DS18S20/DS1920 Temperature Sensor
ROM #0 : 1048293103080071
Wrote .digitemprc
Jul 26 08:31:38 Sensor 0 C: 26.50 F: 79.70
root@sbcctrl:~/digitemp#
mcsakoff commented 3 years ago

I believe it is fixed in 7fd219f. Also, now you can put DS18S20 in non-precise mode, that is actually a normal mode.