What's new

Set the router clock with a GPS receiver for under $70

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

This project is not for the faint of heart. However, I will try this.

Here's the pieces you need and how to build it:
http://atoomnet.net/time-server-using-1pps-gps-receiver/

You must have a working Linux build environment for compiling the Asuswrt-Merlin firmware because you need to rebuild the Linux kernel with these changes. Will it work?

~/asuswrt-merlin/release/src-rt-6.x.4708/linux/linux-2.6.36/config_base.6a
Code:
# turn on these features
CONFIG_PPS=m
CONFIG_PPS_DEBUG=n
CONFIG_PPS_CLIENT_KTIMER=m
CONFIG_PPS_CLIENT_LDISC=m
CONFIG_USB_SERIAL_CH341=m
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_PL2303=m

# turn off these features
CONFIG_USB_SERIAL_SIERRAWIRELESS=n
CONFIG_USB_SERIAL_WWAN=n
CONFIG_USB_SERIAL_OPTION=n
 
Last edited:
It might work, it might not. It depends on whether any of those options are going to change the internal structures used by the kernel in such a way that the precompiled, closed-source Broadcom stuff will no longer load.
 
It depends on whether any of those options are going to change the internal structures used by the kernel in such a way that the precompiled, closed-source Broadcom stuff will no longer load.
My RT-AC68U is running Asuswrt-Merlin rebuilt with that kernel configuration now. Also, plugged in a USB-to-Serial converter and it gave me a /dev/ttyUSB0. It's a FT232RL with a hole for the DCD pin. You need the DCD for the 1PPS signal (one pulse-per-second). AND, just ordered the GPS/GLONASS/QZSS antenna module piece, RY725AI.

dmesg

Code:
usb 3-2: new full speed USB device using ohci_hcd and address 2
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
usb 3-2: Detected FT232RL
usb 3-2: Number of endpoints 2
usb 3-2: Endpoint 1 MaxPacketSize 64
usb 3-2: Endpoint 2 MaxPacketSize 64
usb 3-2: Setting MaxPacketSize 64
usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
LinuxPPS API ver. 1 registered
Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PPS line discipline registered
 
Last edited:
If you only want to keep your router's clock damn accurate, I think there is a much cheaper and easier alternative.

But this is great fun if you're into such stuff. Waiting to see an analysis of clock accuracy before and after. I think that'll be fun too..
 
I think there is a much cheaper and easier alternative.
Just waiting for the pieces to arrive from Hong Kong!! Then we will see. I thought I'd need to buy a Garmin 18x LVC for $65, but there's no way to know for sure if it has the 1-PPS output signal. It's way cheaper to buy the pieces and build it yourself.

RY725AI - $18 ebay
FT232RL - $2.50 ebay
Plastic case - $1 ebay
Hot glue + glue gun
Heat shrink tubing + heat gun
Solder + flux paste + soldering iron
CAT6 cable + RJ45 connectors + RJ45 coupler
 
Last edited:
ASAT can you explain the point of this? Routers usually sync time every 12hrs with NTP, which are servers using ATOMIC CLOCKS. You do understand GPS time is syncronized using EXACTLY THE SAME atomic clocks right?
 
Wow what a geeky project. I may just try it for fun. I have a spare N16 sitting around here.
 
Can you explain the point of this?
Where I live the Internet/network time source is unreliable. If this project is successful, my router clock can be set to within 50 nanoseconds of the stratum 0 time sources (aka the GPS satellite atomic clocks). Just want to be as close as possible to the correct time. I love this computer stuff!!

GPS is United States. This link is about GPS satellites.
http://www.gps.gov/applications/timing/

Russia has network of satellites for the same purpose called GLONASS. The RY725AI antenna module can receive both GPS and GLONASS frequencies.
 
Last edited:
We use a GPS where I work for our Active Directory time source. It's all enterprise level hardware, but nevertheless the same idea. In our case the main purpose is to make sure any all timestamps throughout jive with each other for legal reasons. I guess it's also just one less bit of traffic that could potentially be exploited.

Sent from my LG-D850 using Tapatalk
 
Managed to get ntpd compiled and running on the RT-AC68U. It is necessary for NEMA/PPS serial input from the GPS antenna module. Also had to disable the router's NTP client by setting it's NVRAM variables to empty because it was conflicted with my ntpd.

Hopefully the pieces will arrive soon from Hong Kong, then I can make the cable for USB/Serial to GPS module. At the very least I have an excellent NTP service for my home network.

Here's the scripts and config that make it go.

/jffs/scripts/wan-start
Code:
#!/bin/sh
/usr/bin/logger -t $(/usr/bin/basename $0) "custom script started [$$]"
finish()  {
  /usr/bin/logger -t $(/usr/bin/basename $0) "custom script ended [$$]"
}
trap finish EXIT

DEV_RTC=/dev/ttyUSB1
DEV_GPS=/dev/ttyUSB0
 
set_ntp_ready()
{
  #/bin/sleep 1
  #/usr/bin/killall ntp
  #/bin/sleep 1
  /usr/sbin/nvram set ntp_ready=$1
  /usr/sbin/nvram unset ntp_server0
  /usr/sbin/nvram unset ntp_server1
  /usr/sbin/nvram unset ntp_server_tried
  #/usr/sbin/nvram commit
}
 
 
# set the system clock from an external RTC
#if [ ! -e ${DEV_RTC} ]; then
#  set_ntp_ready 0
#  /sbin/lsmod | /bin/grep -e "ch341" > /dev/null 2>&1 || /sbin/modprobe ch341
#  N=1
#  while [ $N -lt 30 ]; do
#    if [ -e ${DEV_RTC} ]; then
#      /bin/echo R>${DEV_RTC}
#      if [ $? -eq 0 ]; then
#        read -t 2 RTC<${DEV_RTC}
#        if [ $? -eq 0 ]; then
#          RTC=${RTC%$'\r'}
#          if [ $? -eq 0 ]; then
#            /usr/bin/logger -t $(/usr/bin/basename $0) "custom script setting system clock to $(/bin/date -u -d $RTC)"
#            /bin/date -u -s $RTC
#            if [ $? -eq 0 ]; then
#              set_ntp_ready 1
#            fi
#          fi
#        fi
#      fi
#      break
#    else
#      let N++
#      /bin/sleep 1
#    fi
#  done
# 
#  if [ $N -ge 30 ]; then
#    /bin/touch ${DEV_RTC} #reserved
#  fi
#else
#  /bin/echo R>${DEV_RTC} && read -t 2 RTC<${DEV_RTC} && RTC=${RTC%$'\r'} && /usr/bin/logger -t $(/usr/bin/basename $0) "custom script RTC time is $(/bin/date -u -d $RTC)"
#fi


# start ntpd, if it's not already running
/bin/pidof ntpd > /dev/null 2>&1
if [ $? -ne 0 ]; then

  # create some folders used by ntpd, otherwise it don't work
  /bin/mkdir -p /tmp/etc/ntp
  /bin/mkdir -p /tmp/var/spool/ntp
 
  # copy the NTPD drift file to tmp folder
  /bin/cp -p /jffs/ntp/ntp.drift /tmp/etc/ntp/.
 
  # set the system clock from NTPD, if not already set from external RTC
  if [ "$RTC" == "" ]; then
 
    set_ntp_ready 0

#    # cache some IP addresses for the NTP server
#    ntp_name="pool.ntp.org"
#    local_ntp_name="-$ntp_name"
#    hostip_cmd="/jffs/bin/hostip"
#    N=1
#    /bin/grep -q -F -e "$local_ntp_name" /jffs/configs/hosts.add > /dev/null 2>&1
#    if [ $? -ne 0 ]; then
#      for ip in $($hostip_cmd $ntp_name) $($hostip_cmd 0.$ntp_name) $($hostip_cmd 1.$ntp_name) $($hostip_cmd 2.$ntp_name) $($hostip_cmd 3.$ntp_name) $($hostip_cmd $ntp_name) $($hostip_cmd 0.$ntp_name) $($hostip_cmd 1.$ntp_name) $($hostip_cmd 2.$ntp_name) $($hostip_cmd 3.$ntp_name) $($hostip_cmd $ntp_name) $($hostip_cmd 0.$ntp_name) $($hostip_cmd 1.$ntp_name) $($hostip_cmd 2.$ntp_name) $($hostip_cmd 3.$ntp_name)
#      do
#        /bin/grep -q -F -e "$ip" /jffs/configs/hosts.add > /dev/null 2>&1
#        if [ $? -ne 0 ]; then
#          /bin/echo "$ip $N$local_ntp_name" >> /jffs/configs/hosts.add
#          let N++
#        fi
#      done
#    fi
#    # restart dnsmasq to re-load the IP addresses of the NTP servers
#    /sbin/service restart_dnsmasq
#    /bin/sleep 5
 
    # setup ntpd
    if [ ! -e ${DEV_GPS} ]; then
      set_ntp_ready 0
      /sbin/lsmod | /bin/grep -e "ftdi_sio" > /dev/null 2>&1 || /sbin/modprobe ftdi_sio
      /sbin/lsmod | /bin/grep -e "pps_core" > /dev/null 2>&1 ||/sbin/ modprobe pps_core
      /sbin/lsmod | /bin/grep -e "pps_ldisc" > /dev/null 2>&1 || /sbin/modprobe pps-ldisc
     
      N=1
      while [ $N -lt 30 ]; do
        if [ -e ${DEV_GPS} ]; then
          #stty -F ${DEV_GPS} raw ispeed 9600 ospeed 9600 cs8 -ignpar -cstopb eol 255 eof 255
          /jffs/bin/setserial ${DEV_GPS} low_latency
          LDATTACH_CMD="/jffs/bin/ldattach pps ${DEV_GPS}"
          LDATTACH_PID=$(/bin/echo $(/bin/ps w | /bin/grep -i "$LDATTACH_CMD" | /bin/grep -v grep) | /usr/bin/cut -f1 -d' ')
          [ -z "$LDATTACH_PID" ] && $LDATTACH_CMD
          [ -e /dev/gps0 ] || ln -s ${DEV_GPS} /dev/gps0
          [ -e /dev/gpspps0 ] || ln -s /dev/pps0 /dev/gpspps0

          # block here while the router's clock is sync'd with a time source
          /usr/bin/logger -t $(/usr/bin/basename $0) "custom script attempting system clock synchronization [$$]"
          /jffs/bin/ntpd -d -d -d -d -d -g -q -n -c /jffs/ntp/ntp.conf  # set clock and quit
          /usr/bin/logger -t $(/usr/bin/basename $0) "custom script completed system clock synchronization [$$]"
          set_ntp_ready 1

          break
        else
          let N++
          /bin/sleep 1
        fi
      done
 
      if [ $N -ge 30 ]; then
        /usr/bin/logger -t $(/usr/bin/basename $0) "custom script timed out while attempting NTPD synchronization [$$]"
      fi
    fi
   
  else
 
    /usr/bin/logger -t $(/usr/bin/basename $0) "custom script bypassing initial NTPD synchronization [$$]"
   
  fi
 
  # start ntpd as unstoppable daemon and carry on
  if [ $(/usr/sbin/nvram get ntp_ready) -eq 1 ]; then
    /jffs/bin/ntpd -c /jffs/ntp/ntp.conf
  fi
fi


# start dnscrypt-proxy
/bin/pidof dnscrypt-proxy > /dev/null 2>&1
if [ $? -ne 0 ]; then
  /jffs/bin/dnscrypt-proxy --local-address=127.0.0.1:65053 --ephemeral-keys --resolver-name=dnscrypt.me --resolvers-list=/jffs/bin/dnscrypt-resolvers.csv --daemonize
  /jffs/bin/dnscrypt-proxy --local-address=127.0.0.1:65054 --ephemeral-keys --resolver-name=cloudns-syd --resolvers-list=/jffs/bin/dnscrypt-resolvers.csv --daemonize
  /jffs/bin/dnscrypt-proxy --local-address=127.0.0.1:65055 --ephemeral-keys --resolver-name=dnscrypt.eu-dk --resolvers-list=/jffs/bin/dnscrypt-resolvers.csv --daemonize
  /jffs/bin/dnscrypt-proxy --local-address=127.0.0.1:65056 --ephemeral-keys --resolver-name=dnscrypt.org-fr --resolvers-list=/jffs/bin/dnscrypt-resolvers.csv --daemonize
  /jffs/bin/dnscrypt-proxy --local-address=127.0.0.1:65057 --ephemeral-keys --resolver-name=soltysiak --resolvers-list=/jffs/bin/dnscrypt-resolvers.csv --daemonize
fi

/jffs/scripts/nat-start
Code:
# redirect all NTP requests to my NTP server
iptables -t nat -I PREROUTING -s 192.168.1.0/24 -p udp --dport 123 -j DNAT --to-destination 192.168.1.1

/jffs/ntp/ntp.conf
Code:
driftfile /jffs/ntp/ntp.drift
#nonvolatile 1e-7  # 0.1 PPM

statsdir /var/spool/ntp
keysdir /jffs/ntp
pidfile /var/run/ntp.pid
logconfig=all
#logfile /var/spool/ntp/ntp.log

interface listen lo
interface listen br0

restrict localhost
restrict default nomodify notrap noquery
restrict default noquery

# Generic NMEA GPS Receiver
#  mode is 9600 baud + process only $GPZDA or $GPZDG
#  /dev/gps0 for NEMA
#  /dev/gpspps0 for PPS
#  http://doc.ntp.org/4.2.6/drivers/driver20.html
server 127.127.20.0 mode 24 minpoll 4 prefer
fudge 127.127.20.0 flag1 1 # Enable PPS signal processing
fudge 127.127.20.0 flag2 0 # Capture the pulse on the rising edge
fudge 127.127.20.0 flag3 1 # Use the kernel discipline
fudge 127.127.20.0 flag4 1 # Obscures location in timecode

# Atom PPS Clock Discipline
#  /dev/pps0 for PPS
#  http://doc.ntp.org/4.2.6/drivers/driver22.html
#server 127.127.22.0 mode 16 minpoll 4 maxpoll 4
#fudge 127.127.22.0 flag2 0 # Capture the pulse on the rising edge
#fudge 127.127.22.0 flag3 1 # Use the kernel discipline
#fudge 127.127.22.0 flag4 1 # Record a timestamp once for each second

# Internet NTP servers
#server 1-pool.ntp.org iburst
#server 2-pool.ntp.org iburst
#server 3-pool.ntp.org iburst
#server 4-pool.ntp.org iburst
#server 5-pool.ntp.org iburst
#server 6-pool.ntp.org iburst
#server 7-pool.ntp.org iburst
#server 8-pool.ntp.org iburst
 
Last edited:
Has anyone tried it? Looks like I'd turn on PPS (pulse per second) in the Asuswrt-Merlin firmware and make a USB-to-Serial cable to connect the GPS receiver to my router.

Sounds like a fun project - I use a multi-GNSS timesource into NTP to keep my trailer-park of servers across 3 sites lined up...

Once you have a stable time source, you can (and probably should) set up a local ntpd, and have all your machines sync to it, as all ntp sources vary a bit on base time... and you can get into a "back to the future" problem which can cause odd things to happen depending on what is using the timesource.

BTW - the Garmin GPS-18 is a nice little GPS receiver - don't recall if it is GPS only, or is GPS/GLONASS... there's a couple of settings where one can change what stanzas are sent over NMEA, and how often to report - it's all in the manual for the GV18 if I recall...
 
Managed to get ntpd compiled and running on the RT-AC68U. It is necessary for NEMA/PPS serial input from the GPS antenna module. Also had to disable the router's NTP client by setting it's NVRAM variables to empty because it was conflicted with my ntpd.

Hopefully the pieces will arrive soon from Hong Kong, then I can make the cable for USB/Serial to GPS module. At the very least I have an excellent NTP service for my home network.

I have a stratum 1 time server nearby. 2ms (round trip) away from my AC56U. This stratum 1 clock has a maximum error of ~1ms from its source which is an atomic clock. For all my intent and purpose, I run a ntpclient.sh script every two hours. This keeps AC56U happy. Maximum error at any time is about 300ms. Average error is below 100ms. Yes...the timekeeper in AC56U is not so good. Not sure it's a kernel issue or broadcom hardware to blame.

The end of that thread might imply I moved back to asuswrt's ntp. Just for a little while..I go back to my script. I can't tolerate a piece of junk sitting in the RAM and does little work every two hours. Even to do that I have to give it a little kick! Or else it's so lazy only does work twice everyday (if nothing goes wrong).

On the other day I saw a ntpd package on Entware repository. I was very tempted to try but haven't. I believe the memory footprint of ntpd is bigger than the dumb ntp. Nevertheless, ntpd is a proper implementation of the ntp protocol, and I'm quite confident it will do a much better job.

If you could give me a hint of the memory footprint, I might find a reason to try. What are the VIRT & RES columns (from htop) for ntp and ntpd on your AC68U...?
 
What are the VIRT & RES columns (from htop) for ntp and ntpd on your AC68U...?
Ntp
VIRT 6112
RES 1224
MEM 0.5%

Ntpd
VIRT 3108
RES 2928
MEM 1.1%

My router is RT-AC68U.
The drift value is 6.450 PPM, or 0.55728 seconds per day.

My Ntpd was compiled and statically linked against the version of OpenSSL included with the Asuswrt-Merlin 378.55 firmware. So I had to build the latest Asuswrt-Merlin firmware first, before compiling Ntpd. The reason is that I don't know enough about OpenSSL to configure and build it myself. Merlin has already figured that out, so I just statically link against his libraries.

Also, I used the ARM toolchain included with the Asuswrt-Merlin firmware to build Ntpd. I did not use Entware because it dynmically links the libraries to the USB drive. I prefer to copy my binaries to any location.

Entware will probably be good enough to test Ntpd. I don't remember if they installs ntp-keygen or if they properly compiled in the crypto. However, long term it's probably more reliable to compile it yourself and copy the binaries to /jffs/bin. Just in case your router gets rebooted and the USB drive does NOT mount properly. Then your mission critical Entware services would be unavailable to the entire network. So I like to have Ntpd and Dnscrypt put in /jffs/bin to mitigate that scenario.
 
Ntpd
VIRT 3108
RES 2928
MEM 1.1%

Based on the above numbers, I took the plunge and installed ntpd from Entware. I think you did a marvelous job in your ntpd build! Here is why...numbers from Entware :eek:

Ntpd
VIRT 14016
RES 12776

An additional ~12MiB RAM on a 256MiB system is way too expensive for all my intent & purpose. My AC56U idle time steady-state memory usage is about 48MiB (from htop) which I constantly scratch my head to add more interesting services. I can't decide if I'll keep the Entware build. Will let it run for a few days and see how good the drift will be..or will not be.

Coincidentally, I have a /jffs/bin too. One program is pixelserv which has VIRT 272 RES 104. It's my current yardstick of small, beautiful and functional - smaller than any processes from the firmware. I also have a /jffs/etc which store my conf files. I don't put in /jffs/configs 'cos not wanting to step on the firmware's toes or vice versa. LOL

Nothing fancy here is my script to guarantee Entware boots up every time. I have another setup that ensures every service I want it to run... to stay alive at its every effort. Maybe I can share on another occasion.
 
Must first build the Asuswrt-Merlin firmware. Then use the ARM toolchain, included with Asuswrt-Merlin, to build Libcap and Ntpd.

Don't forget to do this first step. Copy timepps.h from the pps-tools folder to /usr/include so NTPD compiles with PPS support. This is the PPS interface that NTPD will use. Otherwise, it's hard to tell if NTPD has PPS support.
Code:
cd
git clone git://www.linuxpps.org/git/pps-tools pps-tools
cp -p ~/pps-tools/timepps.h ~/asuswrt-merlin/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/arm-brcm-linux-uclibcgnueabi/sysroot/usr/include/.

How to build Ntpd:
Code:
./configure '--host=arm-brcm-linux-uclibcgnueabi' '--build=' --enable-local-libevent --enable-static --disable-shared --enable-accurate-adjtime --disable-all-clocks --disable-parse-clocks --without-ntpsnmpd --without-lineeditlibs --enable-NMEA --enable-LOCAL-CLOCK --enable-SHM --enable-ATOM --enable-linuxcaps --with-crypto --with-openssl-libdir=$HOME/asuswrt-merlin/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/arm-brcm-linux-uclibcgnueabi/sysroot/usr/lib --with-openssl-incdir=$HOME/asuswrt-merlin/release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/arm-brcm-linux-uclibcgnueabi/sysroot/usr/include --enable-autokey --enable-openssl-random --enable-thread-support --with-threads --with-yielding-select=yes --without-rpath --disable-silent-rules --prefix=$HOME/ntpd/usr/local AR="arm-brcm-linux-uclibcgnueabi-ar" CC="arm-brcm-linux-uclibcgnueabi-gcc" GCC="arm-brcm-linux-uclibcgnueabi-gcc" AS="arm-brcm-linux-uclibcgnueabi-gcc -c -static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99"  LD=arm-brcm-linux-uclibcgnueabi-ld NM="arm-brcm-linux-uclibcgnueabi-nm" CXX="arm-brcm-linux-uclibcgnueabi-g++" RANLIB="arm-brcm-linux-uclibcgnueabi-ranlib" STRIP=arm-brcm-linux-uclibcgnueabi-strip OBJCOPY=arm-brcm-linux-uclibcgnueabi-objcopy OBJDUMP=arm-brcm-linux-uclibcgnueabi-objdump SIZE=arm-brcm-linux-uclibcgnueabi-size CFLAGS="-DOPENSSL -static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99 -I$HOME/ntpd/libcap-2.24/libcap/include" CXXFLAGS="-DOPENSSL -static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99 -I$HOME/ntpd/libcap-2.24/libcap/include" CPPFLAGS="-DOPENSSL -static -ffunction-sections -fdata-sections -O3 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -Wall -fPIC -std=gnu99 -I$HOME/ntpd/libcap-2.24/libcap/include" LDFLAGS="-Wl,--gc-sections -L$HOME/ntpd/libcap-2.24/libcap" ac_cv_header_md5_h=no ac_cv_lib_rt_sched_setscheduler=no ac_cv_header_dns_sd_h=no hw_cv_func_snprintf_c99=yes hw_cv_func_vsnprintf_c99=yes ac_cv_make_ntptime=yes

make clean
make
arm-brcm-linux-uclibcgnueabi-strip ntpd/ntpd ntpdc/ntpdc ntpq/ntpq util/ntptime util/ntp-keygen ntpdate/ntpdate
mkdir -p ~/ntpd/bin
cp -p ntpd/ntpd ntpdc/ntpdc ntpq/ntpq util/ntptime util/ntp-keygen ntpdate/ntpdate ~/ntpd/bin/.
 
Last edited:
I,m very courious about connecting a GPS to the asus router, but my perspective would be to run GPSD on the router and thereby enable wireless GPSD from a GPS so that clients connected to the router and running Opencpn can get GPS position wireless from the router. So If you have a Ntpd from a GPS running, what will it take to enable GPSD ??
 
what will it take to enable GPSD ??
I think you've got a similar project, except there is no PPS clock pulse to handle, only NEMA with GPSD? Unfortunately GPSD is not available through Entware, so you would compile it yourself?

My GPS antenna is not yet connected to the router because it is being shipped from Hong Kong and I am still waiting for the pieces. However, phase 1 is done, where I compiled Ntpd for the RT-AC68U router. It is sync'ing the router clock with eight pool.ntp.org servers. It works good!!

Phase 2 will be to make a cable to connect the GPS antenna to the router. The NEMA and PPS outputs of the GPS antenna will be wired to the Serial-to-USB converter. I have rebuilt the Asuswrt-Merlin firmware to support the hardware that I will be plugging into the USB port. Will it work? Then I can disconnect from the Internet and enjoy my 'wickedly' super precise router clock.
 
Must first build the Asuswrt-Merlin firmware. Then use the ARM toolchain, included with Asuswrt-Merlin, to build Libcap and Ntpd.

You have me onboard this round. LOL. I've been procrastinating for over a year on building the firmware. Took the plunge at last. There were a few bumps but the build process was smoother than I anticipated, considering the fact that from setting up a linux VM to finishing the AC56U image in one night.

Thanks for the command line. Gave it a try and got everything compiled. I recognised as you already mentioned not yet built libcap. What's your the command line/makefile for building libcap?
 
my perspective would be to run GPSD on the router and thereby enable wireless GPSD from a GPS so that clients connected to the router and running Opencpn can get GPS position wireless from the router.

A router is not like a drone though...it can't fly nor sail. What good would it be for the position readings? Interesting stuff. Just that I haven't fully understood the picture..
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top