Top Internet of Things Daily & Weekly

ESP8266 OLED Clock IoT Using AJAX

ESP8266 OLED Clock IoT Using AJAX
🔧 
📺 

#Gadgets #Projects

  • In the sketch AJAX is used to update the date and time every second.
  • The source code for this project demonstrates some coding concepts that can be useful in other projects.
  • If you are unable to compile the code, make sure you have installed the proper libraries (see previous setup steps).If the sketch compiles but the OLED display doesn’t …
  • The date and time are then displayed on an OLED display and also via a web browser accessing the ESP8266 web server.

This video demonstrates using an ESP8266-12E and an OLED display as a digital clock. While clocks may be ubiquitous these days, this project demonstrates some useful concepts that can be used in a variety of applications. The Arduino IDE is used to develop a sketch that access a NPT time server to accurately set the date and time. The date and time are then displayed on an OLED display and also via a web browser accessing the ESP8266 web server. The web page allows the setting of options like Time Zone, 24 hour clock, daylight savings and a variable to control the time server update interval. The web page uses AJAX to update the time without reloading the entire web page.There is also a brief overview of the source code sketch in the video.

@ESP8266: ESP8266 OLED Clock IoT Using AJAX
🔧
📺

#Gadgets #Projects

This video demonstrates using an ESP8266-12E and an OLED display as a digital clock. While clocks may be ubiquitous these days, this project demonstrates some useful concepts that can be used in a variety of applications. The Arduino IDE is used to develop a sketch that access a NPT time server to accurately set the date and time. The date and time are then displayed on an OLED display and also via a web browser accessing the ESP8266 web server. The web page allows the setting of options like Time Zone, 24 hour clock, daylight savings and a variable to control the time server update interval. The web page uses AJAX to update the time without reloading the entire web page.

AJAX (Asynchronous JavaScript and XML) allows background updating of data without reloading the entire page. In this sketch AJAX is used to update the date and time every second. Only the date and time are sent by the web server instead of the entire page. Reloading the entire page could take too long and wouldn’t be possible every second. This sketch shows a simple example of creating and handling AJAX calls.

This sketch uses Drop Down, Text Box and Check Box form elements to set variables in the code for Time Zone, 24 Hour Time, Daylight Savings and a variable to change the NTP server update interval. Using form posts to control application variables can really take an IoT project to the next level. It allows you to interact with and control devices rather than just observe output.

When the form is submitted, the variables are stored in a properties file. This file is read on startup to set the default preferences for Time Zone, 24 Hour Time, Daylight Savings and the NTP update interval. This way the application always goes back to the last used preferences.

ESP8266 OLED Clock IoT Using AJAX

Comments are closed, but trackbacks and pingbacks are open.