Gergely Imreh
Published © CC BY

Dual Satellite NTP Server with Navspark

Using the Beidou satellite navigation network in conjunction with GPS to have more precise NTP server.

IntermediateFull instructions provided3,157
Dual Satellite NTP Server with Navspark

Things used in this project

Hardware components

Raspberry Pi 2 Model B
Raspberry Pi 2 Model B
×1
Navspark-BD
×1
GPS/Beidou internal active antenna
×1
prototyping breadboard
... and some connectors, wires, etc, to make the adapter board
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Navspark + Raspberry Pi connection diagram

Code

Code snippet #1

Plain text
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200

Code snippet #2

Plain text
sudo systemctl disable serial-getty@ttyAMA0.service

Code snippet #3

Plain text
KERNEL=="ttyAMA0", RUN+="/bin/stty -F /dev/ttyAMA0 115200 raw -echo"

Code snippet #4

Plain text
# Default settings for gpsd.
START_DAEMON="true"
GPSD_OPTIONS="-b -n"
DEVICES="/dev/ttyAMA0"
USBAUTO="true"

Code snippet #5

Plain text
sudo systemctl start gpsd

Code snippet #6

Plain text
dttoverlay=pps-gpio,gpiopin=8

Code snippet #7

Plain text
$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1448436177.999366423, sequence: 199 - clear  0.000000000, sequence: 0
source 0 - assert 1448436178.999373610, sequence: 200 - clear  0.000000000, sequence: 0
...

Code snippet #8

Plain text
lock_all
 
logdir /var/log/chrony
log measurements statistics tracking refclocks
 
# being a server
allow 192.168/16
 
server 2.tw.pool.ntp.org iburst
server 3.asia.pool.ntp.org iburst
server 2.asia.pool.ntp.org iburst
server 1.europe.pool.ntp.org iburst
 
# on-boot time setup, from https://news.ycombinator.com/item?id=9796885
makestep 0.1 1
 
# from https://www.raspberrypi.org/forums/viewtopic.php?f=41&t=1970&start=275
refclock PPS /dev/pps0 lock GPS prefer refid PPS0
# If Beidou, there is a day offset somehow
refclock SHM 0 offset -86400 delay 0.1 refid GPS noselect
 
leapsectz right/Asia/Taipei

Code snippet #9

Plain text
sudo systemctl start chrony

Github

https://github.com/ago/pps-tools

Gist

https://gist.github.com/imrehg/5548370432737a82f58c

Credits

Gergely Imreh

Gergely Imreh

8 projects • 23 followers
Physicist, hacker, commander of a Zerg hive.

Comments