Can I get a value from an external web server

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
sparkes
Normal user
Posts: 14
Joined: 25 Feb 2018, 20:57

Can I get a value from an external web server

#1 Post by sparkes » 02 Dec 2019, 18:56

Hi You group of IOT masters

I'm trying to get an ESP to check an external server for a value but I don't know how (or if) I can receive responses?

For example an ESP with a button

1. Button gets pressed
2. ESP Sends unique value to web server via SendToHTTP
3. Server processes value in php and responds with either value 0 or 1 for example
4. ESP runs rule depending on received return value of 0 or 1

I really hope somebody understand what I'm getting at.

Obviously I don't want to expose the ESP to the internet directly but if the request comes from the ESP then is safer.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Can I get a value from an external web server

#2 Post by grovkillen » 02 Dec 2019, 20:23

Currently not possible. But you may want to add it as a feature request on GitHub. Please look through the open issues to see if it has already been suggested.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

sparkes
Normal user
Posts: 14
Joined: 25 Feb 2018, 20:57

Re: Can I get a value from an external web server

#3 Post by sparkes » 03 Dec 2019, 00:49

That's a real shame I had grand plans.

I'll try and add a feature request.

Flying Domotic
Normal user
Posts: 37
Joined: 27 Aug 2019, 23:57

Re: Can I get a value from an external web server

#4 Post by Flying Domotic » 04 Dec 2019, 00:28

May I suggest you doing it differently?
For example, sensor send the value to the server, and server sends back a command to the sensor (like relay on/off)?
We often do like this with automation systems ;-)

sparkes
Normal user
Posts: 14
Joined: 25 Feb 2018, 20:57

Re: Can I get a value from an external web server

#5 Post by sparkes » 04 Dec 2019, 00:44

That would work for a local server but unfortunately the server is a web server and not local so security is an issue and we don't want to be exposing the esp8266 to the internet.

Flying Domotic
Normal user
Posts: 37
Joined: 27 Aug 2019, 23:57

Re: Can I get a value from an external web server

#6 Post by Flying Domotic » 04 Dec 2019, 09:58

Got it!

You so have to ask for a change (or do it yourself), and manage errors/timeouts if server don't answer for any reason.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: Can I get a value from an external web server

#7 Post by iron » 04 Dec 2019, 10:48

sparkes wrote: 02 Dec 2019, 18:56
I'm trying to get an ESP to check an external server for a value but I don't know how (or if) I can receive responses?

...snip...

Obviously I don't want to expose the ESP to the internet directly but if the request comes from the ESP then is safer.
Hello,

If the server is "external" how will this stop from exposing your ESP to the internet ?

-D
-D

sparkes
Normal user
Posts: 14
Joined: 25 Feb 2018, 20:57

Re: Can I get a value from an external web server

#8 Post by sparkes » 04 Dec 2019, 13:40

iron wrote: 04 Dec 2019, 10:48
sparkes wrote: 02 Dec 2019, 18:56
I'm trying to get an ESP to check an external server for a value but I don't know how (or if) I can receive responses?

...snip...

Obviously I don't want to expose the ESP to the internet directly but if the request comes from the ESP then is safer.
Hello,

If the server is "external" how will this stop from exposing your ESP to the internet ?

-D
We're asking for it which means we're opening the connection then then closing it. Just like when the ESP uses the NTP server to get the time! I'm not an expert...

It's also behind a router and it's ip address will change - so we can't target it very easily.

We're asking for a value instead or being sent it.

I think?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Can I get a value from an external web server

#9 Post by TD-er » 04 Dec 2019, 14:12

Maybe the related issue on Github will clarify things a bit?
https://github.com/letscontrolit/ESPEasy/issues/2796

sparkes
Normal user
Posts: 14
Joined: 25 Feb 2018, 20:57

Re: Can I get a value from an external web server

#10 Post by sparkes » 04 Dec 2019, 14:53

TD-er wrote: 04 Dec 2019, 14:12 Maybe the related issue on Github will clarify things a bit?
https://github.com/letscontrolit/ESPEasy/issues/2796
Yep thats my request... :lol:

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 26 guests