From 2bed76092df7ce71f527393ee5e7efebeee2c0b0 Mon Sep 17 00:00:00 2001 From: Neal Probert Date: Mon, 8 Jun 2026 17:44:51 -0400 Subject: [PATCH] Saved Pi setup for GSPd and QtGPS --- pi/etc/default/gpsd | 14 +++++++++++ .../multi-user.target.wants/gpsd.service | 15 +++++++++++ .../system/sockets.target.wants/gpsd.socket | 12 +++++++++ pi/setup.sh | 25 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 pi/etc/default/gpsd create mode 100644 pi/etc/systemd/system/multi-user.target.wants/gpsd.service create mode 100644 pi/etc/systemd/system/sockets.target.wants/gpsd.socket create mode 100755 pi/setup.sh diff --git a/pi/etc/default/gpsd b/pi/etc/default/gpsd new file mode 100644 index 0000000..d7434c6 --- /dev/null +++ b/pi/etc/default/gpsd @@ -0,0 +1,14 @@ +# Default settings for the gpsd init script and the hotplug wrapper. + +# Start the gpsd daemon automatically at boot time +START_DAEMON="true" + +# Use USB hotplugging to add new USB devices automatically to the daemon +USBAUTO="true" + +# Devices gpsd should collect to at boot time. +# They need to be read/writeable, either by user gpsd or the group dialout. +DEVICES="/dev/ttyACM0" + +# Other options you want to pass to gpsd +GPSD_OPTIONS="-G" diff --git a/pi/etc/systemd/system/multi-user.target.wants/gpsd.service b/pi/etc/systemd/system/multi-user.target.wants/gpsd.service new file mode 100644 index 0000000..95f05a8 --- /dev/null +++ b/pi/etc/systemd/system/multi-user.target.wants/gpsd.service @@ -0,0 +1,15 @@ +[Unit] +Description=GPS (Global Positioning System) Daemon +Requires=gpsd.socket +# Needed with chrony SOCK refclock +After=chronyd.service + +[Service] +Type=forking +EnvironmentFile=-/etc/default/gpsd +ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES + +[Install] +WantedBy=multi-user.target +Also=gpsd.socket + diff --git a/pi/etc/systemd/system/sockets.target.wants/gpsd.socket b/pi/etc/systemd/system/sockets.target.wants/gpsd.socket new file mode 100644 index 0000000..1978813 --- /dev/null +++ b/pi/etc/systemd/system/sockets.target.wants/gpsd.socket @@ -0,0 +1,12 @@ +[Unit] +Description=GPS (Global Positioning System) Daemon Sockets + +[Socket] +ListenStream= +ListenStream=/var/run/gpsd.sock +ListenStream=[::1]:2947 +ListenStream=0.0.0.0:2947 +SocketMode=0600 + +[Install] +WantedBy=sockets.target diff --git a/pi/setup.sh b/pi/setup.sh new file mode 100755 index 0000000..7a32a96 --- /dev/null +++ b/pi/setup.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Python 3 +echo "Python 3 Software:" +sudo apt-get -y --ignore-missing install python3-all python3-dev python3-tk idle3 python3-pip python3-pyqt5 python3-serial python3-can python3-protobuf python3-numpy python3-pil.imagetk python3-gi +sudo apt-get -y --ignore-missing install spyder3 python3-pyside2.* +sudo apt-get -y --ignore-missing install gpsd gpsd-clients gpsbabel libgps-dev + +# Python addons +echo "Python 3 Packages:" +python3 -m pip install --upgrade pip +python3 -m pip install --upgrade pyserial matplotlib numpy scipy gps gpxpy maidenhead virtualenv virtualenvwrapper + +# enable and start gpsd service +sudo systemctl enable gpsd.service + +# gpsd startup +sudo cp -r etc/* /etc/ +sudo cp -r lib/* /lib/ +sudo systemctl daemon-reload + +# enable and start gpsd service +sudo systemctl start gpsd.service +sudo systemctl enable x11vnc.service +sudo systemctl start x11vnc.service