looking for example to connect a 2nd esp as a client to ESP32 Server

dsyleixa
Posts: 12
Joined: Mon May 20, 2019 8:33 pm

looking for example to connect a 2nd esp as a client to ESP32 Server

Postby dsyleixa » Wed May 22, 2019 8:57 am

hello,
I'm quite new to ESP32 Arduino...
Now I'm looking for example to connect a 2nd esp as a client to ESP32 Server.

Given:
ESP32 Webserver generating a website via html, e.g. to switch an LED ON/OFF.

Now I want to connect to a 2nd ESP which is sending values (e.g. of a DHT22 temperature sensor),
and those values should be displayed additionally on the Server's html Website.

Is thre already such an example available?

(edit, moved)

TomWS1
Posts: 21
Joined: Wed May 01, 2019 2:50 pm

Re: looking for example to connect a 2nd esp as a client to ESP32 Server

Postby TomWS1 » Wed May 22, 2019 12:25 pm

A search for "Arduino Web Client Post" will produce several examples.

However, 'posting' to the Esp32 'Server' won't have any affect on any pages being accessed from that server unless the posted data is saved on that ESP32 'server' (you didn't say how the server would process the data).

If the data is saved locally on the 'client' node and the 'client' node is, itself a server, then the ESP32 'Server' can access its data whenever it needs to render the data on an accessed page.

dsyleixa
Posts: 12
Joined: Mon May 20, 2019 8:33 pm

Re: looking for example to connect a 2nd esp as a client to ESP32 Server

Postby dsyleixa » Wed May 22, 2019 12:38 pm

hello,
the ESP32 could host a website like for your SimpleWiFiServer LED on/off example,
plus show an arbitrary anolog value or even a graph/chart for it like in your AdvancedWebServer example.

Then additionally the ESP32 could act as a WebServer to connect to any other ESP Clients.

It might send messages to a ESP client via
webserver.send(200, "text/plain", message);
and perhaps receive and process messages via
webserver.arg("token"),
e.g.
webserver.arg("Client0ADC0")
and the show up that related value on the html website.

But how that finally has to be coded - that actually is the crucial question... ;)
(tbh, I do not even see the difference between a "WifiServer" and a "WebServer")

Who is online

Users browsing this forum: No registered users and 55 guests