Skip to Content

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

CommandDescriptionOK Response
SRTC AUTO⭐ Automatic - tries allRRTC AUTO OK [method]
SRTC CEL NTPCellular + NTPRRTC CEL NTP OK
SRTC CEL HTTPCellular + HTTPRRTC CEL HTTP OK
SRTC WIF NTPWiFi + NTPRRTC WIF NTP OK
SRTC WIF HTTPWiFi + HTTPRRTC WIF HTTP OK
SRTCddmmyyhhmmssManual 12 digitsRRTC CFG OK

SRTC AUTO — Automatic Synchronization

Automatic mode tries all methods in order until one works:

  1. WIF NTP — WiFi with native NTP protocol
  2. WIF HTTP — WiFi with HTTP API
  3. CEL NTP — Cellular with NTP via AT commands
  4. 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.org
  • time.google.com
  • time.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:

PositionFieldRange
1-2Day01-31
3-4Month01-12
5-6Year00-99
7-8Hour00-23
9-10Minutes00-59
11-12Seconds00-59

Example: Set 12/18/2024 14:30:25

>SRTC181224143025<

Response:

>RRTC CFG OK...

NTP vs HTTP

FeatureNTPHTTP
ProtocolUDP port 123TCP port 80
ReliabilityHighMedium
Rate limitNoYes
LatencyLowHigher
Servers3 redundant1 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
Last updated