PfSense ntpd refclock support



  • Does the ntpd in pfSense 2.0.2 have refclock 30 the motorola oncore driver compiled in?  I'm trying to attach a motorola oncore ut+ device on /dev/cuau0 pps is on DCD.  I have had this clock I built working for years on another FreeBSD system so am familiar with how to configure FreeBSD and ntpd for this gps clock.

    I see there are 2 different ntpd in pfsense 2.0.2, one in the usual location /usr/sbin and the other in /usr/local/bin. Neither one appears to work with my refclock. Motherboard is D2500CC.


  • Netgate Administrator

    You would have a much better chance of getting this working under 2.1beta. That has switched ntpd code and now supports serial GPS units with PPS. See: http://forum.pfsense.org/index.php/topic,57686.0.html

    Steve

    Edit: Looks like both 2.1 and 2.0.2 are using the ntp.org daemon. Only 2.1 is setup to see gps units though.



  • Thanks for the reply.  it seems to almost work though with /usr/local/bin/ntpd.  clockstats shows the Oncore driver is there but ntpd is getting no response from the gps when sending  @@Cj command to get the gps configuration:

    56379 68553.138 127.127.30.0 ONCORE[0]: ONCORE DRIVER – CONFIGURING
    56379 68553.147 127.127.30.0 ONCORE[0]: state = ONCORE_NO_IDEA
    56379 68553.149 127.127.30.0 ONCORE[0]: Input mode = 1
    56379 68553.149 127.127.30.0 ONCORE[0]: Initializing timing to Assert.
    56379 68553.149 127.127.30.0 ONCORE[0]: ONCORE: Can't open SHMEM file
    56379 68553.149 127.127.30.0 ONCORE[0]: ONCORE: Can't open shmem
    56379 68553.149 127.127.30.0 ONCORE[0]: state = ONCORE_CHECK_ID
    56379 68554.129 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56379 68570.129 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56379 68586.129 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56379 68602.129 127.127.30.0 ONCORE[0]: Oncore: No response from @@Cj, shutting down driver

    D2500CC has 4 serial ports 2 on internal headers and 2 on the back panel.  Found an option in the BIOS to switch ports 1 and 2 from the internal headers to the back panel which is what I want however the ports still don't work.  The gps is fine, I just move the serial cable to my other freebsd system and it's all good.

    I'm not sure if this is a motherboard problem or a problem in this pfsense 2.0.2 version I'm running.


  • Rebel Alliance Developer Netgate

    2.0.2 doesn't have our code in there to support the GPS.

    2.1 does, and also has a selector to pick the serial port used for the GPS which sets up the right links and such.



  • Got it. I need 2.1 Do I just grab a daily snapshot and install that?  How do I determine which pfsense to grab, nano or full? I bought this system already built with pfsense 2.0.2 preinstalled on a 2G SATA DOM.


  • Netgate Administrator

    If you look on the dashboard the current version is listed. On a DOM you should probably be using Nano though.
    You can upgrade to 2.1 by selecting a different report in updater settings. That will keep whichever install type you have currently.

    Steve



  • @stephenw10:

    On a DOM you should probably be using Nano though.

    I have been running pfSense full install on a 1GB DOM for over 4 years without any disk problems. BUT that might not be such a good idea if your system does a lot of disk I/O such as swapping or very active web caching.



  • I can upgrade by selecting a different report in updater settings.  Do you mean by selecting a different url in updater settings??  What url should I use for the 2.1 image please??



  • Nevermind, I figured out the correct url to use.  I just now upgraded to 2.1-BETA and can test out my gps refclock.  It uses Motorola binary format so may have to configure it outside of the menus in the shell. The upgrade was a piece of cake.


  • Netgate Administrator

    Yes, sorry, I wrote 'repo' (repository) and it got autocorrected.  ::)

    Steve



  • Thanks everyone for your help.  Although 2.1-BETA did fix a couple issues I was having, it did not fix the issue with the serial ports.  The pfsense menus seem to require you have a NMEA GPS (refclock 20) so if you want to use a different refclock you'll have to hack on /etc/inc/system.inc to generate the right stanzas in /var/etc/ntpd.conf.  I stopped the ntpd service in the menus then jumped to the shell and ran ntpd by hand /usr/local/etc/ntpd -D3 -c /etc/ntpd.conf still no joy with the serial port.  I have symlinked cuau0 to both /dev/oncore.serial.0 and /dev/oncore.pps.0 and also have my /etc/ntp.oncore.0 config in place which enables TRAIM and mode 1 (zero position mode).  No Joy. /var/log/ntp/clockstats shows driver timeout on @@Cj (get config) command sent to the device same as before.

    56382 82497.628 127.127.30.0 ONCORE[0]: ONCORE DRIVER – CONFIGURING
    56382 82497.639 127.127.30.0 ONCORE[0]: state = ONCORE_NO_IDEA
    56382 82497.641 127.127.30.0 ONCORE[0]: Input mode = 1
    56382 82497.643 127.127.30.0 ONCORE[0]: Initializing timing to Assert.
    56382 82497.645 127.127.30.0 ONCORE[0]: ONCORE: Can't open SHMEM file
    56382 82497.647 127.127.30.0 ONCORE[0]: ONCORE: Can't open shmem
    56382 82497.649 127.127.30.0 ONCORE[0]: state = ONCORE_CHECK_ID
    56382 82498.514 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56382 82514.514 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56382 82530.514 127.127.30.0 ONCORE[0]: Oncore: Resend @@Cj
    56382 82546.514 127.127.30.0 ONCORE[0]: Oncore: No response from @@Cj, shutting down driver

    It looks like this is an issue with the motherboard/BIOS settings or somesuch at any rate I'm happy with 2.1-BETA and an busy building a new refclock based on a Raspberry Pi with the Adafruit 66 channel gps which will replace my old Motorola as my primary NTP server.  I've got the Raspberry Pi ready to go with linux kernel pps and latest ntpd build just waiting on the Adafruit gps board.


Locked