Obtain contenet of text sys variable

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Obtain contenet of text sys variable

#1 Post by mackowiakp » 19 Jan 2023, 14:33

Is it possible to obtain content of text system variable like %ssid% from ESP to server by any HTTP server call?

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

Re: Obtain contenet of text sys variable

#2 Post by TD-er » 19 Jan 2023, 14:54

You can have a look at the /json data?
If that's not enough, how do you expect the "answer" to be returned?

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Obtain contenet of text sys variable

#3 Post by Ath » 19 Jan 2023, 14:56

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...)
/Ton (PayPal.me)

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Obtain contenet of text sys variable

#4 Post by mackowiakp » 19 Jan 2023, 23:04

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.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 32 guests