[TangerineSDR] [HamSCI] Magnetometer/Grape Raspberry Pi Image

Jonathan emuman100 at gmail.com
Mon Nov 1 00:41:53 EDT 2021


Hi Jules,

This bug will only affect the GPS date reported by certain versions of gpsd, or GPS Daemon, and does not affect GPS receivers. gpsd is open source and allows you to interface a GNSS receiver to a PC or embedded computer for use with timing and navigation applications on Linux, BSD, and other unices. The bug affects gpsd versions starting around version 3.20 to 3.23.

For many HamSCI applications, one would use gpsd for timing, specifically to discipline ntpd. The most convenient way is to have gpsd write to the shared memory driver that ntpd utilizes for its stratum 0 time sources. It parses the time of day in the binary packets or NMEA sentences from the GPS receiver and writes them to the shared memory driver. ntpd then uses this as a stratum 0 time source. The bug I mentioned will affect this configuration method because it sends the incorrect date to ntpd. As a result, ntpd sees a huge offset (20 years) and knocks it off its usable peer list and falls back to another timing peer, like another ntp server. 

gpsd also can parse PPS directly from a PPS source like a serial port a GPS receiver is connected to with the PPS line attached to a control line of the serial port, or the PPS line connected directly to a GPIO pin on the Raspberry Pi. In this case, it detects PPS assert and clear signals and passes them off to a shared memory resource that ntpd sees and uses as a stratum 0 time source. In my ntp configuration, I have gpsd provide both the GPS shared memory resource and PPS shared memory recourses to ntpd. The PPS shared memory resource has the smallest offset compared to the GPS data shared memory resource, so ntpd uses the PPS peer. If it ever were to stop working, it will fall back to GPS peer and still maintain a stratum 0 source, just with a greater offset. In my case, the GPS peer was 20 years off due to the bug in gpsd, but the PPS peer was still providing accurate time as a stratum 0 source. I could have left it this way, but my backup stratum 0 source would not be usable any more. 

It is possible for you to use the PPS ntp driver, instead of the shared memory driver, that will utilize a PPS source directly, such as /dev/ttyu2 (in the case of a hardware serial port in FreeBSD) and /dev/pps0 (in the case of the pps_gpio driver on the Raspberry Pi), but if you do that, there is no way to monitor or control your GPS receiver due to the resource already being utilized by the PPS driver, so gpsd provides a better way to not only provide two timing sources to ntpd, but gives you a way to monitor your GPS receiver for heath and signal status and even parse your location to recorded data if that might be necessary. 

Bill,

It is advisable to use the GPS hat in a configuration I mentioned above if you are not already, with both GPS and PPS peers configured via gpsd shared memory resource. This is the optimum way to do it with a GPS receiver and ntpd.

Jonathan
KC3EEY

> On Oct 31, 2021, at 10:20 PM, Julius Madey <hillfox at fairpoint.net> wrote:
> 
> Jonathan,
> With the LEA-MF8 connected to my Windows PC USB port and U-Center V21.05, I see no anomaly in the date and time.
> Jules
> 
>> On 10/31/2021 9:00 PM, Jonathan wrote:
>> Bill,
>> 
>> If I remember correctly, you used a GPS hat for the Raspberry Pi on
>> the Magnetometer/Grape system. Is this true? If so, which one do you
>> use?
>> 
>> The reason I ask is that there was a bug in gpsd that caused the GPS
>> date to be erroneously reported as March of 2002 once October 23th
>> 2021 has passed. This has been fixed and you are encouraged to update
>> to gpsd version 3.23.1. To do so, do a git pull of the gpsd
>> repository, then type "git checkout release-3.23.1", then "scons -c &&
>> scons && scons install".
>> 
>> Details about the bug can be found at:
>> https://gitlab.com/gpsd/gpsd/-/issues/144 or LWN, El Reg, or CERT
>> write ups.
>> 
>> As of this email, version 3.32.2 is the most current, but there is a
>> bug that prevents using the GPIO PPS with another serial device than
>> /dev/ttyAMA0. Most GPS hats use /dev/ttyAMA0, so you can do a git
>> checkout and build/install of gpsd, but since I use /dev/ttyAMA0 for a
>> serial console (I still believe in out-of-band access), I utilize
>> /dev/ttyUSB0 from a FT230 USB serial interface IC that my GPS serial
>> port connects to, which then connects to the Pi USB port. In this
>> configuration, version 3.23.2 of gpsd cannot use the /dev/ttyUSB0
>> /dev/pps0 runtime option and capture PPS asserts/clears from the
>> pps_gpio driver. But, most GPS hats and users don't use this
>> configuration very often, so you won't be affected. A fix for this
>> issue will be pushed to the gpsd repository soon.
>> 
>> I owe a huge thanks to the primary maintainer of gpsd for working with
>> me to get both issues resolved, as well as support for the Trimble RES
>> SMT 360 timing receiver and Solaris 10 support.
>> 
>> Jonathan
>> KC3EEY
>> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/tangerinesdr_lists.tapr.org/attachments/20211101/0018292c/attachment.html>


More information about the TangerineSDR mailing list