NTP Topic
After the device successfully connects to the network, it will use the NTP interface to synchronize standard time for the first time. Then the device will attempt to connect to the Broker. After successfully connecting to the Broker, it will synchronize standard time via the NTP topic every 24 hours.
Device's NTP Time Synchronization Request
Topic: thing/{product_code}/{device_code}/ntp/client
This is the default topic. If a device-specific topic format has been assigned to the device, the topic will be: [Device's Topic Prefix]/ntp/client
This is the default topic. If a device-specific topic format has been assigned to the device, the topic will be: [Device's Topic Prefix]/ntp/client
Message Content Example:
"ts" represents the message timestamp.
{"mid":"19b4916aa7130741","data":779979678,"ts":"1741318031322"}
"data" represents the device's NTP request time (milliseconds since the device was powered on);"ts" represents the message timestamp.
Broker's NTP Time Synchronization Response
Topic: thing/{product_code}/{device_code}/ntp/server
This is the default topic. If a device-specific topic format has been assigned to the device, the topic will be: [Device's Topic Prefix]/ntp/server
This is the default topic. If a device-specific topic format has been assigned to the device, the topic will be: [Device's Topic Prefix]/ntp/server
Response Content Example:
data: "fetch" must be the same as the "data" from the device's message above (device's NTP request time); "stamp" is the Broker's timestamp (in seconds); "milli" is the millisecond part.
ts: Message timestamp, representing the current time.
{"mid":"19b4916aa7130741","data":{"fetch":779979678,"stamp":1741318031,"milli":522},"ts":1741318031522}
mid: Message ID, a 16-character string, must be the same as the "mid" from the device's message above.data: "fetch" must be the same as the "data" from the device's message above (device's NTP request time); "stamp" is the Broker's timestamp (in seconds); "milli" is the millisecond part.
ts: Message timestamp, representing the current time.