Overview
Using some simple software and an inexpensive USB type GPS receiver, Fitlet can easily function as a time server for isolated networks where Internet and WAN connectivity is unavailable.
A Time Server
This application note builds on the Fitlet GPS Time Source application which can be found here:
http://www.fit-pc.com/forum/viewtopic.php?f=153&t=5841
Hardware
The hardware required for this application is as follows:
1. fitlet
2. GPS Receiver - USB type (I am using GlobalSat BU-353)
3. Network Router
Software
The following software is required for the Fitlet Network Time Server application. It is all available in the Linux package repositories.
1. ntp
2. ntpdate
3. gpsd
4. gpsd-clients
5. python-gps
About GPSD
GPSD is a service dameon which monitors the GPS units connected to your system and makes the data they provide available to other applications. It is more or less an indispensable application for working with GPS systems in Linux.
Use Fitlet As A Time Server For Isolated Networks
Moderator: hassellbear
-
- Posts: 106
- Joined: Mon May 28, 2012 3:25 pm
-
- Posts: 106
- Joined: Mon May 28, 2012 3:25 pm
Use Fitlet As A Time Server For Isolated Networks
Software and System Configuration
1. Follow the installation steps indicated in the Fitlet GPS Time Source Application which can be found here:
http://www.fit-pc.com/forum/viewtopic.php?f=153&t=5841
2. Complete the following additional steps
A. Using an editor such as nano, make the following changes to the file /etc/ntp.conf
i. Comment out the line
restrict 192.168.123.0 mask 255.255.255.0 notrust
by adding a # in front.
It should now be
# restrict 192.168.123.0 mask 255.255.255.0 notrust
ii. Add the line
restrict 192.168.1.0 mask 255.255.255.0 nomodify
B. Restart gpsd and ntpd as follows:
i. killall -9 gpsd ntpd
ii. ntpd -gN
iii. gpsd -b -n /dev/ttyUSB0
C. Verify the correct operation of the GPS and GPSD by running the command CGPS. Pay special attention to the parameter Time Offset. It is typically less than 1. If it is a huge number, there is a problem.
D. If cgps returns active, normal output then verify the correct operation of ntp using the command ntpq -p
You should get a listing similar to:
An Important Note
Shortly after bootup, Fitlet uses ntpdate to initially set the system clock. Thereafter, the ntp dameon keeps the clock synchronized to ntp servers including your GPS. Unfortunately, ntpdate will not accept time data from a gps - it only uses ntp servers. Therefore, if you operating where internet service is unavailable, you must manually set the clock to within 4 hours of actual time after bootup. After you initially set the linux system clock, the ntp dameon takes over and uses the GPS time to synchronize the system clock. Please note that if your initial time setting is 4 hours or more different from the actual time, the ntp dameon will not correct the linux system clock to GPS time. The initial setting must be less than 4 hours different form the actual time.
Results
Fitlet is now configured to act as a NTP time server for all computers on the 192.168.1.0 subnet.
For this demonstration, the IP address of my Fitlet is 192.168.1.2
The image shown below is an example of my Windows 7 fitPC3 using Fitlet as a NTP server where the only NTP time source available is the GPS connected to Fitlet.
Conclusions
1. Using a simple GPS receiver, Fitlet can serve as an accurate and effective time server for networks which do not have access to conventional network time sources.
2. Fitlet again demonstrates is adaptability and versatility.
1. Follow the installation steps indicated in the Fitlet GPS Time Source Application which can be found here:
http://www.fit-pc.com/forum/viewtopic.php?f=153&t=5841
2. Complete the following additional steps
A. Using an editor such as nano, make the following changes to the file /etc/ntp.conf
i. Comment out the line
restrict 192.168.123.0 mask 255.255.255.0 notrust
by adding a # in front.
It should now be
# restrict 192.168.123.0 mask 255.255.255.0 notrust
ii. Add the line
restrict 192.168.1.0 mask 255.255.255.0 nomodify
B. Restart gpsd and ntpd as follows:
i. killall -9 gpsd ntpd
ii. ntpd -gN
iii. gpsd -b -n /dev/ttyUSB0
C. Verify the correct operation of the GPS and GPSD by running the command CGPS. Pay special attention to the parameter Time Offset. It is typically less than 1. If it is a huge number, there is a problem.
D. If cgps returns active, normal output then verify the correct operation of ntp using the command ntpq -p
You should get a listing similar to:
An Important Note
Shortly after bootup, Fitlet uses ntpdate to initially set the system clock. Thereafter, the ntp dameon keeps the clock synchronized to ntp servers including your GPS. Unfortunately, ntpdate will not accept time data from a gps - it only uses ntp servers. Therefore, if you operating where internet service is unavailable, you must manually set the clock to within 4 hours of actual time after bootup. After you initially set the linux system clock, the ntp dameon takes over and uses the GPS time to synchronize the system clock. Please note that if your initial time setting is 4 hours or more different from the actual time, the ntp dameon will not correct the linux system clock to GPS time. The initial setting must be less than 4 hours different form the actual time.
Results
Fitlet is now configured to act as a NTP time server for all computers on the 192.168.1.0 subnet.
For this demonstration, the IP address of my Fitlet is 192.168.1.2
The image shown below is an example of my Windows 7 fitPC3 using Fitlet as a NTP server where the only NTP time source available is the GPS connected to Fitlet.
Conclusions
1. Using a simple GPS receiver, Fitlet can serve as an accurate and effective time server for networks which do not have access to conventional network time sources.
2. Fitlet again demonstrates is adaptability and versatility.