Use Fitlet As A Time Server For Isolated Networks

Application notes using fitlet. Credit goes to user Hassellbear for publishing more than enough cool application notes to justify a dedicated sub-forum.

Moderator: hassellbear

Post Reply
hassellbear
Posts: 106
Joined: Mon May 28, 2012 12:25 pm

Use Fitlet As A Time Server For Isolated Networks

Post by hassellbear »

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
TimeServer.PNG
TimeServer.PNG (103.67 KiB) Viewed 11796 times

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
Hardware2.jpg
Hardware2.jpg (56.35 KiB) Viewed 11796 times



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.

hassellbear
Posts: 106
Joined: Mon May 28, 2012 12:25 pm

Use Fitlet As A Time Server For Isolated Networks

Post by hassellbear »

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.
CGPS.png
CGPS.png (139.39 KiB) Viewed 11793 times


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:
NTPQ -P.png
NTPQ -P.png (46.44 KiB) Viewed 11793 times

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.
Using Fitlet Time Server.jpg
Using Fitlet Time Server.jpg (42.6 KiB) Viewed 11792 times




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.

Post Reply

Return to “Cool stuff with fitlet”