How to configure Endura Time Synchronization (NTP Server Configuration)

Issue

  • Clock(s) on Endura Device(s) are not synchronized.
  • Possible mismatch of video playback timestamp within WS5000/5200.
  • Personnel maintaining the system wish to follow best practices.

Product Line

Pelco Video Management

Environment

  • Pelco Endura System Manager (SM5000 or EE500).

Cause

  • Network Time Protocol Synchronization setup is invalid or not optimal.

Resolution

note:  Before following the steps in this article, you must know the IP Address of your NTP Server, which can be an NTP Server Device (recommended) or a Windows PC Workstation. For information on configuring a Windows PC Workstation to be an NTP Server for your Endura System, see Lessons Learned Article LL#10828.
note: Except where directed, proceed through the steps of this article in order they are presented.

Section 1: Set the Time Server address within Endura WS5000/WS5200 Workstation Client Application
 
  1. Launch Endura WS5000/WS5200 Workstation Client Application and login as an administrator account (default credentials = username: admin | password: admin).
     
  2. Go into Setup (toolbar icon is a wrench).
     
  3. In the Time Server field, Input the IP Address of the Endura System Manager (model SM5000, EE500, or SM5200) and press OK.


Section 2: Manaully edit Endura System Manager NTP Configuration file

1. Launch Endura Utilities, log in and press Search.
note: The default login credentials for Endura Utilities version 2.2 and below is [Username: Administrator and Password: configapp], however version 2.3 and greater removed that unique login credential requirement, and instead authenticates against the standard Endura Credentials; The default login in that case is [Username: admin and Password: admin].

2. From the System Attributes tab, right-click the Endura System Manager in question and select SSH Into...
note: The default Linux Administrative login credentials for Endura devices is [ Username: root and Password: pel2899100 ].
note: If you have never SSH'd into the unit before, you will likely receive the following warning prompt...

...simply click Yes to proceed.

note: If you receive the following error...

Visit http://www.putty.org/ to download and then copy putty.exe into your workstation c:\windows\system32 folder.
note: If SSH fails to connect in any other fashion, the NVR/DVR may not be able to fully boot up, and you will need to connect a VGA Monitor and PC Keyboard directly at the local NVR/DVR console in order to proceed. 

3. You are now at the root prompt. Enter the following command…
vi /etc/ntp.conf
...and press enter/return.

4. You are now using Linux vi. Press insert to begin editing, and use and enter/return to create new lines where needed, as well as delete or backspace if needed. Edit this file by adding the lines which are bolded in blue below...

##### BEGIN HAL NTP SETTINGS #####
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 4
server 192.168.5.240
driftfile /etc/ntp/drift

note: For numbers, use only the number keys along the top of the keyboard (don't use the numpad keys).
note: In this example, line 4 shows 192.168.5.240 as the IP address of the third party NTP Server. Section 1 should have set this already, so only adjust this if needed.
note: In this example, we are setting the Endura System Manager Local Clock to stratum of 4. Depending on network and other metrics at a given Facility, this may need to be re-adjusted in the future for proper operation. See step 8 for more details.

5. Press escape to exit editing mode. Save the file changes by entering a colon (hold shift and the : key simultaneously), and then release shift and type wq and press enter/return.
note If you wish to exit vi without saving the changes, enter q! instead of wq, and press  enter/return.  
note: If using two SM5000 units (Primary/Failover), it is recommended to also perform steps 3-5 on the Failover SM5000, so that - if the Primary SM ever goes fully down - the Failover SM5000 will have the correct time.

6. Reboot the system by typing reboot and pressing enter/return. Or type service ntpd restart from the putty screen.

7. Once the Endura System Manager has finished rebooting, again use Endura Utilities to SSH into it (step 2 above).
note: Significant Time variation may take a considerable amount of time to become fully synchronized. For instance, an encoder or camera that is 600 seconds off of the System Manger time may slowly adjust over a period of hours or days before becoming completely synchronized. In addition, some devices may have service restarts, or full reboots if time change is greater than 20 minutes. To immediately synchronize the time instead of waiting, see step 10 below.
 

8. To verify the SM5000 is properly synchronizing with the NTP Server, type ntpq -p and press enter/return...

note: When properly configured, this command will show an asterisk (*) next to the IP Address of your preferred NTP Server, which means it has been elected as the most reliable time source. If this does not occur after 15 minutes, refer to the Troubleshooting Section at the bottom of this article.

9. To verify correct System Time, type date and then press enter/return...

note: If the displayed time or date is correct, you are finished with this article. Otherwise goto step 10.

10. For all Endura Devices except for Sarix Cameras or Encoders, immediate synchronization can be forced using the command ntpdate -u , as seen in the example below...

note: Immediate time changes greater than 20 minutes may cause Endura Devices to reboot.

11. For Sarix Cameras or Encoders, the time will automatically update within the next renewal interval (default 1800 seconds). If it does not, use one of the following methods to resolve...

a. Using the latest version of Pelco Utilities (see LL#8397), right-click a Sarix Camera(s) or Encoder(s) and select Device Actions > Set NTP Address, then enter the NTP Server Address and press OK.

or...

b. Visit the Sarix WebUI for each Camera or Encoder, login and go to Settings, then make sure the Time Server is set to either Manual (best if using Static IP Addressing) with the IP Address of the Endura System Manager, or Auto (use when the Endura System Manager is providing the IP Addressing via DHCP)...


note: If using the Auto setting above, visit the Endura System Manager WebUI, login and go to Servers > DHCP, select the correct vlan DHCP Scope, then choose Edit Client Options and ensure the NTP Server Address is present as seen in the below example...


12. Reboot Sarix Camera(s) or Encoder(s) if changes do not take affect.



Optional Steps
To manually adjust the time, use the date -s command...
Example: date  -s  "28 MAR 2013 17:28:00" 
...and press enter/return.

Troubleshooting
Follow this section to identify and resolve (or workaround) issues preventing the preferred NTP Server from being elected as the Authoritative Time Source (*) in the ntpq -p output from step 8 above.

It is fairly common for the ntpq -p output to show that the Elected Authoritative Time source (*) is switching or varying over time, changing between your preferred NTP Server and the Endura System Manager Local Clock, and back again. The troubleshooting steps in this section should only be followed if the ntpq -p output fails to show the preferred NTP Server as the Authoritative Time Source (*) at least once daily.

Reasons for Election Failure include Daylight Savings Time misconfigurations, stratum, and performance and reliability metrics such as Jitter, which is the amount of variation in concurrent query results from an NTP Server. See "The NTP FAQ and HOWTO: Understanding and using the Network Time Protocol" for details.

Poor Jitter usually indicates a network latency/hop count issue, or a situation where the provided NTP Server IP Address points to a device that has a sporadic internal clock; This can occur when using a Windows PC Workstation as the NTP Server in your Endura System Manager ntp.conf, whilst the Windows PC Workstation itself is also synchronizing with yet another Time Server or Device, such as a Serial or Network based GPS Device or Internet Time Server. 
 

To Resolve

  • First verify that the Preferred NTP Server Device or Workstation you are attempting to synchronize Endura to has correct local time, including time zone and Daylight Savings Time configuration (DST must be enabled and updated after the 2008 North American DST Changes). Consult your Network/IT Personnel for assistance if needed.
     
  • Try increasing the Endura System Manager local clock stratum to 15 (see steps 3 and 4 above).
     
  • Optimize the network path from your Endura System Manager to your preferred NTP Server. Consult your Network/IT Personnel for assistance if needed.


To Workaround
If an Election Issue cannot be resolved, configure the Endura System Manager to synchronize with the preferred NTP Server every hour as follows -

  • From SM5000 SSH Linux Shell (Steps 1 and 2 above), create an hourly cron job...
    echo "ntpdate -u 192.168.5.240 >> /tmp/cron_job.log" > /etc/cron.hourly/timesync.cron
    ...and press enter/return. 
    note: As in step 4, adjust the NTP Server Address 192.168.5.240 as needed.
     
  • Set proper file permissions...
    chmod 777 /etc/cron.hourly/timesync.cron
    ...and press enter/return.