Just in case somebody else runs into this problem, at least some DB18B20 temperature sensors have some issues in that calls getDeviceCount return zero, even though the sensor is connected, and responds when access using the index (i.e. 0).
There are a few long threads about issues on ESP32, and some mention that there are issues around "counterfeit" versions of the the sensors not working properly. I don't have an official one to test here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just in case somebody else runs into this problem, at least some DB18B20 temperature sensors have some issues in that calls getDeviceCount return zero, even though the sensor is connected, and responds when access using the index (i.e. 0).
There are a few long threads about issues on ESP32, and some mention that there are issues around "counterfeit" versions of the the sensors not working properly. I don't have an official one to test here.
I think mine must be one of the "counterfeit" ones. It's completely stopped working, and just returns errors now.
I am not aware of the issues, obviously I have over the years purchased a largish quantity from numerous sellers, yet to experience a dud one.