Can I get a value from an external web server
Moderators: grovkillen, Stuntteam, TD-er
Can I get a value from an external web server
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.
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.
- 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
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Can I get a value from an external web server
That's a real shame I had grand plans.
I'll try and add a feature request.
I'll try and add a feature request.
-
- Normal user
- Posts: 37
- Joined: 27 Aug 2019, 23:57
Re: Can I get a value from an external web server
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
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
Re: Can I get a value from an external web server
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.
-
- Normal user
- Posts: 37
- Joined: 27 Aug 2019, 23:57
Re: Can I get a value from an external web server
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.
You so have to ask for a change (or do it yourself), and manage errors/timeouts if server don't answer for any reason.
Re: Can I get a value from an external web server
Hello,
If the server is "external" how will this stop from exposing your ESP to the internet ?
-D
-D
Re: Can I get a value from an external web server
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?
Re: Can I get a value from an external web server
Maybe the related issue on Github will clarify things a bit?
https://github.com/letscontrolit/ESPEasy/issues/2796
https://github.com/letscontrolit/ESPEasy/issues/2796
Re: Can I get a value from an external web server
Yep thats my request...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
Who is online
Users browsing this forum: Bing [Bot] and 116 guests