DS18B20 error
Posted: Wed Oct 26, 2016 4:35 pm
As far as I can tell there is an issue reading DS18B20 sensors with recent firmware, where the normal usage fails during the DS18X20.scan() call. That seems to be because the filter for DS18X20 types onewire devices rejects ROMs that it should accept (or else the ROMs are being read incorrectly). Removing this filter with
seems to execute without error and give sensible temperature readings, if only DS18X20 sensors are present.
Has anyone else run into this issue and come up with a more confidence-inspiring fix?
Code: Select all
class DS18X20:
def __init__(self, onewire):
self.ow = onewire
self.buf = bytearray(9)
def scan(self):
return [rom for rom in self.ow.scan()]
#return [rom for rom in self.ow.scan() if rom[0] == 0x10 or rom[0] == 0x28]
Has anyone else run into this issue and come up with a more confidence-inspiring fix?