-->
Page 1 of 1

webserver behaviour

PostPosted: Mon May 16, 2022 6:40 pm
by mazur888
Hi All,
I have esp8266 wemos d1 mini programmed as webserver.
2x ds18b20 temp sensors and 3v3 relay.
its simple code triggering relay when temp reaches 25 degrees in 1 of the probes.
using html, javascript, and ajax.

when I have IP address opened in web browser it all works perfect, relay triggers every time, but when browser is not opened, code doesnt work.
I wonder why digitalWrite inside void loop() wouldn't trigger relay without web browser?
is this normal behaviour?

Re: webserver behaviour

PostPosted: Tue May 17, 2022 12:36 am
by JurajA
the problem is in your code

Re: webserver behaviour

PostPosted: Tue May 17, 2022 7:25 pm
by mazur888
found the problem. Posting here just in case there is anybody with similar problem,

loop() was missing this line: sensors.requestTemperatures();

sensors.requestTemperatures(); was placed only inside handle on connect, thats why it was only working when browser was on.