Wiren Board 6: WBE2R-R-GPS GPS/GLONASS Extension Module:NTPD PPS Setup

Материал из Wiren Board
Это утверждённая версия страницы. Она же — наиболее свежая версия.
Другие языки:


THE ARTICLE IS IN PROGRESS!


The WBE2R-R-GPS module allows you to autonomously synchronize the exact time of the controller by GLONASS/GPS signals and use the controller as a source of accurate NTP time on the network. The module supports PPS signal output to the controller's GPIO processor. Kernel modules are supported by module pps_gpio.


It is further assumed that the module is installed into the controller that is configured and functioning correctly checked (see section Wiren_Board 6:_WBE2R-R-GPS_GPS/GLONASS_Extension_Module/en

NMEA and PPS

The controller module is represented by two devices - serial port /dev/ttyMOD3 and signal transmission device pps /dev/pps2 Port /dev/ttyMOD3 transmits data from the module via standard Protocol NMEA, including position, receiver speed, and time and date messages. Usually the information is updated once per second. The module is made on the chip SIM68, debugging UART-port is not available in the current hardware modification.

The pps pulse is precisely synchronized with the beginning of each second, which makes it possible to increase the accuracy of the time determination on the controller with microsecond accuracy.

Check for pps signal

At the command prompt, run ppstest /dev/pps2.

Check for a pps signal

The command will sequentially display the UNIX-time timestamps with a decimal part (the timestamps can be read in the file /sys/class/pps/pps2/assert).

Check for data in NMEA format

To verify that the system can receive data from the GPS module in NMEA format, run the following command

cat /dev/ttyMOD3
Check for NMEA data

In the figure, the fragments of NMEA messages are highlighted in red, showing that the GPS module has reliably recorded its position and receives the correct data. Details see description NMEA messages.

NTPD

Ntpd service is used as application SOFTWARE. By default, the ntpd server is configured to receive time from other servers on the Internet using ntp. To use the time signals from the GPS/GLONASS module, a number of configuration steps are required (see below).

Current accurate time sources for NPTD

Ntpqp inint.png

The exact time sources are marked with special characters:

Symbol Value
* current source used
# source selected but too remote
o source selected, PPS signal used
+ source selected, ready to use
x source rejected
. source selected last from the list of candidates
- source rejected by selection algorithm
space source rejected


Note that the ntpd 28 driver (shared memory driver), see below, which allows the use of gpsd functions, is not marked with an "o", even if PPS is used. If it works correctly, it will be marked with "*".

GPSD

Daemon gpsd is a unified Protocol of interaction with the receivers of the satellite signals of GPS/GLONASS. In our case, we will use it as an intermediate layer between the module and the ntpd server (driver with code 28). The daemon is installed by the command

apt-get install gpsd

Settings

gpsd settings

Ntpd setting

In ntpd server settings we need to specify two new sources of exact time: NMEA and PPS.