-->
Page 1 of 1

DS18B20 hanging webserver

PostPosted: Sun Apr 19, 2015 2:30 pm
by sej7278
I've got the following sketch (based on one from here somewhere!) and it connects to wifi just fine and i can turn the led on/off forever. But..... If I add in some code for a DS18B20, it seems to work ok for about 4 LED on/off cycles and then hangs the unit. Any ideas what it could be? Memory exhaustion, some sort of timeout (DS18B20 libs use a lot of delays) or what - don't say power issues, its not that. i also tried parasitic and powered mode. running an ESP-01 via Arduino IDE 1.6.3

I've tried copying code from DS18x20_Temperature.pde from the OneWire lib (yes, the ESP8266-specific one) and the regular old DallasTemperature library i usually use with Arduino's, and they both return valid temperatures, but hang the wifi/serial.

edit: looks like its current - i was trying to drop 3.9v down to 3.3v using a diode, and it seems its dropped the current too, as it seems fine bypassing the diode and using a 3.3v regulated supply. i'll have to stick a switching regulator in there rather than cutting corners. maybe 2xAA and a boost regulator, i really do hate 3.3v!

edit 2: actually, its no better with a 3.3v boost off of 2xAA. there must be a limit to the number of inbound connections the webserver can cope with per minute or something, maybe it takes a while to free the memory....? i can do 10-13 GET requests before it hangs, so must be memory exhaustion.

edit 3: must be the the webserver example i was using, as this one works fine and is much faster: viewtopic.php?f=29&t=2153

Re: DS18B20 hanging webserver

PostPosted: Sun Apr 19, 2015 2:57 pm
by martinayotte
BTW, the code shown above don't have any DS18B20 related code.
For your DS18B20 connection, do you add a PullUp on the Data line ? If not, it is maybe the reason of the hang ...

Re: DS18B20 hanging webserver

PostPosted: Sat Apr 25, 2015 1:14 am
by rw86347
I am in the same boat.

Did you figure out what was going wrong?