Technology

Reolink RLC-520 (And others) – Set Custom NTP

By April 28, 20223 Comments

Introduction

I have a few Reolink cameras. Recently, I noticed the time of many of the cameras was not set correctly.

Since, I keep all of my IOT and Security devices isolated from the internet, they are not able to communicate with the pre-defined external NTP server. However, I do have a NTP server running on my opnsense firewall which they do have access to.

But, it appears the ability to set a custom NTP server no longer exists in the reolink’s firewall.

The Solution – A rest api.

Just a simple rest-api call. That is the only solution required here.

Just replace YOUR_CAMERAS_IP, YOUR_NTP_SERVER_IP, YOUR_USER_ID, and YOUR_PASSWORD with the proper values.

curl -X POST -i 'http://YOUR_CAMERAS_IP/cgi-bin/api.cgi?cmd=SetNtp&user=YOUR_USER_ID&password=YOUR_PASSWORD' --data '[
{
"cmd":"SetNtp",
"param":{
"Ntp":{
"enable":1,
"server":"YOUR_NTP_SERVER_IP",
"port":123,
"interval":1440
}
}
}
]'

After executing the command, you will get back a response.

HTTP/1.1 200 OK
Date: Thu, 28 Apr 2022 15:31:56 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff

[
   {
      "cmd" : "SetNtp",
      "code" : 0,
      "value" : {
         "rspCode" : 200
      }
   }
]

In this case, rspCode, or Response Code, 200 means, Success.

After this, you should be good to go.

Credit for this, goes to THIS POST on reddit.

Join the discussion 3 Comments

  • virouf says:

    merci! Malheureusement, je n’arrive pas faire fonctionner la commande… je prends le retour ci-dessous.
    Je ne trouve pas la signification du code -4 …

    HTTP/1.1 200 OK
    Date: Sat, 30 Jul 2022 07:52:22 GMT
    Content-Type: text/html
    Transfer-Encoding: chunked
    Connection: keep-alive
    X-Frame-Options: SAMEORIGIN
    X-XSS-Protection: 1; mode=block
    X-Content-Type-Options: nosniff

    [
    {
    “cmd” : “SetNtp”,
    “code” : 1,
    “error” : {
    “detail” : “param error”,
    “rspCode” : -4
    }
    }
    ]

    • virouf says:

      j’ai fini par réussir … pour info je le faisais pas l’invit de command windows, en passant pour l’advanced rest client c’est passé tout seul … problème de format donc

Leave a Reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 93 other subscribers

%d bloggers like this: