Closed AndyChessum closed 1 year ago
I apologize for the delay in reply.
This happens because the function that calculates the measured temperature (esp_err_t ds18x20_read_temperature(gpio_num_t pin, ds18x20_addr_t addr, float *temperature)
)
cannot understand which family the sensor belongs to (because of DS18X20_ANY instead of address). In this case please use an explicit read/measure function, i.e. change the example, instead of:
res = ds18x20_measure_and_read(SENSOR_GPIO, SENSOR_ADDR, &temperature);
use
res = ds18b20_measure_and_read(SENSOR_GPIO, SENSOR_ADDR, &temperature);
I made changes to the driver and now in this case (impossibility to determine the sensor family) it will give an error.
The issue
Hi,
I tried both the multi and single example code in PlatformIO with a single DS18B20 sensor. The multi example worked fine, but the single example reported a temperature of 204 degrees. When I replaced DS18X20_ANY with the actual address of the sensor, the correct temperature was reported.
I have tried different sensors (always one at a time) and am using an external 4.7K resistor, as suggested.
Which SDK are you using?
esp-idf
Which version of SDK are you using?
master
Which build target have you used?
Component causing the issue
DS18x20
Anything in the logs that might be useful for us?
Additional information or context
erbose mode can be enabled via
-v, --verbose
option CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html PLATFORM: Espressif 32 (5.0.0) > NodeMCU-32S HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa) PACKAGES:Confirmation