I have spend a good few hours now trying to get a temperature reading from a ds18b20 temp sensor. I have used the sensors I have before without problem. So there is something I am doing wrong.
I have 2 sensors and 2 wemos mini, I have tried both of them at different combination without success, so i doubt both of them to be broken as I have used them in the past..
Requesting temperatures...DONE
Error: Could not read temperature data
I have used this tutorial as reference how to wire it (but using only a single sensor). And I am pretty sure I have connected the cables right? Just in case I have attached an image.
I had to specify D1 as pin. Just using a number as 1 (as taken from the sketch example) did not work.
What would the example 1 means vs D1 that actually work mean?
If you are correct and the sensor is OK then your message: "Error: Could not read temperature data" indicates it is improperly wired or the Pull up resistor is missing or disconnected. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
Could not find any device. Device could be found on D1 not on 1.
The error message is not generated by the library but from the code example, so in that sense it was not very helpful to identify the problem. It was still a software issue
JCA34F:
On Arduino UNO, D1 means DIGITAL 1 (0 thru 13) A1 would be analog input 1 (0 thru 5),
You can't use D1 as pin designator for an Arduino sketch. It doesn't compile. On an Uno board those pins are simply numbered, no D prefix.
On the WeMOS D1 is GPIO5, so most likely D1 is defined as 5. There is no obvious relation between the WeMOS (or NodeMCU) D0-D9 pin numbering and the ESP8266 GPIO pin numbers...