Page 1 of 1

NAN when reading DS18b20

Posted: 10 Oct 2015, 23:29
by Deennoo
BJust try to use DS18B20 with R34 on SP1, and i'm facing a problem.

Wired as shown on the wiki, i get this :
Capture.JPG
Capture.JPG (17.36 KiB) Viewed 15524 times
on serial got this :

Code: Select all

INIT : Booting Build nr:34
WIFI : Connecting...
INIT : I2C
INIT : Boot OK
INIT : RTC not read
WD   : Uptime 0 ConnectFailures 0 FreeMem 30768
DS   : Temperature: Error! (c6-69-21-40-88-b8-fe-3f)
can you help ?

Re: NAN when reading DS18b20

Posted: 11 Oct 2015, 01:39
by BerndJ
Hi,
had a pull up (value pls?) resistor in use on GPIO2, give us the lenght of the cable, what cable it is and the time how long u wait for a response to the sensor ?

Helps to solve the problem.

I had V034 ,gpio0 in use, using 1 KOhm as PullUpR with a lenght of 20 cm to 2 pcs of DS18B20 and had no problems, response time every 10 seconds.

best wishes

Bernd

Re: NAN when reading DS18b20

Posted: 11 Oct 2015, 07:56
by Deennoo
I'm testing this on a breadboard with a 4,7k as recommanded.

Test 6 différentes sensors, always the same result.

Will try with a 10k

Re: NAN when reading DS18b20

Posted: 11 Oct 2015, 10:45
by Deennoo
It works using 10k resistor and a brand new esp8266 sp1 chip.

ds18b20 is the same parts.

When i try to update or load previous EspEasy skecth on a chip who already got one, all data aren't erase and DS18b20 port doesn't seams to be update.

See port on my previous post

and now look at this :
Capture.JPG
Capture.JPG (19.44 KiB) Viewed 15504 times

Re: NAN when reading DS18b20

Posted: 13 Nov 2015, 23:15
by dlefol
Hello,

I have the same problem, but I have only 1 ESP board for the moment so cannot try changing the board to see if it solves it like you did.
Have you found a way to read the value on the first board without having NaN ?

I have a 10k pull up resistor linked to 5V input and to GPIO 2

Re: NAN when reading DS18b20

Posted: 13 Nov 2015, 23:47
by Backbone
The route to go.....

Go to device.
Click edit.
Select the white (blank) first option from the dropdown menu.
Click submit.
Now there is no sensor selected.

Go to device.
Click edit.
Select the DS18b20 sensor option from the dropdown menu.
Fill in any IDX number not being zero.
Select correct GPIO-port.
Click submit.

wait 1 minute.

Does it work?

Never use 5 volt on this device as input!!!!!!!
Pull up should be connected to 3.3 volt.

Paco

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 17:14
by davidoliveirapt
Hi! I have a weird and similar problem...im reading the data correctly, but it's not sending to the domoticz...always showing up 0 degrees :|

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 20:40
by dlefol
Thanks a lot for the detailed answer Paco, it helped me solve my NaN problem.

Concerning the 0 degree in domoticz, do you have none zero reading in the device inteface when you connect to your ESP via ESPeasy interface ? Or is it also at 0 there. If yes then it s normal domoticz diplsays 0 I think.

I have a similar situation where I have 0.00 degree reading in the ESP (I think it is due to a bad contact somewhere on my breadboard as I managed to have some none zero reading at one point by moving the wires around ... but cannot have it again now). I thus have have a flat temperature graph at 0 degree for this sensor in domoticz but I guess it s normal since the sensor reads 0.

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 21:00
by dlefol
I confirm what I was saying in my previous post. I had a bad connection on my breadboard. After re-wiring everything cleanly I have normal reading nows and the curve which was a flat 0 in domoticz is now at the expected temperature value :)

Thanks again to all for your help.

davidoliveirapt, I would advise you to check your wiring and also that you have declared the right GPIO as declaring a wrong one also gave me a 0 reading sometimes (I am on a NodeMCU dev board and the mapping of pin to GPIO is not very logical).

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 21:30
by davidoliveirapt
Hi!
My wirings are ok, im having a good reading on my esp8266, however my domotics isnt getting any value...
[img]
domoticz.jpg
domoticz.jpg (150.99 KiB) Viewed 15405 times
[/img]

this is my setup and values
dlefol wrote:I confirm what I was saying in my previous post. I had a bad connection on my breadboard. After re-wiring everything cleanly I have normal reading nows and the curve which was a flat 0 in domoticz is now at the expected temperature value :)

Thanks again to all for your help.

davidoliveirapt, I would advise you to check your wiring and also that you have declared the right GPIO as declaring a wrong one also gave me a 0 reading sometimes (I am on a NodeMCU dev board and the mapping of pin to GPIO is not very logical).

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 21:39
by dlefol
... not the wires then.
I don't know if you screen capture is old or not but if you took it tonight I am astonished that the date for last seen is at 3 pm this afternoon.
If the screen capture was done tonight it should say it s seen more recently than that.
Maybe check the adress and port you've put for connecting the ESP to domoticz.

If not I have no idea what the problem is (sorry just started playing with domoticz a couple of days ago)

Re: NAN when reading DS18b20

Posted: 14 Nov 2015, 21:51
by davidoliveirapt
Yep, that time was from when i created it...

I'm deleting everything now, creating new hardware and devices and see if they all work in IDX1...

Still no luck... going to reinstall domoticz

Re: NAN when reading DS18b20

Posted: 15 Nov 2015, 07:52
by Backbone
1] Does the switch input change state and shown correct in DMZ?
2] Swap GPIO ports 0 and 2 on esp-01 for test if not and assign correct IDX numbers.
3] try add new device in DMZ.

or

copy from user rmtucker,

To erase eeprom and start over again clean.

https://dl.dropboxusercontent.com/u/588 ... syTool.ino

press 'e' to erase
press 's' to show contents

Paco

Re: NAN when reading DS18b20

Posted: 15 Nov 2015, 14:39
by davidoliveirapt
I have reinstalled domoticz in my raspberry pi card and now it's working!

thanks everyone!

Backbone wrote:1] Does the switch input change state and shown correct in DMZ?
2] Swap GPIO ports 0 and 2 on esp-01 for test if not and assign correct IDX numbers.
3] try add new device in DMZ.

or

copy from user rmtucker,

To erase eeprom and start over again clean.

https://dl.dropboxusercontent.com/u/588 ... syTool.ino

press 'e' to erase
press 's' to show contents

Paco