Sync / Set / Get current time
[ESP140](SYNC) (srv1=XXXXX) (srv2=XXXXX) (srv3=XXXXX) (tzone=+HH:SS) (ntp=YES/NO) (time=YYYY-MM-DDTHH:mm:ss) NOW json=(no) pwd=(admin password)
-
json=no the output format can be in JSON or plain text
-
pwd=(admin password)the admin password if authentication is enabled -
srv1 / srv2 / srv3
- if srv1 / srv2 / srv3 are empty, it will display current NTP servers
- if srv1 / srv2 / srv3 are not empty, it will set the NTP servers
-
tzone
- if tzone is empty, it will display current time zone
- if tzone is not empty, it will set the time zone
-
time
- if time is empty, it will display current time
- if time is not empty, it will set the time
-
ntp
- if ntp is empty, it will display current NTP state
- if ntp is not empty, it will set the NTP state
-
SYNC
- if SYNC, it will restart NTP service to sync time
-
NOW
- if NOW, it will display current time in ISO 8601 format with time zone
Output
Section titled “Output”- In json format
{ "cmd":"140", "status":"ok", "data":"2020-01-01T00:00:00 (+08:00)"}cmdId of requested command, should be140statusstatus of command, should beokdatacontent of response, here the time