So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By btidey
#77549 OK HTTP is the protocol between a client (like a browser) which makes HTTP requests and a server (e.g. a webserver) that responds to the request and sends back information.

There are several scenarios here.

1) The ESP8266 gets time from NTP but also acts as a http Server. A separate machine has a http client which asks for the time via a http request (like a URL GET) to the ESP8266. The ESP8266 responds with the time which could be in html, json or text format. Normally a client make a single shot request (like requesting a web page) but Javascript can request repeated updates.

2) The ESP8266 gets time from NTP but acts as a http client. It makes one or more http requests (like a URL POST) to a separate http web server. The POST message just contains the current NTP time.

3) The ESP8266 has a real serial connection to the machine hosting the HTTP server. It gets the time from NTP and sends a serial message containing the time to the http web server machine. The web server machine must have a program listening on the serial port and able to receive and interpret these time messages.

Scenario 1 means the ESP8266 needs to be running the ESP8266WebServer library. Scenario 2 means the ESP8266 needs to be running the ESP8266HTTPClient library. Scenario 3 just uses Serial.print type statements but does seem an odd way to achieve a connection when the natural means for a ESP8266 to communicate is via wifi.