-->
Page 1 of 1

esp8266 ntp server with config page

PostPosted: Sat Oct 28, 2017 6:39 am
by Velimir Baksa
Hi. I am learning to work with with esp8266. I want to progra it with arduino ide.
My goal is to make ntp server that would refresh once a day and pull time from ntp server and to make simple html page. How to ad html in code? I what section would that go?

Re: esp8266 ntp server with config page

PostPosted: Sun Oct 29, 2017 5:00 am
by Narfel
I'll answer as a newbie in newbish :)
Simply put: to store html in a sketch you need to store it in a variable or use string literals for bigger chunks and print it. To then serve this code as a page you need a webserver. Under Examples -> ESP8266WiFi -> WiFiWebServer in the Arduino IDE is a comprehensive example. That one shows you how to server a small html page to switch a GPIO high or low.
For NTP under Examples -> ESP8266Wifi -> NTPClient is a example for a ntp pull directly via UDP.

Finally here is the whole thing you probably are aiming for detailed nicely. Instead of a LCD you just serve up a page via webserver.