• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ESP8266 Request Time

Status
Not open for further replies.

Suraj143

Active Member
I want to know is it possible to request NTP time from a nearby wifi router via 8266 module?
I want to build several slave clocks, but the time must be exact on all clocks.

Thanks
 

Pommie

Well-Known Member
Most Helpful Member
I have an esp powered clock that uses ntp via my wifi. There's lots of examples out there.

Mike.
 

Suraj143

Active Member
I have an esp powered clock that uses ntp via my wifi. There's lots of examples out there.

Mike.
Thats exactly what I want to do.I searched in google, but all of them using Arduino libraries which is not I'm familiar.But I will try to search some more...

Thanks
 

Pommie

Well-Known Member
Most Helpful Member
If you check chapter 15 of this document, it explains how to fetch the time.

Mine uses a 32x8 LED display ($5 of ebay) and looks like this.

Mike.

20181201_180913.jpg
 

Pommie

Well-Known Member
Most Helpful Member
For anyone interested, the seconds is indicated by the 3 pixels on the bottom row. It indicates 0 seconds by lighting the two leftmost LEDs then 1 by lghting the left 3 LEDs, 2 by exstinguishing the leftmost LED. Thus a sort of catapillar walks it way across the 32 LEDs in 60 seconds.

Mike.
Edit, it's strange but since building this clock I don't think I could go back to an inaccurate one.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
For my current GPRS projects I use a PHP script on my webserver to provide the time - I do it this way because the same request also provides a flag to let the project know if it's settings have been altered (which are stored in a MYSQL database on the same server), so it can download the updated settings.

Essentially it's a logger that uploads readings at specific intervals, and every time it does so it first reads the time, resets it's own clock, checks if it's settings have been altered, updates them as required, and then uploads the readings. The clock runs on the usual 32KHz crystal, so is fairly stable anyway, but setting the clock every time means it's always pretty accurate.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top