Skip to content

Some projects require date and time data, e.g. data logging applications. As long as you stay within your Wi-Fi coverage, there are no problems with this task. But how do you solve the problem without Wi-Fi or other network coverage ? The article explains alternative methods and shows a way to test the time accuracy of your ESP32 board.

License

Notifications You must be signed in to change notification settings

AndroidCrypto/ESP32_Provisioning_of_Date_and_Time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 Provisioning of Date and Time

Some projects require date and time data, e.g. data logging applications. As long as you stay within your Wi-Fi coverage, there are no problems with this task. But how do you solve the problem without Wi-Fi or other network coverage ? The article explains alternative methods and shows a way to test the time accuracy of your ESP32 board.

This is the accompanying repository for my article "Several methods for Provisioning of Date & Time data to an ESP32 device" available here: https://medium.com/@androidcrypto/several-methods-for-provisioning-of-date-time-data-to-an-esp32-device-9f7f866a867d

There are several sketches in this repository:

Esp32_C6_SM_Tft_ST7789_TimestampByNtp_v03

Image 1

Shows the usual way of date and time provisioning: log-in to your internet connection and get the date and time from an NTP Time Server. As the provided time is "UTC" ("Universal Coodinated Tinme") a timezone is necessary to get the local time.

This sketch is using the TFT_eSPI graphics library.

Access Point credentials:
SSID: Wi-Fi Provisioning
Password: 12345678
Provisioner address: 192.168.4.1

Esp32_C6_SM_Tft_ST7789_TimestampByWiFiForm_v03

Image 2

The ESP32 spans up a Wi-Fi Access Point and provides a simple form to enter the date and time data.

This sketch is using the TFT_eSPI graphics library.

Access Point credentials:
SSID: ESP32 Clock
Password: 12345678
Web form address: 192.168.4.1

Esp32_C6_SM_Tft_ST7789_TimestampByWebBLEForm_v03

Image 3

The ESP32 is setting up a Bluetooth Low Energy Gatt Server (BLE Gatt Server) that can get accessed by Web BLE form. Alternativly you can connect by a BLE terminal app like "nRF Connect" with the Gatt Server and enter the date and time credentials in the Timestamp characteristic: 05/10/2025/16/40/24

Image 4

This sketch is using the TFT_eSPI graphics library.

Web BLE credentials:
URL: https://androidcrypto.github.io/WebBle1/iwc03.html
BLE Gatt Server name: ESP32_Clock
Password: no password for connecting
SERVICE_UUID: 19b10000-e8f2-537e-4f6c-d104768a1214
Timestamp Characteristic UUID: 19b10003-e8f2-537e-4f6c-d104768a1214
Timestamp example: 05/10/2025/16/40/24

Esp32_C6_SM_Tft_ST7789_TimestampByGps_v03

Image 5

A GPS Module is connected to the ESP32 that receives the current coordinate of the device. During this process a very accurate date and time source is available.

This sketch is using the TFT_eSPI graphics library.

Esp32_S3_SM_Lov_ST7789_InternalClockAccuracy_v06

Image 6

This sketch is using the LovyanGFX graphics library.

Esp32_S3_SM_LovyanGFX_Oled_SSD1306_InternalClockAccuracy_v06

Image 7

This sketch is using the LovyanGFX graphics library.

Development Environment

Arduino IDE Version 2.3.6 (Windows)
arduino-esp32 boards Version 3.2.0 (https://github.com/espressif/arduino-esp32)

About

Some projects require date and time data, e.g. data logging applications. As long as you stay within your Wi-Fi coverage, there are no problems with this task. But how do you solve the problem without Wi-Fi or other network coverage ? The article explains alternative methods and shows a way to test the time accuracy of your ESP32 board.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published