New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error ds18b20 with esp32 #57
Comments
I found to have the same issue however ONLY THE FIRST time around after reset/reboot. The ESP32 library is using the fastmicroseconds() as mentioned in expressif link above. To get around that the IRAM_ATTR had to be added. As I use the library on different boards and want to keep one source the following 3 changes can be applied: in Onewire.h (around line 99)
#if defined (ARDUINO_ARCH_ESP32) in onewire.cpp (around line 204): in onewire.cpp (around line 236) |
I can confirm the problem for the first incorrect reading when using ESP32. It has been so long that the bug is still there. And the above fixes the problem. |
it works! I lost a day trying to understand why the "OneWireSerch" example does not work (it puts the search function in the setup, therefore it is performed only once after the reset, therefore ESP32 does not execute it) |
The solution offered in milesburton/Arduino-Temperature-Control-Library#168 (comment) works for me. Tested with 1, 2 and 3 sensors. A bit of a hack having to call
Used the same wiring setup as milesburton/Arduino-Temperature-Control-Library#85 (comment) on an ESP32-PICO-MINI-02 EDIT: I contacted Maxim Integrated (manufacture of DS18B20 sensor) and found out my sensors are counterfeit, not sure if this is why they require the extra call or if the legit ones also have the same issue. |
@PaulStoffregen could you merge one of the (similar) PRs addressing this issue on (multicore?) ESP32? |
After using the latest Arduino-esp32 there is a problem with ds18b20
Device is preset on the bus, bur ROM data error
espressif/arduino-esp32#1335
The text was updated successfully, but these errors were encountered: