I made temp logging system with Pi and 4 DS18b20. Sometimes it give wrong temperatures, room/out temp is -999.9 C or -0.1 C or -110 C. What is wrong, Raspberry or wires ?
Sorry my english.
I occasionally get output of "-0.1 C" from my DS18B20 sensors too. It's not really bothered me but you could write in some sort of check that if the output is "-999.9 C or -0.1 C or -110 C" it gets the temperature again.Raspinen wrote:I made temp logging system with Pi and 4 DS18b20. Sometimes it give wrong temperatures, room/out temp is -999.9 C or -0.1 C or -110 C. What is wrong, Raspberry or wires ?
Sorry my english.
Code: Select all
$crcfail = preg_match("/NO/", $thermometerReadings);
while ($crcfail) {
sleep(2);
$thermometer = fopen($thermometer_sensor_path, "r");
$thermometerReadings = fread($thermometer, filesize($thermometer_sensor_path));
$crcfail = preg_match("/NO/", $thermometerReadings);
}Code: Select all
import re
def read_sensor(sensor_slave):
device= '/sys/bus/w1/devices/' + str(sensor_slave) + '/w1_slave'
with open(device, 'r') as searchfile: # check CRC of Sensor
for line in searchfile:
if re.search( r'\NO\s', line, re.M|re.I):
return(9999) # return dummy value which is indicating read error