-->
Page 1 of 1

RE; 1 Wire communication from ESP8266Basic ESP12E

PostPosted: Tue Feb 07, 2017 3:42 am
by siddharthtaunk
Hi,

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

Code: Select allcls
button "READ TEMP",[BUTTON]
wait

[BUTTON]
bla = temp(287)
print bla
wait


But this returns -127

I have made the connection as in the link below.
https://www.tweaking4all.com/hardware/a ... re-sensor/

I have not coonected the ardino instead have esp12e there.

Please help.

Thanks and regards.
Sidharth

Re: RE; 1 Wire communication from ESP8266Basic ESP12E

PostPosted: Tue Feb 07, 2017 7:50 am
by Mmiscool
I would use temp(0) if you only have one sensor connected. For each aditional sensor connected increment the number.

Print temp(0)
Print temp(1)

Re: RE; 1 Wire communication from ESP8266Basic ESP12E

PostPosted: Fri Aug 11, 2017 4:56 am
by its1000
Hello guys

I have a DS18B20 and I tried to read the temperature.

I connected it to the port 2 as requested.

I always get the result -127 instead of the correct temperature.
any idea of what it can be?

thank you a lot for your help.

Re: RE; 1 Wire communication from ESP8266Basic ESP12E

PostPosted: Wed Sep 20, 2017 4:46 pm
by Electroguard
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.