Local NTP server

DISCLAIMER OF LIABILITY

THE PROCEDURES AND SAMPLES IN THIS PAGE ARE PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND (EITHER EXPRESS OR IMPLIED), INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A SPECIFIC OR GENERAL PURPOSE AND THOSE ARISING BY STATUTE OR BY LAW, OR FROM A CAUSE OF DEALING OR USAGE OF TRADE.

THIS ALSO APPLIES TO THE CONSEQUENCES OF ANY ACTIONS TAKEN ON THE BASIS OF THE INFORMATION PROVIDED.

Local NTP

It is possible to set a Windows NTP server to update the date and time of the AdvanReader-150.03.

Setting a Windows NTP server

Windows implements the W32Time service as both an NTP client and server. The service is off by default. So configuring a system as an NTP server requires both enabling the W32Time service and configuring it as a server. The process is very simple.

First, use the Services console to locate the Windows Time service. It will likely be off as shown:

It is necessary to both start the service and configure it for Automatic start as shown:

Enabling the NTP server service requires a quick registry modification. Open Regedit and navigate to HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpServer and change Enabled from 0 to 1. This is shown in the next image:

The last step is to update the Windows Time service’s running configuration. You do this by opening a command prompt and typing the w32tm /config /update command. You can then verify that the NTP server service is enabled with the w32tm /query /configuration command:

Configuring AdvanReader

Connect to the reader by SSH (PuTTy, ...) and execute the following commands:

sudo service ntp stop
date
sudo ntpdate <IP-Server>
date

If the ntpdate command is not found, do the following:

    • Connect the reader to a network with internet access.

    • Execute the command: sudo apt-get update

    • Execute the command: sudo apt-get install ntpdate

If the ntpdate command doesn't work, the problem maybe a lack of synchronization in the Windows Server. Execute the following commands on the Windows Server with Administrator rights:

@echo on & @setlocal enableextensions

@echo =========================

@echo Turn off the time service

net stop w32time

@echo ======================================================================

@echo Set the SNTP (Simple Network Time Protocol) source for the time server

w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"

@echo =============================================

@echo ... and then turn on the time service back on

net start w32time

@echo =============================================

@echo Tell the time sync service to use the changes

w32tm /config /update

@echo =======================================================

@echo Reset the local computer's time against the time server

w32tm /resync /rediscover

@endlocal & @goto :EOF

Adding the NTPDATE as a service

Once the ntpdate command has worked, do the following to disable the old NTP service and execute the ntpdate command every hour:

sudo su

cd /etc/init.d

update-rc.d ntp remove

cd /home/keonn

nano ntpupdate.sh

      • Add the following:

#!/bin/bash

sudo ntpdate <IP-Server>

      • Ctrl+X and then yes to save the file. Then:

chmod +x ntpupdate.sh

crontab -e

      • Click "i"

      • Go to the last line and copy the following: 0 * * * * /home/keonn/ntpupdate.sh

      • Click "ESCAPE"

      • Type ":wq"