SuperHouse / esp-open-rtos

Open source FreeRTOS-based ESP8266 software framework
BSD 3-Clause "New" or "Revised" License
1.53k stars 491 forks source link

Possible problem with negative temperature on DS18B20 sensor using ds18b20_read_single() func #700

Open RavenSystem opened 5 years ago

RavenSystem commented 5 years ago

It seems that DS18B20sensor does not correctly read negative temperatures.

https://github.com/RavenSystem/esp-homekit-devices/issues/208#issuecomment-468413809

k-korn commented 5 years ago

Works fine for me with ds18b20_measure_and_read_multi()

RavenSystem commented 5 years ago

I am using ds18b20_read_single()

k-korn commented 5 years ago

Looks like there are 2 different approaches to calculate temperature, at https://github.com/SuperHouse/esp-open-rtos/blob/master/extras/ds18b20/ds18b20.c#L111 and https://github.com/SuperHouse/esp-open-rtos/blob/master/extras/ds18b20/ds18b20.c#L183

RavenSystem commented 5 years ago

So bug is only related to ds18b20_read_single() function.