Position and Time Synchronization for USB-C Gadget from iPad


When operating portable in the field—such as during SOTA, POTA, or holiday activations—digital modes like FT8, FT4, JS8Call, or Pat Winlink come with two strict requirements: your system clock must be accurate within a few hundred milliseconds, and logging software needs your exact coordinates to determine the Maidenhead grid square.

While the Raspberry Pi 5 features an onboard real-time clock (RTC), it will eventually drift without a backup battery or an active internet connection—and the Pi does not include a built-in GPS receiver. Instead of adding another USB GPS dongle or screwing an external SMA GNSS antenna onto your transceiver interface and sacrificing space in a minimalist portable kit, you can leverage a device that is already sitting right in front of you: your iPad.

Seamless Addition to the iPad USB-C Gadget Setup

This guide builds directly on my previous article, Raspberry Pi 5 as an iPad USB-C Gadget for Ham Radio. In that setup, the Raspberry Pi 5 is powered by the iPad over a single USB-C cable while simultaneously establishing an Ethernet-over-USB network bridge between both devices.

Using that exact same USB-C network link, your iPad (on Cellular models, the built-in GNSS chip works even in Airplane Mode and without a SIM card inserted) can stream high-precision GPS coordinates and UTC timestamps as NMEA-0183 sentences directly to the Raspberry Pi 5. We configure the Pi so that at home in the shack, it prioritizes accurate NTP servers from your local network, and in the field without internet access, it seamlessly falls back to the iPad’s GPS stream—without hanging or throwing errors when the iPad is disconnected.


1. Prepare the Raspberry Pi 5: Install gpsd and chrony

First, install the GPS daemon (gpsd), its command-line client tools (cgps), and the chrony time synchronization service on your Raspberry Pi 5. If systemd-timesyncd was previously active, installing chrony automatically replaces it.

sudo apt update && sudo apt install -y gpsd gpsd-clients chrony

2. Configure gpsd for Passive UDP Reception

To prevent gpsd from probing serial USB ports and blocking your transceiver interfaces (such as an Elecraft KX2 or a LiNK500) back in the shack, disable automatic USB device detection (USBAUTO="false"). Instead, configure gpsd to listen passively on UDP port 10110 for incoming NMEA packets from the iPad.

sudo tee /etc/default/gpsd > /dev/null << 'EOF'
START_DAEMON="true"
USBAUTO="false"
DEVICES="udp://0.0.0.0:10110"
GPSD_OPTIONS="-n"
EOF

The -n flag tells gpsd to start polling immediately upon boot rather than waiting for a client application (like JS8Call or WavelogGate) to connect. This ensures the shared-memory segment for chrony is always populated as soon as NMEA packets arrive.

Next, enable and restart the service:

sudo systemctl enable --now gpsd
sudo systemctl restart gpsd

3. Configure chrony for Automatic Failover Between Shack NTP and iPad GPS

In the shack, the Raspberry Pi 5 should discipline its clock using your local router (e.g., FRITZ!Box) or public NTP pools. Out in the field with no internet connectivity, chrony should automatically fall back to the timestamps provided by the iPad’s NMEA stream.

Append the gpsd shared-memory reference clock (SHM 0) to the end of /etc/chrony/chrony.conf:

grep -q "refid NMEA" /etc/chrony/chrony.conf || echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf
sudo systemctl enable --now chrony
sudo systemctl restart chrony

Verify the active time sources right away using chronyc:

chronyc sources -v

As long as no packets are being sent from the iPad yet, you will see #? NMEA with Reach 0 sitting quietly in standby, while your internet NTP servers remain active (marked with ^* and ^+). Nothing blocks or slows down normal operation in the shack.


4. Find the Raspberry Pi’s USB-C IP Address

To tell the iPad where to send its NMEA packets, check the IP address assigned to your Raspberry Pi’s USB-C gadget network interface:

ip -4 -br addr

In my setup, the Raspberry Pi 5 uses the IP address 10.12.194.1 on the USB-C link to the iPad.


5. Set Up GPS2IP on the iPad

On the iPad, the GPS2IP app reads the internal GNSS receiver and streams NMEA-0183 sentences over the USB-C Ethernet connection.

  1. Allow Background Location Access: On your iPad, open Settings → Privacy & Security → Location Services → GPS2IP and set access to Always. This ensures the NMEA stream continues running reliably in the background while you switch to Safari (for Pat Winlink or Wavelog) or your VNC viewer.
  2. Configure the Connection in GPS2IP:
    • Connection Method: UDP Push
    • IP Address: 10.12.194.1 (the USB-C IP address of your Raspberry Pi 5)
    • Port: 10110
    • NMEA Messages: Enable GGA and RMC (provides coordinates, altitude, fix status, and accurate UTC timestamps).
  3. Start Streaming: Toggle the main switch in GPS2IP to enable transmission.

Offline Tip: On a Wi-Fi + Cellular iPad, the internal GNSS chip operates even without a SIM card and with Airplane Mode enabled. If you travel a significant distance without internet access, allow 30 to 90 seconds under a clear sky for a cold-start satellite fix since Assisted-GPS (A-GPS) almanac data cannot be downloaded over cellular data.


6. Verify Position and Time Sync on the Raspberry Pi 5

Once GPS2IP is running on the iPad, launch cgps on the Raspberry Pi 5 to verify incoming data:

cgps -s

Within seconds, the status screen will display:

  • Status: 3D FIX
  • Grid Square: Your exact 8-character Maidenhead locator (e.g., JN37vx46)
  • Time: Accurate UTC time

Running chronyc sources -v again confirms that chrony is now receiving valid timestamps from the iPad (#- NMEA with an increasing Reach register and an offset well below 100 ms):

MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
#- NMEA                          0   4    42    54    +71ms[  +71ms] +/-  105ms
^* fritz.box                     2   6   377     8   +229us[ +190us] +/- 8150us

As soon as you head out into the field and leave your home network behind, chrony automatically promotes #* NMEA as its primary time source, keeping your system clock well within the tolerances required for FT8 and JS8Call. Applications like JS8Call (Settings → General → Use GPS) and WavelogGate2 can now query the local gpsd daemon (localhost:2947) directly to populate your portable grid square automatically.