Ds18b20 wrong value if temperature is below 0 degrees

Remember this used to work, until an upgrade of node-red, though whether that is actually the cause remains to be seen. There can't be a fundamental issue in the ds18b20 node or it would never have worked.

Yes I am aware of that. I was merely trying to explain what is at the heart of the issue - why you see the number 4039.9

OK, understood.
@Speedy are you absolutely certain this used to work?

Yes! You see, that till to the update the negative outdoor temperature is shown. There are 13 ds18b20 sensors. They work. I've stop the connect to database because 4000 is not so good for display :wink:

Have you done that yet?

Sorry, what you mean?

I can't reply because i a new member.
Here the Output from the Script:

 rom: 28-012032f2a482
 temp : 4090.312 Ā°C
 temp : 4090.312 Ā°C
 temp : 4090.312 Ā°C

 rom: 28-012032f2a482
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675

I've only one raspberry and the sensor ist ok if the temperature is positive. Before the last update, the values was ok.

I linked to a tutorial that told you how to do that, and have repeatedly suggested you do it.

Also, are the other channels on the same pi or on a different one?

Hi,

Have you checked if the DS18B20 is still good?

I have had several failed on me, as mostly what we have available here are fakes.

Please refer to the below, quite a bit of information on the DS18B20

I can't reply because i'm a new member.

Here the Output from the Script:

 rom: 28-012032f2a482
 temp : 4090.312 Ā°C
 temp : 4090.312 Ā°C
 temp : 4090.312 Ā°C

 rom: 28-012032f2a482
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675
 C=4090.375  F=7394.675

I've only one raspberry and the sensor ist ok if the temperature is positive. Before the last update, the values was ok.

In order to prove whether it is the node-red update you can go back to the version you had previously, using
sudo npm install -g --unsafe-perm node-red@a.b.c
where a.b.c is the version you want.

The script output suggests that it is a clone rather than original (but so are some of mine and they work ok) but it also shows the wrong values, so that suggests it is nothing to do with node-red. Can you swap it for a different sensor to see if that is the problem?

Assuming the script works with -ve values of course.

Hi, i've check with other sensors - same issue. The positive values are ok. Why? I don't think its a sensor problem.

What is with the info from user RadioFlyer?
"This will turn all negative numbers into large positive ones. For example, 0xFFF8 is -0.5 degrees, but as a positive number it is 65528 and dividing by 16 gives you 4095.5."

And here:

Why shouldt the sensors this week die? I think is any update!?

This packages was updated before the problem:

Upgrade: libraspberrypi-bin:armhf (1.20210108-1, 1.20210201-1), libraspberrypi-dev:armhf (1.20210108-1, 1.20210201-1), libraspberrypi-doc:armhf (1.20210108-1, 1.20210201-1), xserver-common:armhf (2:1.20.4-1+rpt2+deb10u2, 2:1.20.4-1+rpt2+deb10u3), libldap-2.4-2:armhf (2.4.47+dfsg-3+rpi1+deb10u4, 2.4.47+dfsg-3+rpi1+deb10u5), xserver-xorg-core:armhf (2:1.20.4-1+rpt2+deb10u2, 2:1.20.4-1+rpt2+deb10u3), libsystemd0:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), node-y18n:armhf (3.2.1-2, 3.2.1-2+deb10u1), nodered:armhf (1.0.6-1, 1.2.9-1), rpi-eeprom:armhf (11.5-1, 11.6-1), libsnmp-base:armhf (5.7.3+dfsg-5+deb10u1, 5.7.3+dfsg-5+deb10u2), node-ini:armhf (1.3.5-1, 1.3.5-1+deb10u1), sudo:armhf (1.8.27-1+deb10u2, 1.8.27-1+deb10u3), udev:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), libmagic1:armhf (1:5.35-4+deb10u1, 1:5.35-4+deb10u2), libpq5:armhf (11.9-0+deb10u1, 11.10-0+deb10u1), libudev1:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), geoclue-2.0:armhf (2.5.2-1, 2.5.2-1+deb10u1), raspberrypi-kernel:armhf (1.20210108-1, 1.20210201-1), device-tree-compiler:armhf (1.4.7-3+rpt1, 1.4.7-4), raspberrypi-bootloader:armhf (1.20210108-1, 1.20210201-1), libsnmp30:armhf (5.7.3+dfsg-5+deb10u1, 5.7.3+dfsg-5+deb10u2), libmagic-mgc:armhf (1:5.35-4+deb10u1, 1:5.35-4+deb10u2), bluez-firmware:armhf (1.2-4+rpt7, 1.2-4+rpt8), systemd-sysv:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), libldap-common:armhf (2.4.47+dfsg-3+rpi1+deb10u4, 2.4.47+dfsg-3+rpi1+deb10u5), libpam-systemd:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), systemd:armhf (241-7~deb10u5+rpi1, 241-7~deb10u6+rpi1), libraspberrypi0:armhf (1.20210108-1, 1.20210201-1), iproute2:armhf (4.20.0-2, 4.20.0-2+deb10u1), unzip:armhf (6.0-23+deb10u1, 6.0-23+deb10u2), grafana:armhf (7.3.7, 7.4.0), file:armhf (1:5.35-4+deb10u1, 1:5.35-4+deb10u2), libgnutls30:armhf (3.6.7-4+deb10u5, 3.6.7-4+deb10u6), ca-certificates:armhf (20200601~deb10u1, 20200601~deb10u2), lxplug-volumepulse:armhf (0.3, 0.4), teamviewer-host:armhf (15.13.6, 15.14.5), raspberrypi-sys-mods:armhf (20201026, 20210208), base-files:armhf (10.3+rpi1+deb10u7, 10.3+rpi1+deb10u8), tzdata:armhf (2020e-0+deb10u1, 2021a-0+deb10u1)

I asked you about that earlier, and I thought your reply meant that you had submitted that issue. If that was not you then that does suggest an update problem, though I don't think it is the node-red update that caused it, more likely something in the system.
I can't investigate in detail because I don't use the system method of reading the sensors, I use owserver.
Do you have an SD card backup of your previous working system?

Also please tell us what you see in the /sys/... file that I keep asking for (as described in the linked tutorial). If you tell me that then I can look at the node's code and hopefully work out what is going on. I can see where it may be failing is something in the system 1-wire driver has changed, but without knowing what is there I have no way of knowing what to do.

Edit: In case a problem has already been found and fixed, run
sudo apt update && sudo apt full-upgrade
again.

Thank you for your help. I'm not a linux nerd. What for a /sys/ you mean? I backup the database daily and i've a backup from the Node flow. SD-Card Backup is not available.

Have you read the link I posted in post 14? In particular the section Read Temperature.

28-012032f2a482 $ cat w1_slave 
d4 ff 4b 46 7f ff 0c 10 54 : crc=54 YES
d4 ff 4b 46 7f ff 0c 10 54 t=4093250

Well that confirms that it is nothing to do with node-red, as the data in the pseudo file is wrong (it isn't a real file I don't think, the system makes it look as if it is).

Did the update command (sudo apt update && sudo apt full-upgrade) followed of course by a reboot just in case, make any difference.