Code that worked in December has stopped working. The devices on the OneWire bus are not responding. I can get the same failure using the examples.
Can someone here confirm a working combination of:
The arduino esp32 board library (I have 2.0.18-arduino.5)
+ OneWire (2.3.8)
+ DallasTemperature (4.0.3)
+ Pin Mapping (by GPIO #)
Here is my test code.
// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Nano ESP32
#define ONE_WIRE_BUS D2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
// Blink to show life
Serial.println("Starting...");
pinMode(LED_BUILTIN, OUTPUT);
for (int i=0; i<=20; i++){
digitalWrite (LED_BUILTIN, i&1);
delay(250);
}
Serial.println(__FILE__);
// Scan the bus
Serial.print("Locating devices...");
sensors.begin();
Serial.print("Found ");
Serial.print(sensors.getDeviceCount(), DEC);
Serial.println(" devices.");
// report parasite power requirements
Serial.print("Parasite power is: ");
if (sensors.isParasitePowerMode()) Serial.println("ON");
else Serial.println("OFF");
}
void loop(void)
{
delay (1000);
}