This document describes how to configure GPS PPS on a Raspberry Pi and verify end-to-end time synchronization across the system, from GPS to Chrony, PHC, and PTP.
Configure the PPS GPIO line by appending the following to /boot/config.txt on the Raspberry Pi:
# GPS PPS configuration
dtoverlay=pps-gpio,gpiopin=18
enable_uart=1
init_uart_baud=9600Reboot the Raspberry Pi after making these changes.
Follow the steps below in order to verify that time synchronization is functioning correctly.
Launch the sensor platform and wait until the IMU has a valid GPS lock and UTC time.
ros2 launch sensor_bringup sensor_platform_launch.pyConfirm that NMEA messages are being published in ROS 2.
ros2 topic echo /nmeaEnsure the ROS node is subscribing to the NMEA topic and forwarding UDP NMEA strings (including constructed GPRMC sentences).
Check that gpsd is running and receiving raw NMEA data:
sudo systemctl status gpsd.service
gpspipe -rConfirm that gpsd is correctly feeding time to Chrony.
gpsmon
cgps
chronyc sourcesChrony should show GPS as a valid time source.
Check that the PPS signal is active and disciplining Chrony.
sudo ppstest /dev/pps0
chronyc sourcesThe PPS source should appear with low offset and high precision.
Ensure that phc2sys is disciplining the Ethernet hardware clock using the system clock (already disciplined by Chrony).
sudo systemctl status phc2sys
sudo phc_ctl eth0 cmpThe offset between the system clock and the PHC should be minimal.
Confirm that ptp4l is running and disciplining downstream devices using the hardware clock.
sudo systemctl status ptp4l
curl -i -X GET http://<lidar_ip_address>/api/v1/time/ptpcurl -i -X GET http://10.42.0.28/api/v1/time/ptp
The device should report an active PTP lock and synchronized time.
ros2 launch sensor_bringup lidar_launch.pybash scripts/monitor_topics.shThis setup establishes the following time chain:
GPS → PPS → Chrony (system clock) → PHC (phc2sys) → PTP (ptp4l) → External devices
If any step fails, verify that all upstream components are correctly synchronized before proceeding downstream.
Check for drive then mount it with -t flag if not not sda1.
lsblk -f # look for drive
bash scripts/mount_drive.sh # -t /dev/sdb1bash scripts/monitor_topics.sh
bash scripts/record.shEnter the name of the folder This will copy the config folder into the bag once the recording is complete
bash scripts/mount_drive.sh -u