= ppscheck(8)
:author: Eric S. Raymond
:date: 26 February 2021
:email: <esr@thyrsus.com.>
:keywords: gps, PPS, ppscheck
:manmanual: GPSD Documentation
:mansource: GPSD, Version {gpsdver}
:robots: index,follow
:sectlinks:
:toc: macro
:type: manpage
:webfonts!:

include::../www/inc-menu.adoc[]

== NAME

ppscheck - tool to check a serial port for PPS

== SYNOPSIS

*ppscheck* [-?]  [--help] [--version] [-h] [-V] device

== DESCRIPTION

*ppscheck* watches a specified serial port for transitions that might be
PPS. It looks for changes in handshake lines CD, RI, and CTS by running
ioctl(...., TIOCMIWAIT, ...) in a loop. When it sees a state change it
emits a timestamped line of output dumping the state of the handshake
signals. It's useful for checking whether a device is emitting PPS.

*ppscheck* can run as a normal user, but that user must have permissions
to read the target device.  Running as root will always work.

To check the first serial port do this:

----
ppscheck /dev/ttyS0
----

*ppscheck* is not intended for routine use, but rather for diagnostic
purposes. Once you have verified a particular device can output PPS
signals you will never need to use it again on that device.

== OPTIONS

The program accepts the following options:

`+-?+, `+-h+, `+--help+`::
  Display help message and terminate.
`+-V+, `+--version+`::
  Dump version and exit.

== ARGUMENTS

The _device_ argument should be the pathname of a device. Such as
/dev/ttyS0 or /dev/pps0. It will be the device monitored.

Each output line is the second and nanosecond parts of a timestamp
followed by the names of the handshake signals then asserted. Off
transitions may generate lines with no signals asserted.

If you don't see output within a second, use *cgps* or some other
equivalent tool to check that your device has a satellite lock and is
getting 3D fixes before giving up on the possibility of PPS.

Check your cable. Cheap DB9 to DB9 cables such as those issued with
UPSes often carry TXD/RXD/GND only, omitting handshake lines such as
DCD. Suspect this especially if the cable jacket looks too skinny to
hold more than three leads!

Most GPS that have built in USB do not support PPS. When in doubt,
contact the vendor for confirmation that your device does supply PPS.

== RETURN VALUES

0:: OK
1:: if the device counld not be opened

== SEE ALSO

*gpsd*(8)

== RESOURCES

*Project web site:* {gpsdweb}

== COPYING

This file is Copyright 2013 by the GPSD project +
SPDX-License-Identifier: BSD-2-clause
