Install ChroGPS Dash Manually
If you prefer to set things up manually, ensure you have the following:
- Web Server: Nginx or Apache
- PHP: Version 8.2 or newer
- System Utilities: sudo (required for executing chronyc commands)
- NTP/GPS: Chrony and GPSd installed and running
Configuration Details
Sudo Permissions
The dashboard requires permission to execute chronyc commands to fetch timing data. The installer creates a drop-in file at /etc/sudoers.d/chrogps-dash with the following content:
www-data ALL=(ALL) NOPASSWD: /usr/bin/chronyc sources, /usr/bin/chronyc tracking, /usr/bin/chronyc serverstats, /usr/bin/chronyc -n clients, /usr/bin/chronyc clients, /usr/bin/chronyc makestep, /usr/local/bin/cgpsd-purge-logs, /usr/local/bin/cgpsd-restart-gpsd, /usr/local/bin/cgpsd-restart-chrony, /usr/local/bin/cgpsd-restart-poller
For a manual setup, create that file yourself rather than editing /etc/sudoers directly:
sudo tee /etc/sudoers.d/chrogps-dash > /dev/null << 'EOF'
www-data ALL=(ALL) NOPASSWD: /usr/bin/chronyc sources, /usr/bin/chronyc tracking, /usr/bin/chronyc serverstats, /usr/bin/chronyc -n clients, /usr/bin/chronyc clients, /usr/bin/chronyc makestep, /usr/local/bin/cgpsd-purge-logs, /usr/local/bin/cgpsd-restart-gpsd, /usr/local/bin/cgpsd-restart-chrony, /usr/local/bin/cgpsd-restart-poller
EOF
sudo chmod 440 /etc/sudoers.d/chrogps-dash
The additional entries cover the System tab actions in the admin panel. See Log Purge Helper Script and Service Restart Helper Scripts below for how to create them.
Log File Access
- The graphs are generated by parsing raw Chrony logs (tracking.log, statistics.log, measurements.log). The installer:
- Adds the
www-datauser to the group that owns/var/log/chrony(detected at install time viastat; typically_chrony). - Sets
chmod 770on the/var/log/chronydirectory andg+ron any existing log files inside it. - Configures Chrony to log the data if it’s not enabled.
…So you will need to perform these tasks if you wish to install ChroGPS Dash manually.
GPSD Integration
The dashboard connects to gpsd via a local socket on port 2947. Ensure gpsd is configured to listen on all interfaces or at least localhost.
History Graph Data Files
The satellite and PPS history graphs are always-on and appear automatically once their rolling log files contain data. You must create the files and set www-data ownership before starting the dashboard, otherwise the dashboard will attempt to create them itself (and may fail without the right permissions):
sudo touch /var/tmp/cgpsd-sat-counts.data \
/var/tmp/cgpsd-gps-snr.data \
/var/tmp/cgpsd-pps-offset.data \
/var/tmp/cgpsd-dop.data \
/var/tmp/cgpsd-snr-hist.data
sudo chown www-data:www-data /var/tmp/cgpsd-sat-counts.data \
/var/tmp/cgpsd-gps-snr.data \
/var/tmp/cgpsd-pps-offset.data \
/var/tmp/cgpsd-dop.data \
/var/tmp/cgpsd-snr-hist.data
sudo chmod 644 /var/tmp/cgpsd-sat-counts.data \
/var/tmp/cgpsd-gps-snr.data \
/var/tmp/cgpsd-pps-offset.data \
/var/tmp/cgpsd-dop.data \
/var/tmp/cgpsd-snr-hist.data
The installer handles this automatically; the above is only required for a fully manual setup.
Systemd Poller Timer
The installer automatically creates and enables two systemd units that poll the dashboard’s data endpoint (?ajax=1) every 30 seconds, keeping all history logs populated continuously without requiring an open browser tab:
/etc/systemd/system/chrogps-poller.service- oneshot service that runscurlagainst the local endpoint./etc/systemd/system/chrogps-poller.timer- fires the service every 30 seconds (OnUnitActiveSec=30s).
For a fully manual setup, create and enable these units yourself, or use an equivalent cron job. Example cron entry (every 30 seconds):
* * * * * curl -s 'http://localhost/index.php?ajax=1' >/dev/null
* * * * * sleep 30; curl -s 'http://localhost/index.php?ajax=1' >/dev/null
Log Purge Helper Script
The admin panel’s System tab exposes a Purge Logs button that stops GPSd and Chrony, deletes all GPS and timing data logs, and restarts those services. The PHP backend calls this via sudo, so you must create the helper script and allow www-data to execute it.
Create the script:
sudo tee /usr/local/bin/cgpsd-purge-logs > /dev/null << 'EOF'
#!/bin/bash
systemctl stop gpsd.socket gpsd.service chrony.service 2>/dev/null || true
rm -f /var/tmp/cgpsd-* 2>/dev/null || true
rm -f /var/log/chrony/*.log 2>/dev/null || true
systemctl restart chrony.service 2>/dev/null || true
systemctl restart gpsd.service gpsd.socket 2>/dev/null || true
EOF
sudo chmod 755 /usr/local/bin/cgpsd-purge-logs
sudo chown root:root /usr/local/bin/cgpsd-purge-logs
The sudoers entry shown in Sudo Permissions above already includes this path. If you are adding it to an existing sudoers file by hand, make sure /usr/local/bin/cgpsd-purge-logs is appended to the www-data NOPASSWD line as shown there.
If you skip this step, the Purge Logs button will still appear in the admin panel but will return an error with instructions to run the installer.
Service Restart Helper Scripts
The admin panel’s System tab exposes three service restart buttons (Restart GPSd, Restart Chrony, Restart Poller Timer). Each calls a small helper script via sudo. Create all three:
sudo tee /usr/local/bin/cgpsd-restart-gpsd > /dev/null << 'EOF'
#!/bin/bash
systemctl restart gpsd.socket gpsd.service 2>/dev/null || true
EOF
sudo chmod 755 /usr/local/bin/cgpsd-restart-gpsd
sudo chown root:root /usr/local/bin/cgpsd-restart-gpsd
sudo tee /usr/local/bin/cgpsd-restart-chrony > /dev/null << 'EOF'
#!/bin/bash
systemctl restart chrony.service 2>/dev/null || true
EOF
sudo chmod 755 /usr/local/bin/cgpsd-restart-chrony
sudo chown root:root /usr/local/bin/cgpsd-restart-chrony
sudo tee /usr/local/bin/cgpsd-restart-poller > /dev/null << 'EOF'
#!/bin/bash
systemctl restart chrogps-poller.timer 2>/dev/null || true
EOF
sudo chmod 755 /usr/local/bin/cgpsd-restart-poller
sudo chown root:root /usr/local/bin/cgpsd-restart-poller
The Force Chrony Makestep button in the System tab calls chronyc makestep directly via sudo - no helper script is needed for that action, only the /usr/bin/chronyc makestep entry already included in the sudoers drop-in above.
If you skip creating the restart scripts, the corresponding buttons will still appear in the admin panel but will return an error with instructions to run the installer.
Install The Script
Once you have everything setup, grab the script and place it in a location accessible from your web server.