-->
Page 1 of 1

Understanding WiFiClient from ESP8266WiFi.h ESP8266 NodeMCU

PostPosted: Fri Jan 11, 2019 10:41 am
by Dirkblaze
Playing with a server running on NodeMCU ESP8266. Working OK, but

(1) Why do I need to client.stop() every time I process a request? On the next request I resend all the style and HTML to the same client!

so

(2) using ESP8266WiFi and WiFiServer and WiFiClient how can I identify the INDIVIDUAL client, see the IP, for instance. I'd like to be able to send shorter message to a client who's still on the page I've already sent with all its content.

So, for instance, instead of repainting the entire screen, I could just send enough HTML to pop up a new Div on his screen, using style sheet already defined.

(3) in general, what are the interesting attributes of the WiFiClient that can tell me MORE about the client? Like maybe, browser, device, IP etc. Of course, I know about the methods like
client.connected, client.available, client.read... etc

Thanks for any help!

Not positive this is the place to post this: long time reader, first time poster!

Re: Understanding WiFiClient from ESP8266WiFi.h ESP8266 Node

PostPosted: Tue Jan 15, 2019 4:31 pm
by martinayotte
Dirkblaze wrote:I'd like to be able to send shorter message to a client who's still on the page I've already sent with all its content.

It is not the way HTML request are working ...
If you wish to do some refresh within a current page, you have to do some ajax/jquery call from javascript provided inside your page.