SlideShare a Scribd company logo
Internet ofThings
Getting Date & Time From NTP Server
With ESP8266 NodeMCU
Eng. Elaf A.Saeed
The Contents
• NTP Server With ESP8266 NodeMCU.
• Getting Day & Time From NTP Server With ESP8266 NodeMCU.
• Getting Current Day and Time from NTP Server.
• Getting Current Date and Time from NTP Server.
Getting Day & Time & date From NTP
Server With ESP8266 NodeMCU
NTP Server With ESP8266 NodeMCU
NTP Server With ESP8266 NodeMCU
(cont.)
• NTP stands for Network Time Protocol and it is a networking protocol for clock
synchronization between computer systems. In other words, it is used to synchronize
computer clock times in a network.
• The protocol can be used to synchronize all networked devices to Coordinated
Universal Time (UTC) within a few milliseconds ( 50 milliseconds over the public
Internet and under 5 milliseconds in a LAN environment).
• Coordinated Universal Time (UTC) is a world-wide time standard, closely related to
GMT (Greenwich Mean Time). UTC does not vary, it is the same world wide.
NTP Server With ESP8266 NodeMCU
(cont.)
❑NTPArchitecture
• NTP uses a hierarchical architecture. Each level in the
hierarchy is known as a stratum.
• At the very top are high-precision timekeeping devices,
such as atomic clocks, GPS or radio clocks, known as
stratum 0 hardware clocks.
• Stratum 1 servers have a direct connection to a stratum 0
hardware clock and therefore have the most accurate time.
• Each stratum in the hierarchy synchronizes to the stratum
above and act as servers for lower stratum computers.
NTP Server With ESP8266 NodeMCU
(cont.)
❑How NTP Works?
• NTP can operate in a number of ways. The most common configuration
is to operate in client-server mode. The basic working principle is as
follows:
1. The client device such as ESP8266 connects to the server using the
User Datagram Protocol (UDP) on port 123.
2. A client then transmits a request packet to a NTP server.
3. In response to this request the NTP server sends a time stamp packet.
4. A time stamp packet contains multiple information like UNIX
timestamp, accuracy, delay or time zone.
5. A client can then parse out current date & time values.
NTP Server With ESP8266 NodeMCU
(cont.)
❑Installing the NTPClient Library
• We’ll use the NTPClient library to get time. In your Arduino IDE, go to
Sketch > Library > Manage Libraries. The Library Manager should open.
• Search for NTPClient and install the library by Fabrice Weinber as shown in
the following image.
Getting Day & Time From NTP Server
With ESP8266 NodeMCU
Getting Day & Time From NTP Server
With ESP8266 NodeMCU
❑NTPClient Library Time Functions
• getDay() – returns an int number that corresponds to the the week day (0 to 6)
starting on Sunday;
• getHours() – returns an int number with the current hour (0 to 23) in 24 hour format;
• getMinutes() – returns an int number with the current minutes (0 to 59);
• getSeconds() – returns an int number with the current second;
• getEpochTime() – returns an unsigned long with the epoch time (number of seconds
that have elapsed since January 1, 1970 (midnight GMT);
• getFormattedTime() – returns a String with the time formatted like HH:MM:SS;
Getting Day & Time From NTP Server
With ESP8266 NodeMCU (cont.)
Getting Current Day and Time from
NTP Server (cont.)
Getting Current Day and Time from
NTP Server (cont.)
Getting Current Date and Time from
NTP Server
❑Function that is used in Code
1. year()➔ Set or read the RTC year value.
Syntax
year(unsigned long year)
2. month() ➔ Set or read the RTC month value.
Syntax
month(unsigned long month)
3. day() ➔ Set or read the RTC day value.
Syntax
day(unsigned long day)
Getting Current Date and Time from
NTP Server (cont.)
❑Function that is used in Code
4. minute() ➔ Set or read the RTC minute value.
Syntax: minute(unsigned long minute)
5. second() ➔ Set or read the RTC second value.
Syntax: second(unsigned long second) .
Getting Current Date and Time from
NTP Server (cont.)
Getting Current Date and Time from
NTP Server (cont.)
Getting Current Date and Time from
NTP Server (cont.)
Getting Current Date and Time from
NTP Server (cont.)
Thanks
Ad

More Related Content

What's hot (20)

GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
Đinh Công Thiện Taydo University
 
Luận văn: Nghiên cứu, thiết kế và chế tạo bộ VCO băng tần S, HAY
Luận văn: Nghiên cứu, thiết kế và chế tạo bộ VCO băng tần S, HAY Luận văn: Nghiên cứu, thiết kế và chế tạo bộ VCO băng tần S, HAY
Luận văn: Nghiên cứu, thiết kế và chế tạo bộ VCO băng tần S, HAY
Dịch vụ viết bài trọn gói ZALO: 0909232620
 
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdfĐiều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Man_Ebook
 
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
nataliej4
 
Tai liu hng_dn_matlab_simulink_thc
Tai liu hng_dn_matlab_simulink_thcTai liu hng_dn_matlab_simulink_thc
Tai liu hng_dn_matlab_simulink_thc
NHNNGUYNHU12
 
Kien truc-co-ban-cua-stm32-arm-cortex-m3
Kien truc-co-ban-cua-stm32-arm-cortex-m3Kien truc-co-ban-cua-stm32-arm-cortex-m3
Kien truc-co-ban-cua-stm32-arm-cortex-m3
Huynh MVT
 
Acs 550 tiếng việt
Acs 550 tiếng việtAcs 550 tiếng việt
Acs 550 tiếng việt
khongbaogiotk
 
Download: Giáo trình trang bị điện điện lạnh, 203 Trang!
 Download: Giáo trình trang bị điện điện lạnh, 203 Trang! Download: Giáo trình trang bị điện điện lạnh, 203 Trang!
Download: Giáo trình trang bị điện điện lạnh, 203 Trang!
Nhận Viết Đề Tài Trọn Gói ZALO 0932091562
 
Difference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor ArchitectureDifference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor Architecture
VarunGautam40
 
Đề tài: Thiết kế hệ thống điều khiển các thiết bị trong phòng học
Đề tài: Thiết kế hệ thống điều khiển các thiết bị trong phòng họcĐề tài: Thiết kế hệ thống điều khiển các thiết bị trong phòng học
Đề tài: Thiết kế hệ thống điều khiển các thiết bị trong phòng học
Dịch Vụ Viết Bài Trọn Gói ZALO 0917193864
 
Mo phong bang Matlab-Simulinhk_P1.ppt
Mo phong bang Matlab-Simulinhk_P1.pptMo phong bang Matlab-Simulinhk_P1.ppt
Mo phong bang Matlab-Simulinhk_P1.ppt
HaTrungKien2
 
Đề tài: Cài đặt một web server đơn giản trên một board vi xử lý
Đề tài: Cài đặt một web server đơn giản trên một board vi xử lýĐề tài: Cài đặt một web server đơn giản trên một board vi xử lý
Đề tài: Cài đặt một web server đơn giản trên một board vi xử lý
Dịch Vụ Viết Bài Trọn Gói ZALO 0917193864
 
Thiết kế anten vi dải sử dụng trong hệ thống thông tin vô tuyến
Thiết kế anten vi dải sử dụng trong hệ thống thông tin vô tuyếnThiết kế anten vi dải sử dụng trong hệ thống thông tin vô tuyến
Thiết kế anten vi dải sử dụng trong hệ thống thông tin vô tuyến
Dịch vụ viết bài trọn gói ZALO: 0909232620
 
Hệ năng lượng mặt trời và phương pháp để thu công suất cực đại
Hệ năng lượng mặt trời và phương pháp để thu công suất cực đạiHệ năng lượng mặt trời và phương pháp để thu công suất cực đại
Hệ năng lượng mặt trời và phương pháp để thu công suất cực đại
Dịch vụ viết bài trọn gói ZALO 0917193864
 
Timing diagram of microprocessor 8085
Timing diagram of microprocessor 8085Timing diagram of microprocessor 8085
Timing diagram of microprocessor 8085
Nilesh Bhaskarrao Bahadure
 
ARDUINO OVERVIEW HARDWARE SOFTWARE AND INSTALLATION.pptx
ARDUINO OVERVIEW HARDWARE  SOFTWARE AND INSTALLATION.pptxARDUINO OVERVIEW HARDWARE  SOFTWARE AND INSTALLATION.pptx
ARDUINO OVERVIEW HARDWARE SOFTWARE AND INSTALLATION.pptx
menchc1207
 
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdfĐiều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Man_Ebook
 
Superscalar processor
Superscalar processorSuperscalar processor
Superscalar processor
noor ul ain
 
thuc hanh xu ly tin hieu so
thuc hanh xu ly tin hieu sothuc hanh xu ly tin hieu so
thuc hanh xu ly tin hieu so
Kimkaty Hoang
 
GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
GIAI TICH HE THONG DIEN NANG CAO - PHẦN KẾT GIỚI THIỆU PHẦN MỀM PHÂN BỐ CÔNG ...
Đinh Công Thiện Taydo University
 
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdfĐiều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Điều khiển bộ nghịch lưu nối lưới trong mạng điện phân phối.pdf
Man_Ebook
 
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
Thiết Kế, Chế Tạo Hệ Thống Điều Hòa Nhiệt Độ Và Tưới Cây Tự Động Vườn Cây Tro...
nataliej4
 
Tai liu hng_dn_matlab_simulink_thc
Tai liu hng_dn_matlab_simulink_thcTai liu hng_dn_matlab_simulink_thc
Tai liu hng_dn_matlab_simulink_thc
NHNNGUYNHU12
 
Kien truc-co-ban-cua-stm32-arm-cortex-m3
Kien truc-co-ban-cua-stm32-arm-cortex-m3Kien truc-co-ban-cua-stm32-arm-cortex-m3
Kien truc-co-ban-cua-stm32-arm-cortex-m3
Huynh MVT
 
Acs 550 tiếng việt
Acs 550 tiếng việtAcs 550 tiếng việt
Acs 550 tiếng việt
khongbaogiotk
 
Difference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor ArchitectureDifference between 8085 and 8086 microprocessor Architecture
Difference between 8085 and 8086 microprocessor Architecture
VarunGautam40
 
Mo phong bang Matlab-Simulinhk_P1.ppt
Mo phong bang Matlab-Simulinhk_P1.pptMo phong bang Matlab-Simulinhk_P1.ppt
Mo phong bang Matlab-Simulinhk_P1.ppt
HaTrungKien2
 
ARDUINO OVERVIEW HARDWARE SOFTWARE AND INSTALLATION.pptx
ARDUINO OVERVIEW HARDWARE  SOFTWARE AND INSTALLATION.pptxARDUINO OVERVIEW HARDWARE  SOFTWARE AND INSTALLATION.pptx
ARDUINO OVERVIEW HARDWARE SOFTWARE AND INSTALLATION.pptx
menchc1207
 
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdfĐiều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Điều khiển mô hình con lắc ngược đôi bằng phương pháp LQG.pdf
Man_Ebook
 
Superscalar processor
Superscalar processorSuperscalar processor
Superscalar processor
noor ul ain
 
thuc hanh xu ly tin hieu so
thuc hanh xu ly tin hieu sothuc hanh xu ly tin hieu so
thuc hanh xu ly tin hieu so
Kimkaty Hoang
 

Similar to Getting date and time from ntp server with esp8266 node mcu (20)

Seminar
SeminarSeminar
Seminar
parita_parekh
 
4 ip services dhcp
4 ip services dhcp4 ip services dhcp
4 ip services dhcp
SagarR24
 
4 ip services dhcp-part b
4 ip services dhcp-part b4 ip services dhcp-part b
4 ip services dhcp-part b
SagarR24
 
4 ip services nat
4 ip services nat4 ip services nat
4 ip services nat
SagarR24
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
4 ip services span,rspan
4 ip services span,rspan4 ip services span,rspan
4 ip services span,rspan
SagarR24
 
Whats the Time
Whats the TimeWhats the Time
Whats the Time
APNIC
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
AbDul ThaYyal
 
Timers
TimersTimers
Timers
Shivaditya Jatar
 
Timer
TimerTimer
Timer
Shivaditya Jatar
 
Analyze and Store Logs - RHCSA (RH124).pdf
Analyze and Store Logs - RHCSA (RH124).pdfAnalyze and Store Logs - RHCSA (RH124).pdf
Analyze and Store Logs - RHCSA (RH124).pdf
RHCSA Guru
 
Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025
jgfaryu7
 
Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025
jgfaryu7
 
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
laksken83
 
Microsoft Office 365 Crack + Product Key Latest | PPT
Microsoft Office 365 Crack + Product Key Latest | PPTMicrosoft Office 365 Crack + Product Key Latest | PPT
Microsoft Office 365 Crack + Product Key Latest | PPT
laksken83
 
Latest-Adobe Photoshop Crack Free Download
Latest-Adobe Photoshop Crack Free DownloadLatest-Adobe Photoshop Crack Free Download
Latest-Adobe Photoshop Crack Free Download
utfefguu
 
Final Cut Pro Crack Version Latest 2025?
Final Cut Pro Crack Version Latest 2025?Final Cut Pro Crack Version Latest 2025?
Final Cut Pro Crack Version Latest 2025?
javeedafzal62
 
Adobe Photoshop Crack ➔ Secure Download Now
Adobe Photoshop Crack ➔ Secure Download NowAdobe Photoshop Crack ➔ Secure Download Now
Adobe Photoshop Crack ➔ Secure Download Now
laksken83
 
kernesssssl_timesssssssssssssssssssr.pdf
kernesssssl_timesssssssssssssssssssr.pdfkernesssssl_timesssssssssssssssssssr.pdf
kernesssssl_timesssssssssssssssssssr.pdf
nguyenvanthanh76bk
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
Sri Prasanna
 
4 ip services dhcp
4 ip services dhcp4 ip services dhcp
4 ip services dhcp
SagarR24
 
4 ip services dhcp-part b
4 ip services dhcp-part b4 ip services dhcp-part b
4 ip services dhcp-part b
SagarR24
 
4 ip services nat
4 ip services nat4 ip services nat
4 ip services nat
SagarR24
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
4 ip services span,rspan
4 ip services span,rspan4 ip services span,rspan
4 ip services span,rspan
SagarR24
 
Whats the Time
Whats the TimeWhats the Time
Whats the Time
APNIC
 
Analyze and Store Logs - RHCSA (RH124).pdf
Analyze and Store Logs - RHCSA (RH124).pdfAnalyze and Store Logs - RHCSA (RH124).pdf
Analyze and Store Logs - RHCSA (RH124).pdf
RHCSA Guru
 
Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025
jgfaryu7
 
Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025Microsoft Office 365 Crack Version Free Download 2025
Microsoft Office 365 Crack Version Free Download 2025
jgfaryu7
 
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
𝙳𝙾𝚆𝙽𝙻𝙾𝙰𝙳—Capcut Pro Crack For PC Latest 2025 Version
laksken83
 
Microsoft Office 365 Crack + Product Key Latest | PPT
Microsoft Office 365 Crack + Product Key Latest | PPTMicrosoft Office 365 Crack + Product Key Latest | PPT
Microsoft Office 365 Crack + Product Key Latest | PPT
laksken83
 
Latest-Adobe Photoshop Crack Free Download
Latest-Adobe Photoshop Crack Free DownloadLatest-Adobe Photoshop Crack Free Download
Latest-Adobe Photoshop Crack Free Download
utfefguu
 
Final Cut Pro Crack Version Latest 2025?
Final Cut Pro Crack Version Latest 2025?Final Cut Pro Crack Version Latest 2025?
Final Cut Pro Crack Version Latest 2025?
javeedafzal62
 
Adobe Photoshop Crack ➔ Secure Download Now
Adobe Photoshop Crack ➔ Secure Download NowAdobe Photoshop Crack ➔ Secure Download Now
Adobe Photoshop Crack ➔ Secure Download Now
laksken83
 
kernesssssl_timesssssssssssssssssssr.pdf
kernesssssl_timesssssssssssssssssssr.pdfkernesssssl_timesssssssssssssssssssr.pdf
kernesssssl_timesssssssssssssssssssr.pdf
nguyenvanthanh76bk
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
Sri Prasanna
 
Ad

More from Elaf A.Saeed (20)

IOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU WebserverIOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU Webserver
Elaf A.Saeed
 
IOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDsIOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDs
Elaf A.Saeed
 
IOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDsIOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDs
Elaf A.Saeed
 
IOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMSIOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMS
Elaf A.Saeed
 
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LEDESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
Elaf A.Saeed
 
IOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to InternetIOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to Internet
Elaf A.Saeed
 
Lesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2CLesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2C
Elaf A.Saeed
 
Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)
Elaf A.Saeed
 
Lesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo MotorLesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo Motor
Elaf A.Saeed
 
Lesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC MotorLesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC Motor
Elaf A.Saeed
 
Lesson 6 - NodeMCU with PWM Pin
Lesson 6 -  NodeMCU with PWM PinLesson 6 -  NodeMCU with PWM Pin
Lesson 6 - NodeMCU with PWM Pin
Elaf A.Saeed
 
lesson4 - NodeMCU control led
  lesson4 - NodeMCU control led  lesson4 - NodeMCU control led
lesson4 - NodeMCU control led
Elaf A.Saeed
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
Elaf A.Saeed
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
Elaf A.Saeed
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
Elaf A.Saeed
 
Embedded system introduction - Arduino Course
Embedded system introduction - Arduino CourseEmbedded system introduction - Arduino Course
Embedded system introduction - Arduino Course
Elaf A.Saeed
 
Pyton with rasperry pi
Pyton with rasperry piPyton with rasperry pi
Pyton with rasperry pi
Elaf A.Saeed
 
Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1
Elaf A.Saeed
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
Elaf A.Saeed
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
Elaf A.Saeed
 
IOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU WebserverIOT NodeMCU - NodeMCU Webserver
IOT NodeMCU - NodeMCU Webserver
Elaf A.Saeed
 
IOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDsIOT NodeMCU - Ubidots Platform to Turn on LEDs
IOT NodeMCU - Ubidots Platform to Turn on LEDs
Elaf A.Saeed
 
IOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDsIOT NodeMCU - Thinger Platform to Turn on LEDs
IOT NodeMCU - Thinger Platform to Turn on LEDs
Elaf A.Saeed
 
IOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMSIOT NodeMCU - IFTTT Templet to send SMS
IOT NodeMCU - IFTTT Templet to send SMS
Elaf A.Saeed
 
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LEDESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
ESP8266 NodeMCU Server, Client, Station Mode, and Client Control LED
Elaf A.Saeed
 
IOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to InternetIOT NodeMCU - NodeMCU Connection to Internet
IOT NodeMCU - NodeMCU Connection to Internet
Elaf A.Saeed
 
Lesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2CLesson 10- NodeMCU with LCD I2C
Lesson 10- NodeMCU with LCD I2C
Elaf A.Saeed
 
Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)
Elaf A.Saeed
 
Lesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo MotorLesson 8- NodeMCU with Servo Motor
Lesson 8- NodeMCU with Servo Motor
Elaf A.Saeed
 
Lesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC MotorLesson 7- NodeMCU with DC Motor
Lesson 7- NodeMCU with DC Motor
Elaf A.Saeed
 
Lesson 6 - NodeMCU with PWM Pin
Lesson 6 -  NodeMCU with PWM PinLesson 6 -  NodeMCU with PWM Pin
Lesson 6 - NodeMCU with PWM Pin
Elaf A.Saeed
 
lesson4 - NodeMCU control led
  lesson4 - NodeMCU control led  lesson4 - NodeMCU control led
lesson4 - NodeMCU control led
Elaf A.Saeed
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
Elaf A.Saeed
 
lesson1 - Getting Started with ESP8266
lesson1 -  Getting Started with ESP8266lesson1 -  Getting Started with ESP8266
lesson1 - Getting Started with ESP8266
Elaf A.Saeed
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
Elaf A.Saeed
 
Embedded system introduction - Arduino Course
Embedded system introduction - Arduino CourseEmbedded system introduction - Arduino Course
Embedded system introduction - Arduino Course
Elaf A.Saeed
 
Pyton with rasperry pi
Pyton with rasperry piPyton with rasperry pi
Pyton with rasperry pi
Elaf A.Saeed
 
Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1Summary of MATLAB Functions-Part1
Summary of MATLAB Functions-Part1
Elaf A.Saeed
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
Elaf A.Saeed
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
Elaf A.Saeed
 
Ad

Recently uploaded (20)

MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
LECTURE-16 EARTHEN DAM - II.pptx it's uses
LECTURE-16 EARTHEN DAM - II.pptx it's usesLECTURE-16 EARTHEN DAM - II.pptx it's uses
LECTURE-16 EARTHEN DAM - II.pptx it's uses
CLokeshBehera123
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
How to use nRF24L01 module with Arduino
How to use nRF24L01 module with ArduinoHow to use nRF24L01 module with Arduino
How to use nRF24L01 module with Arduino
CircuitDigest
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxbMain cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
SunilSingh610661
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
ELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdfELectronics Boards & Product Testing_Shiju.pdf
ELectronics Boards & Product Testing_Shiju.pdf
Shiju Jacob
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G..."Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
"Feed Water Heaters in Thermal Power Plants: Types, Working, and Efficiency G...
Infopitaara
 
new ppt artificial intelligence historyyy
new ppt artificial intelligence historyyynew ppt artificial intelligence historyyy
new ppt artificial intelligence historyyy
PianoPianist
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
LECTURE-16 EARTHEN DAM - II.pptx it's uses
LECTURE-16 EARTHEN DAM - II.pptx it's usesLECTURE-16 EARTHEN DAM - II.pptx it's uses
LECTURE-16 EARTHEN DAM - II.pptx it's uses
CLokeshBehera123
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
theory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptxtheory-slides-for react for beginners.pptx
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
How to use nRF24L01 module with Arduino
How to use nRF24L01 module with ArduinoHow to use nRF24L01 module with Arduino
How to use nRF24L01 module with Arduino
CircuitDigest
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxbMain cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
Main cotrol jdbjbdcnxbjbjzjjjcjicbjxbcjcxbjcxb
SunilSingh610661
 

Getting date and time from ntp server with esp8266 node mcu

  • 1. Internet ofThings Getting Date & Time From NTP Server With ESP8266 NodeMCU Eng. Elaf A.Saeed
  • 2. The Contents • NTP Server With ESP8266 NodeMCU. • Getting Day & Time From NTP Server With ESP8266 NodeMCU. • Getting Current Day and Time from NTP Server. • Getting Current Date and Time from NTP Server.
  • 3. Getting Day & Time & date From NTP Server With ESP8266 NodeMCU
  • 4. NTP Server With ESP8266 NodeMCU
  • 5. NTP Server With ESP8266 NodeMCU (cont.) • NTP stands for Network Time Protocol and it is a networking protocol for clock synchronization between computer systems. In other words, it is used to synchronize computer clock times in a network. • The protocol can be used to synchronize all networked devices to Coordinated Universal Time (UTC) within a few milliseconds ( 50 milliseconds over the public Internet and under 5 milliseconds in a LAN environment). • Coordinated Universal Time (UTC) is a world-wide time standard, closely related to GMT (Greenwich Mean Time). UTC does not vary, it is the same world wide.
  • 6. NTP Server With ESP8266 NodeMCU (cont.) ❑NTPArchitecture • NTP uses a hierarchical architecture. Each level in the hierarchy is known as a stratum. • At the very top are high-precision timekeeping devices, such as atomic clocks, GPS or radio clocks, known as stratum 0 hardware clocks. • Stratum 1 servers have a direct connection to a stratum 0 hardware clock and therefore have the most accurate time. • Each stratum in the hierarchy synchronizes to the stratum above and act as servers for lower stratum computers.
  • 7. NTP Server With ESP8266 NodeMCU (cont.) ❑How NTP Works? • NTP can operate in a number of ways. The most common configuration is to operate in client-server mode. The basic working principle is as follows: 1. The client device such as ESP8266 connects to the server using the User Datagram Protocol (UDP) on port 123. 2. A client then transmits a request packet to a NTP server. 3. In response to this request the NTP server sends a time stamp packet. 4. A time stamp packet contains multiple information like UNIX timestamp, accuracy, delay or time zone. 5. A client can then parse out current date & time values.
  • 8. NTP Server With ESP8266 NodeMCU (cont.) ❑Installing the NTPClient Library • We’ll use the NTPClient library to get time. In your Arduino IDE, go to Sketch > Library > Manage Libraries. The Library Manager should open. • Search for NTPClient and install the library by Fabrice Weinber as shown in the following image.
  • 9. Getting Day & Time From NTP Server With ESP8266 NodeMCU
  • 10. Getting Day & Time From NTP Server With ESP8266 NodeMCU ❑NTPClient Library Time Functions • getDay() – returns an int number that corresponds to the the week day (0 to 6) starting on Sunday; • getHours() – returns an int number with the current hour (0 to 23) in 24 hour format; • getMinutes() – returns an int number with the current minutes (0 to 59); • getSeconds() – returns an int number with the current second; • getEpochTime() – returns an unsigned long with the epoch time (number of seconds that have elapsed since January 1, 1970 (midnight GMT); • getFormattedTime() – returns a String with the time formatted like HH:MM:SS;
  • 11. Getting Day & Time From NTP Server With ESP8266 NodeMCU (cont.)
  • 12. Getting Current Day and Time from NTP Server (cont.)
  • 13. Getting Current Day and Time from NTP Server (cont.)
  • 14. Getting Current Date and Time from NTP Server ❑Function that is used in Code 1. year()➔ Set or read the RTC year value. Syntax year(unsigned long year) 2. month() ➔ Set or read the RTC month value. Syntax month(unsigned long month) 3. day() ➔ Set or read the RTC day value. Syntax day(unsigned long day)
  • 15. Getting Current Date and Time from NTP Server (cont.) ❑Function that is used in Code 4. minute() ➔ Set or read the RTC minute value. Syntax: minute(unsigned long minute) 5. second() ➔ Set or read the RTC second value. Syntax: second(unsigned long second) .
  • 16. Getting Current Date and Time from NTP Server (cont.)
  • 17. Getting Current Date and Time from NTP Server (cont.)
  • 18. Getting Current Date and Time from NTP Server (cont.)
  • 19. Getting Current Date and Time from NTP Server (cont.)