Questions with regards to ESP8266 Basic and hardware interfacing and control via Basic commands

Moderator: Mmiscool

User avatar
By siddharthtaunk
#62206 Hi,

I have written the following code for retrieveing the temperature data from DS18B20.

Code: Select allcls

bla = temp(287)
print bla

But this returns -127

I have made the connection as in the link below. ... re-sensor/

I have not coonected the ardino instead have esp12e there.

Please help.

Thanks and regards.
User avatar
By Electroguard
#70168 Without getting bogged down with your specifics... the -127 value means the Dallas 1-wire device is not communicating with the ESP, else it should return a postive temperature value.

As far as hardware is concerned, reducing the value of the parasitic pullup resistor to 1K should improve reliability of 1-wire operation.

As far as software is concerned, rather than ask for a response from a specified device on the 1-wire bus, try getting the temp from any devices that can be found, ie the Docs state...
Bla = temp({Device ID})
With no arguments, all connected ROM codes are returned as a space separated string.