Continuing the discussion from OneWire Library + ESP32:
Some version of this problem seems to have returned. There is no problem compiling, but I can't detect sensors with OneWire 2.3.8 and the 2.0.17 board core.
I have been using the 2.3.8 version from the library manager for some time and the OneWire part of my code (to use up to 8 temperature sensors) has always been reliable. Today I upgraded to Arduino ESP32 Board 2.0.17 and everything broke. I switched to the DS18x20_Temperature example and it found no addresses. I tested with Boards 2.0.10, 20.0.12, 2.0.13, and all were good. I went back to 2.0.17 and the problems returned.
I also tried the latest OneWire from GitHub in case there was another change, but it still failed.
I don't know whether to call this a OneWire bug or a board core bug, but I'll have to stay at 2.0.13 unless there is a fix.
Interesting. I have a different combination of board and OneWire version that works: esp8266 Core:3.1.2, OneWire 2.3.0 works
even though it complains at compile time:
128 | #warning "OneWire. Fallback mode. Using API calls for pinMode,digitalRead and digitalWrite. Operation of this library is not guaranteed on this architecture."
BUT, if I use any version of OneWire newer than 2.3.0 (e.g. 2.3.4 or the latest 2.3.8), the compile complaints go away but it finds 0 devices at runtime. That is:
OneWire oneWire(3);
DallasTemperature dallasTempSensors(&oneWire);
dallasTempSensors.begin();
delay(1000);
dallasTempSensors.requestTemperatures();
return dallasTempSensors.getDeviceCount();
returns 0!
Not sure what the intersection of your issue is with mine, but they sure seem related. And ideas out there?
Since that post I have seen recommendations to use OneWireNg which has some explicit provisions of Espressif devices. I haven't tried it myself, but I intend to if the incompatibility persists much longer.
Hello @VeloSteve, just seen the whole thread. There have been multiple releases of the Arduino ESP32 core late last year; 2.0.18-arduino.5 is the latest and it has a number of fixes over 2.0.17. Can you confirm the issue persists with the current core?
Also, to double check, I assume you are familiar with pin numbering on the Nano ESP32 and are using "By GPIO number" and pin labels in your sketch?
1 Like
@jtburgess I think your issue may be unrelated - the Arduino Nano ESP32 board (the topic for this forum...
) uses an ESP32-S3, not an ESP8266.
But definitely check out OneWireNg if that helps 
Thank you for prompting me to check compatibility with the latest releases. I believe that there were other cores offered at one time, but these are the newest 3 I see in the IDE today. The most recent one works with the most recent OneWire, so pending testing the problem is solved for now.
| OneWire |
Core |
Compiles? |
Messages |
| 2.3.8 |
2.0.13 |
Yes |
|
| 2.3.8 |
2.0.18.20240930.arduino3 |
No |
xtensa-esp32s3-elf-g++: error: CreateProcess: No such file or directory |
| 2.3.8 |
2.0.18-arduino.5 |
Yes |
warning: extra tokens at end of #undef directive (and more) |
1 Like