Dual Source GPS/DCF77 NTP-Server with AIS and ADS-B receivers: Unterschied zwischen den Versionen

Aus DL8RDS Wiki
Wechseln zu: Navigation, Suche
(Configuration)
(Image and packages)
Zeile 43: Zeile 43:
 
== Configuration ==
 
== Configuration ==
  
=== Image and packages ===  
+
=== Image and Packages ===  
 
The Raspberry installation is based on a Minibian 2016-03-12 image: https://minibianpi.wordpress.com/
 
The Raspberry installation is based on a Minibian 2016-03-12 image: https://minibianpi.wordpress.com/
  
Zeile 51: Zeile 51:
  
 
If you choose to attach a serial console to your Raspberry, you must make sure that the '''agetty''' stops attaching to your /dev/ttyAMA0 device. You can do that with the following commands:
 
If you choose to attach a serial console to your Raspberry, you must make sure that the '''agetty''' stops attaching to your /dev/ttyAMA0 device. You can do that with the following commands:
 +
 +
systemctl stop serial-getty@ttyAMA0.service
 +
systemctl disable serial-getty@ttyAMA0.service
 +
systemctl mask serial-getty@ttyAMA0.service
 +
 +
Then reboot and check if it has succeeded using '''lsof'''. I think it does not come with the Minibian distro, so it is one of the tools you need to install:
 +
 +
lsof | grep ttyAMA0
 +
 +
=== Hardware Connectivity and Kernel ===
 +
 +
I configured the kernel like this:
 +
 +
cat /boot/config.txt
 +
gpu_mem=16
 +
dtparam=i2c1=on
 +
dtparam=i2c_arm=on
 +
dtoverlay=pps-gpio,gpiopin=18
 +
init_uart_baud=9600
 +
enable_uart=0
 +
 +
Accordingly the kernel modules configuration file '''/etc/modules''' looks like this:
 +
 +
snd-bcm2835
 +
i2c-bcm2708
 +
i2c-dev
 +
 +
Since we have a FTDI to connect the GPS and another FTDI that is used in the GUDE DFC-77 clock, we need to keep them apart and ensure that they will always and forever in the future use the correct device name:
 +
 +
Check who is who:
 +
 +
root@multirx:/etc/udev/rules.d# lsusb | grep 403
 +
Bus 001 Device 006: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
 +
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
 +
Bus 001 Device 004: ID 0403:e88a Future Technology Devices International, Ltd Expert mouseCLOCK USB II
 +
 +
Then create this file:
 +
vi /etc/udev/rules.d/70-persistent-dev.rules
 +
KERNEL=="ttyUSB*", ATTRS{idProduct}=="e88a", SYMLINK+="refclock-0"
 +
KERNEL=="ttyUSB*", ATTRS{idProduct}=="6001", SYMLINK+="gps0"
 +
 +
These statements will give me the following devices:
 +
 +
/dev/refclock-0
 +
/dev/gps0
 +
 +
The names are important because they need to correspond to the expectations of the accoring NTP modules.
 +
 +
=== Packages ===
 +
 +
I found that it makes sense to install the following tools:
 +
 +
apt-get update
 +
apt-get install i2c-tools      # I2C-Toolkit for commandline
 +
apt-get install python-smbus  # Python library for I2C
 +
apt-get install libi2c-dev    # library for C
 +
apt-get install git            # need this later...
 +
apt-get install lsof          # determine who is using the serial port
 +
apt-get install apache2        # for all the later web stuff
 +
apt-get install lsusb          # see who is connected via USB
 +
 +
 +
=== Fundamental system config ===
 +
 +
* Configure the timezone using the command '''dpkg-reconfigure tzdata'''
 +
 +
=== NTP ===
 +
 +
==== Check that PPS works ====
 +
 +
The '''/dev/pps0''' should be created upon boot if the Kernel-PPS module is loaded.
 +
 +
root@multirx:~# 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 1462395271.608254834, sequence: 4022 - clear  0.000000000, sequence: 0
 +
source 0 - assert 1462395272.608254999, sequence: 4023 - clear  0.000000000, sequence: 0
 +
source 0 - assert 1462395273.608254163, sequence: 4024 - clear  0.000000000, sequence: 0
 +
source 0 - assert 1462395274.608255327, sequence: 4025 - clear  0.000000000, sequence: 0
 +
source 0 - assert 1462395275.608373487, sequence: 4026 - clear  0.000000000, sequence: 0
 +
^C
 +
root@multirx:~#
 +
 +
 +
==== Ensure that you have a NTPd what can handle PPS and DFC-77 ====
 +
 +
Since I decided against using /dev/ttyAMA0 for the NMEA interface for NTP, I was rather free in terms of the serial device. Yet, I connected the PPS pin to GPIO 18.
 +
 +
The package, once again has to be modified and rebuilt:
  
 
== Results ==
 
== Results ==

Version vom 10. Dezember 2016, 20:18 Uhr

1 Scope

This project is a continuation of my stream of experiments with the NTP protocol and GPS-disciplined clock models. I need to reference the past projects before we go into details:

These past projects raised the question, how precise a DCF-77 clock would be. And this project here also needs to be seen in the context of an April 1st joke of Rainer DF2NU, who proposed that DCF-77 can be switched off now because the GPS system is there and it is much more precise. So I started to collect ideas to investigate how less precise a DCF-77 disciplined clock model would be compared to the GPS Pulse Per Second. The reason for the reduced precision is because the 77,5 kHz signals are reflected randomly in the ionosphere and the exact reflection point cannot be predicted, resulting in a varying signal runtime.

In addition to the clock question I was thinking of setting up a pair of receivers for the AIS frames broadcasted around Regensburg by the shipd on the danube and I wanted to receove ADS-B frames. Even though slowly navigating ships allow for some frame processing delay, and in case the delay is a couple of seconds, one would still consider such an application a real time application. A jet plane however travels quite distance in a couple of seconds, so a positioning application would need to add some timestamping logic in order to allow for a realistic position information, particularly if received by multiple receivers.

For this reason it makes perfect sense to add a precise clock to a position frame receiver setup.

2 List of components

~ 560 Euro

The prices are partly a bit over the market, roundet up, so that there are no surprises.

3 Configuration

3.1 Image and Packages

The Raspberry installation is based on a Minibian 2016-03-12 image: https://minibianpi.wordpress.com/

I found that sometimes it is hard to install it into a running state with improper readers / adapters. But if you have a good adapter, it should work properly with any SD card.

The minibian standard image does not have a "pi" user like Raspian, but the login succeeds with "root" and "raspberry". Of yourse, this information is just for those who want to replicate my project. Be sure that I have chosen another password, and please do the same :-)

If you choose to attach a serial console to your Raspberry, you must make sure that the agetty stops attaching to your /dev/ttyAMA0 device. You can do that with the following commands:

systemctl stop serial-getty@ttyAMA0.service
systemctl disable serial-getty@ttyAMA0.service
systemctl mask serial-getty@ttyAMA0.service

Then reboot and check if it has succeeded using lsof. I think it does not come with the Minibian distro, so it is one of the tools you need to install:

lsof | grep ttyAMA0

3.2 Hardware Connectivity and Kernel

I configured the kernel like this:

cat /boot/config.txt
gpu_mem=16
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pps-gpio,gpiopin=18
init_uart_baud=9600
enable_uart=0

Accordingly the kernel modules configuration file /etc/modules looks like this:

snd-bcm2835
i2c-bcm2708
i2c-dev

Since we have a FTDI to connect the GPS and another FTDI that is used in the GUDE DFC-77 clock, we need to keep them apart and ensure that they will always and forever in the future use the correct device name:

Check who is who:

root@multirx:/etc/udev/rules.d# lsusb | grep 403
Bus 001 Device 006: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 004: ID 0403:e88a Future Technology Devices International, Ltd Expert mouseCLOCK USB II

Then create this file:

vi /etc/udev/rules.d/70-persistent-dev.rules
KERNEL=="ttyUSB*", ATTRS{idProduct}=="e88a", SYMLINK+="refclock-0"
KERNEL=="ttyUSB*", ATTRS{idProduct}=="6001", SYMLINK+="gps0"

These statements will give me the following devices:

/dev/refclock-0
/dev/gps0

The names are important because they need to correspond to the expectations of the accoring NTP modules.

3.3 Packages

I found that it makes sense to install the following tools:

apt-get update
apt-get install i2c-tools      # I2C-Toolkit for commandline
apt-get install python-smbus   # Python library for I2C
apt-get install libi2c-dev     # library for C
apt-get install git            # need this later...
apt-get install lsof           # determine who is using the serial port
apt-get install apache2        # for all the later web stuff
apt-get install lsusb          # see who is connected via USB


3.4 Fundamental system config

  • Configure the timezone using the command dpkg-reconfigure tzdata

3.5 NTP

3.5.1 Check that PPS works

The /dev/pps0 should be created upon boot if the Kernel-PPS module is loaded.

root@multirx:~# 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 1462395271.608254834, sequence: 4022 - clear  0.000000000, sequence: 0
source 0 - assert 1462395272.608254999, sequence: 4023 - clear  0.000000000, sequence: 0
source 0 - assert 1462395273.608254163, sequence: 4024 - clear  0.000000000, sequence: 0
source 0 - assert 1462395274.608255327, sequence: 4025 - clear  0.000000000, sequence: 0
source 0 - assert 1462395275.608373487, sequence: 4026 - clear  0.000000000, sequence: 0
^C
root@multirx:~# 


3.5.2 Ensure that you have a NTPd what can handle PPS and DFC-77

Since I decided against using /dev/ttyAMA0 for the NMEA interface for NTP, I was rather free in terms of the serial device. Yet, I connected the PPS pin to GPIO 18.

The package, once again has to be modified and rebuilt:

4 Results

5 Integration

6 Images

2016-12-10-MultiRX-1.jpg 2016-12-10-MultiRX-6.jpg

2016-12-10-MultiRX-3.jpg 2016-12-10-MultiRX-2.jpg

2016-12-10-MultiRX-4.jpg 2016-12-10-MultiRX-5.jpg

2016-12-10-MultiRX-7.jpg 400px