1

I have five DS18B20 thermometers in my greenhouse connected to my Raspberry Pi Model B Plus Rev 1.2.

It is running Raspbian GNU/Linux 10 (buster).

Here you can see that the two thermometers which are ~15cm under the soil report 0.187°C and 0.875°C, which is reasonable as it has ~-5°C outside.

The three other sensors which are in the air report bogus values. This is due to some incompatibility with the software with my old pi, as

  1. my pi zero with the exact same hardware (apart from being a zero instead of a b+, meaning: same little board with a 4.7kΩ resistor also driving multiple thermometers connected to the same gpio pins) and software setup can read negative degrees
  2. it could read negative degrees just fine when I was still running minibian (on the b+) and not the latest version of raspbian (on the b+)
root@raspberrypi:/sys/bus/w1/devices# for d in 28-*
> do
> pushd $d
> cat w1_slave
> popd
> done
/sys/bus/w1/devices/28-01191a0f798a /sys/bus/w1/devices
b4 ff 4b 46 7f ff 0c 10 b5 : crc=b5 YES
b4 ff 4b 46 7f ff 0c 10 b5 t=4091250
/sys/bus/w1/devices
/sys/bus/w1/devices/28-01191a40cfa1 /sys/bus/w1/devices
0e 00 4b 46 7f ff 0c 10 71 : crc=71 YES
0e 00 4b 46 7f ff 0c 10 71 t=875
/sys/bus/w1/devices
/sys/bus/w1/devices/28-01191a42fc0d /sys/bus/w1/devices
03 00 4b 46 7f ff 0c 10 0d : crc=0d YES
03 00 4b 46 7f ff 0c 10 0d t=187
/sys/bus/w1/devices
/sys/bus/w1/devices/28-01191a4d5e9c /sys/bus/w1/devices
9a ff 4b 46 7f ff 0c 10 a4 : crc=a4 YES
9a ff 4b 46 7f ff 0c 10 a4 t=4089625
/sys/bus/w1/devices
/sys/bus/w1/devices/28-01191a63a353 /sys/bus/w1/devices
ad ff 4b 46 7f ff 0c 10 88 : crc=88 YES
ad ff 4b 46 7f ff 0c 10 88 t=4090812
/sys/bus/w1/devices

Here is an image showing that the sensors are not broken, when holding them in my hand they report data as they get warm and go above 0°

Here is an image showing that the sensors are not broken, when holding them in my hand they report data as they get warm and go above 0°C

My questions:

  1. Who do I have to send a bug report to?
  2. Is there a workaround?
  3. Can anyone that can read hex and knows their way around integers tell me how to extract the correct values out of the code block above?
14
  • Post the code that you are using.
    – CoderMike
    Feb 7, 2021 at 18:59
  • @CoderMike you can see it at the top of the command block: root@raspberrypi:/sys/bus/w1/devices# for d in 28-* > do > pushd $d > cat w1_slave > popd > done Feb 7, 2021 at 19:10
  • @CoderMike and then it says t=4090812 and that's 4 million degrees. When reading the "temperature" file instead of w1_slave it says the same Feb 7, 2021 at 19:11
  • only the first two bytes appear to be related to the temperature, if it is temperature related .... first one could be FFB4, which is decimal -76 ... the others 000E = 14, 0003 = 3, FF9A = -102, FFAD = -83
    – jsotola
    Feb 7, 2021 at 19:21
  • 1
    It's not 4 million Celsius off, it's 4096 (2^12). But the value given is otherwise good. Depends on what you do with temperatures later, but I just check if temperature is over 100C and then subtract 4096 if it is. Your example of 4090812 divided by 1000 and minus 4096 gives quite probable -5.188C Feb 7, 2021 at 20:40

1 Answer 1

1

This is fixed in the latest updates: https://github.com/raspberrypi/linux/issues/4124#issuecomment-775210673

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.