RTC Command — Clock Synchronization
Available since v1.9.17 — Automatic synchronization via NTP and HTTP.
Synchronizes the device’s internal clock using NTP servers, HTTP APIs or manual configuration.
What is it for?
The RTC command helps you maintain accurate device time for:
- ⏰ Precise timestamps — Reports with exact time without relying on GPS
- 🌐 Automatic sync — Get time via internet
- 📡 Multiple sources — WiFi or cellular, NTP or HTTP
- 🔧 Manual configuration — For cases without connectivity
NTP is more reliable than HTTP: uses UDP, has no rate limiting and has 3 redundant servers.
Command Summary
| Command | Description | OK Response |
|---|---|---|
SRTC AUTO | ⭐ Automatic - tries all | RRTC AUTO OK [method] |
SRTC CEL NTP | Cellular + NTP | RRTC CEL NTP OK |
SRTC CEL HTTP | Cellular + HTTP | RRTC CEL HTTP OK |
SRTC WIF NTP | WiFi + NTP | RRTC WIF NTP OK |
SRTC WIF HTTP | WiFi + HTTP | RRTC WIF HTTP OK |
SRTCddmmyyhhmmss | Manual 12 digits | RRTC CFG OK |
SRTC AUTO — Automatic Synchronization
Automatic mode tries all methods in order until one works:
- WIF NTP — WiFi with native NTP protocol
- WIF HTTP — WiFi with HTTP API
- CEL NTP — Cellular with NTP via AT commands
- CEL HTTP — Cellular with HTTP API
>SRTC AUTO<Response:
>RRTC AUTO OK WIF NTP...The response indicates which method worked. Useful for connectivity diagnostics.
Network Synchronization
WiFi + NTP
Uses native SNTP protocol. Requires active WiFi connection.
>SRTC WIF NTP<WiFi + HTTP
Uses worldtimeapi.org API via WiFi.
>SRTC WIF HTTP<Cellular + NTP
Uses modem AT+QNTP command. Tries 3 servers:
pool.ntp.orgtime.google.comtime.cloudflare.com
>SRTC CEL NTP<Cellular + HTTP
Uses worldtimeapi.org via mobile data connection.
>SRTC CEL HTTP<Manual Configuration
Format: SRTCddmmyyhhmmss where each digit pair represents:
| Position | Field | Range |
|---|---|---|
| 1-2 | Day | 01-31 |
| 3-4 | Month | 01-12 |
| 5-6 | Year | 00-99 |
| 7-8 | Hour | 00-23 |
| 9-10 | Minutes | 00-59 |
| 11-12 | Seconds | 00-59 |
Example: Set 12/18/2024 14:30:25
>SRTC181224143025<Response:
>RRTC CFG OK...NTP vs HTTP
| Feature | NTP | HTTP |
|---|---|---|
| Protocol | UDP port 123 | TCP port 80 |
| Reliability | High | Medium |
| Rate limit | No | Yes |
| Latency | Low | Higher |
| Servers | 3 redundant | 1 server |
HTTP may fail due to API rate limiting. Prefer NTP when possible.
Usage Examples
Sync at power on
# Try automatic synchronization
>SRTC AUTO<
>RRTC AUTO OK CEL NTP...Check current time
>QRTC<
>RRTC 270126182545...Set time without internet
# Manually set 01/27/2026 18:30:00
>SRTC270126183000<
>RRTC CFG OK...Technical Notes
- Time is stored in internal RTC and persists during brief power outages
- When obtaining GPS fix, time syncs automatically from satellites
- SRTC is useful when device is indoors without GPS signal
- NTP servers use UTC timezone, device adjusts according to configuration