OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: va176thunderbolt on October 30, 2018, 05:41:05 am

Title: 18.7.6 issues with NTP & GPS
Post by: va176thunderbolt on October 30, 2018, 05:41:05 am
I have a GPS attached serially and configured in NTP as a time source. Works great - sync's right up. However, when I go into Services/Network Time/Status, I get a php error:

[30-Oct-2018 09:38:37 Etc/GMT-5] PHP Warning:  A non-numeric value encountered in /usr/local/www/status_ntpd.php on line 100
[30-Oct-2018 09:38:37 Etc/GMT-5] PHP Warning:  A non-numeric value encountered in /usr/local/www/status_ntpd.php on line 102
[30-Oct-2018 09:38:37 Etc/GMT-5] PHP Warning:  A non-numeric value encountered in /usr/local/www/status_ntpd.php on line 103
[30-Oct-2018 09:38:37 Etc/GMT-5] PHP Warning:  A non-numeric value encountered in /usr/local/www/status_ntpd.php on line 105

The Dashboard Network Time widget  also chokes.

I've submitted a couple of error reports, and I'd be happy to allow someone access if they needed to test/troubleshoot on my box.

Adam
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on October 30, 2018, 12:25:50 pm
Hi Adam,

Would you mind providing the output of:

# /usr/local/sbin/ntpq -c clockvar


Thanks,
Franco
Title: Re: 18.7.6 issues with NTP & GPS
Post by: va176thunderbolt on October 30, 2018, 12:30:10 pm
adam@gw:~ % sudo /usr/local/sbin/ntpq -c clockvar
Password:
associd=0 status=00f2 15 events, clk_bad_format,
device="NMEA GPS Clock",
timecode="$GPRMC,112850,A,____.____,_,_____.____,_,000.0,190.7,301018,007.0,W*__",
poll=21419, noreply=8, badformat=261, baddata=0, fudgetime2=600.000,
stratum=0, refid=GPS, flags=13
adam@gw:~ %
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on October 30, 2018, 12:33:14 pm
Super, thanks! Will fix for 18.7.7.

https://github.com/opnsense/core/issues/2861


Cheers,
Franco
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on October 30, 2018, 12:47:46 pm
Is ____.____ the actual output or did you blank it? I'm asking because it can't parse latitude and longitude and I'm unsure how to parse correctly what is actually returned. I don't need the exact values, just the info whether each "_" is literally a number or not.


Cheers,
Franco
Title: Re: 18.7.6 issues with NTP & GPS
Post by: va176thunderbolt on October 30, 2018, 12:51:26 pm
That is the actual output.
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on October 30, 2018, 01:18:22 pm
Ok, so there may also be an issue with the GPS tracker itself.

In any case, will fix the malformed parsing. Thanks!
Title: Re: 18.7.6 issues with NTP & GPS
Post by: va176thunderbolt on October 30, 2018, 01:26:06 pm
Thanks Franco!
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on November 11, 2018, 10:51:33 am
Hi Adam,

Here is the patch with additional corrections for other GPS devices and GUI sanity:

https://github.com/opnsense/core/commit/0b58f2f48

Can you confirm it works for you?  Under the circumstances of the output it will show N/A for latitude and longitude since the GPS doesn't return any values.

# opnsense-patch 0b58f2f48


Cheers,
Franco
Title: Re: 18.7.6 issues with NTP & GPS
Post by: kapara on April 26, 2019, 04:07:49 am
Curious if this was resolved and also what GPS device you used via serial.
Title: Re: 18.7.6 issues with NTP & GPS
Post by: franco on April 26, 2019, 05:24:36 am
While the patch should speak for itself on the resolved front I don't know what the device was. Maybe Adam can shed some light on it.


Cheers,
Franco