From 8c80d7e5352cb3b62fa587f14e4b958f5bbd4656 Mon Sep 17 00:00:00 2001 From: Neal Probert Date: Thu, 25 Mar 2021 13:39:57 -0400 Subject: [PATCH] Added install help for gps_tool --- gps_tool/etc/default/gpsd | 14 +++++++++++++ .../multi-user.target.wants/gpsd.service | 15 ++++++++++++++ gps_tool/setup.sh | 20 ++++++++++++++----- packages/packages.sh | 3 ++- 4 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 gps_tool/etc/default/gpsd create mode 100644 gps_tool/etc/systemd/system/multi-user.target.wants/gpsd.service diff --git a/gps_tool/etc/default/gpsd b/gps_tool/etc/default/gpsd new file mode 100644 index 0000000..d7434c6 --- /dev/null +++ b/gps_tool/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/gps_tool/etc/systemd/system/multi-user.target.wants/gpsd.service b/gps_tool/etc/systemd/system/multi-user.target.wants/gpsd.service new file mode 100644 index 0000000..95f05a8 --- /dev/null +++ b/gps_tool/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/gps_tool/setup.sh b/gps_tool/setup.sh index b9c8861..070d90d 100755 --- a/gps_tool/setup.sh +++ b/gps_tool/setup.sh @@ -1,10 +1,20 @@ #!/bin/bash # Python 3 -echo "Python 3 packages:" -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 spyder3 python3-pyside2.* +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 +apt-get -y --ignore-missing install spyder3 python3-pyside2.* +apt-get -y --ignore-missing install gpsd gpsd-clients gpsbabel libgps-dev python-gps # Python addons -sudo -H pip install --upgrade pip -sudo -H pip install configparser pyside2 -sudo -H pip install --upgrade pyserial matplotlib numpy scipy scapy gps gpxpy maidenhead virtualenv virtualenvwrapper +echo "Python 3 Packages:" +sudo -H pip3 install --upgrade pip +sudo -H pip3 install configparser pyside2 +sudo -H pip3 install --upgrade pyserial matplotlib numpy scipy scapy gps gpxpy maidenhead virtualenv virtualenvwrapper + +# gpsd startup +cp -r etc/* /etc/ + +# enable and start gpsd service +systemctl enable gpsd.service +systemctl start gpsd.service diff --git a/packages/packages.sh b/packages/packages.sh index f16e3a7..c3df84c 100755 --- a/packages/packages.sh +++ b/packages/packages.sh @@ -3,11 +3,12 @@ # Python 3 echo "Python 3 packages:" 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 spyder3 python3-pyside2.* +sudo apt-get -y --ignore-missing install gpsd gpsd-clients gpsbabel libgps-dev python-gps # Python addons sudo -H pip3 install --upgrade pip sudo -H pip3 install configparser pyside2 -sudo -H pip3 install --upgrade pyserial numpy pyasn1 scapy virtualenv virtualenvwrapper +sudo -H pip3 install --upgrade pyserial numpy plotly scapy scipy gps gpxpy maidenhead pyyaml virtualenv virtualenvwrapper # cleanup sudo apt-get autoremove