Page 1 of 1

Obtain contenet of text sys variable

Posted: 19 Jan 2023, 14:33
by mackowiakp
Is it possible to obtain content of text system variable like %ssid% from ESP to server by any HTTP server call?

Re: Obtain contenet of text sys variable

Posted: 19 Jan 2023, 14:54
by TD-er
You can have a look at the /json data?
If that's not enough, how do you expect the "answer" to be returned?

Re: Obtain contenet of text sys variable

Posted: 19 Jan 2023, 14:56
by Ath
It's not completely clear to me if you want to retrieve it by an external system from the ESP, or send from the ESP to an external server.

For retrieving (technical) data from the ESP you can query the http://esp-ip/json url that will respond with a JSON content that can be handled by the external party, and that includes the SSID.

For sending it from ESP to an external system there are 2 options:
- SendToHTTP - that can send a GET request, with url parameters, to an external system
- PostToHTTP - that can send a POST request, with optional headers and request-body, to an external system (this has been merged into mega today...)

Re: Obtain contenet of text sys variable

Posted: 19 Jan 2023, 23:04
by mackowiakp
OK, solved. I can query ESP from server using syntax like this:

Code: Select all

wget -O - http://192.168.0.28/json 2>/dev/null|grep '"SSID":"'
So is easy to retrieve SSID name from returned string.
THX for help.