DS18B20 hanging webserver
Posted: Sun Apr 19, 2015 2:30 pm
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
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