-->
Page 1 of 1

Alternative Way to Check link every Second?

PostPosted: Thu Oct 24, 2019 12:58 pm
by Ali Haydar GÜLEÇ
Hi there! I am new here, not noob for Arduino but noob for esp8266.

Have Nodemcu v3 (Lolin), Trying to control door lock with internet. MY current solution is very straightforward:

1. Check a http link every 3 seconds, (ex. Look a txt file on net, with get request)
2. If its "1", send HIGH to relay output.
3. Send another get request to php file to make it 0 again.

But i think there has to be another solution. Without checking it every 3 seconds, There must be something like push to Nodemcu some message with php or something. Are there any alternatives to my solution? Thanks! :D

Re: Alternative Way to Check link every Second?

PostPosted: Fri Nov 08, 2019 10:57 pm
by Rajeesh
Hi... You got any solution for this ?

Re: Alternative Way to Check link every Second?

PostPosted: Sat Nov 09, 2019 8:10 pm
by davydnorris
I'm pretty sure Arduino has a WebSockets library - you could set up a connection and then have your server end emit an event.

You could also use MQTT and subscribe to a topic - that would be very easy to do