These are chat archives for esp8266/Arduino

13th
Oct 2015
WHAAAT
@WHAAAT
Oct 13 2015 11:21
Hello, i´m currently working with my nodemcu and arduino core. if i request the sensor data to often the connection somehow dies. is there a good way to keep the connection alive?
d-anders
@d-anders
Oct 13 2015 16:26
what sensor?
WHAAAT
@WHAAAT
Oct 13 2015 16:43
mainly i have a dht22 temp/hum. sensor connected. my requests are every 15 min.
d-anders
@d-anders
Oct 13 2015 16:44
oh, 15 mins is nothing
i mean should give no problems
WHAAAT
@WHAAAT
Oct 13 2015 16:48
i thought so, i have read it is possible every 2 seconds ... do you know if there is a way to keep the signal to the router alive? i couldnt find any real documentation for the esp8266 arduino ide. And the example dont cover these problems
*examples
d-anders
@d-anders
Oct 13 2015 16:49
what do you do between reading?
WHAAAT
@WHAAAT
Oct 13 2015 16:51
nothing, the arduino ide just has callbacks for html requests. therefor i have just method that handles them. if I request the url/temp the esp8266 print a html with the data thats all.
d-anders
@d-anders
Oct 13 2015 16:52
strange
does it reboot or just lose connection?
WHAAAT
@WHAAAT
Oct 13 2015 17:03
just loose connection, if dont request so often i can keep the connection for days
d-anders
@d-anders
Oct 13 2015 17:06
i have a nodemcu board but havent experienced any such problems. i dont have the dht11 though
but for example ds18b20 i can read every second or so with no problems
hm, how long does a read take?
if you are using a timer maybe you cant do the reading in the actual timer handler function
if so - try setting a boolean flag check it in the main loop and read if it is set
Dejan Levec
@deanrock
Oct 13 2015 18:40
hi ... i have a question: should the esp8266 restart itself after it crashes? while testing simple HTTP requests it sometimes crashes (don't know why, it probably shouldn't, right?), however, it never came back by itself (i need to press reset button on breakout board)
sticilface
@sticilface
Oct 13 2015 18:58
I think the general consensus, and my experience is that it should reset by itself. What stops it, is usually when some of the GPIOs are not set properly for normal boot.