https://github.com/mhx/gpsdo-config
Find GPS reference clock configuration from set of frequencies
https://github.com/mhx/gpsdo-config
command-line cpp gps gpsdo lb-gps-linux linux reference-clock
Last synced: 7 days ago
JSON representation
Find GPS reference clock configuration from set of frequencies
- Host: GitHub
- URL: https://github.com/mhx/gpsdo-config
- Owner: mhx
- License: gpl-3.0
- Created: 2020-02-06T11:37:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:20:53.000Z (over 3 years ago)
- Last Synced: 2026-01-28T10:47:36.927Z (3 months ago)
- Topics: command-line, cpp, gps, gpsdo, lb-gps-linux, linux, reference-clock
- Language: C++
- Homepage:
- Size: 79.1 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/mhx/gpsdo-config)
# gpsdo-config
Find GPS reference clock configuration from set of frequencies
## Overview
This tool is intended to fill a gap in configuring the Precision GPS Reference
Clock from [Leo Bodnar Electronics](http://www.leobodnar.com/) on Linux. There
is already the [lb-gps-linux project](https://github.com/simontheu/lb-gps-linux)
that allows you to set the "raw" parameters of the hardware, but in order to
determine those parameters, you have to rely on the Windows GUI application.
The `gpsdo-config` tool provided here allows you to find these parameters by
specifying the desired output frequencies. The parameters can optionally be
printed as command-line arguments for the `lb-gps-linux` tool, so setting new
output frequencies can be done with a simple one-liner:
```
lb-gps-linux /dev/hidraw3 $(gpsdo-config 10M 120M --cmdline)
```
## Building and Installing
```
cmake .
make -j
sudo make install
```
## Usage
```
Usage: ./gpsdo-config f1 [f2] [options...]
Options:
--f1 arg frequency 1
--f2 arg frequency 2
--all find all possible solutions
--any find any possible solution
--best find best possible solution
-v [ --verbose ] print more information
--relaxed use relaxed VCO limits
--cmdline print command line config
--json print solutions as json objects
-h [ --help ] produce help message
If only one frequency is specified, both outputs will be set to the
same frequency. Frequencies will be processed accurately as rational
numbers internally, and can also be specified as such. An integral
part can be separated from a fraction by either a single space or an
underscore. Suffixes `M` and `k` are supported for MHz and kHz.
`--all` and `--best` can be really slow as there may be millions
of possible solutions. By default, the code will look for a "good"
solution, which shouldn't be significantly slower than `--any`.
The "quality" of a solution is measured purely by means of the
phase detector comparison frequency (f3), which directly impacts
jitter/phase noise. `--best` will always search for the solution
with the highest possible f3. The default behaviour will accept
any f3 that is higher than 50% of the maximum value.
Output for `--json` and `--cmdline` will always be exclusively
written to stdout, suitable for processing by other commands.
All other output will be written to stderr.
Examples:
./gpsdo-config 1000
./gpsdo-config 10M 96k
./gpsdo-config 1000.31 2345.61 --best
./gpsdo-config 10_1/7k 500/9k --all --verbose
lb-gps-linux /dev/hidraw3 $(./gpsdo-config 10M 120M --cmdline)
Exit status:
0: successful completion
1: could not find any solution for the specified frequencies
2: input processing error
```