2022-08-20 13:40:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-10-22 11:40:41 +00:00
|
|
|
set -ex
|
|
|
|
|
2022-10-11 06:17:13 +00:00
|
|
|
echo "Setting up GPS recording"
|
|
|
|
|
2022-10-22 11:40:41 +00:00
|
|
|
sudo apt-get update && sudo apt-get install -y gpsd gpsd-clients
|
2022-08-20 13:40:10 +00:00
|
|
|
|
2022-10-22 12:54:50 +00:00
|
|
|
sudo pip install -r $HOME/hydrophonitor/gps-logger/requirements.txt
|
2022-10-11 19:06:50 +00:00
|
|
|
|
2022-08-20 13:40:10 +00:00
|
|
|
sudo systemctl stop gpsd.socket
|
|
|
|
sudo systemctl disable gpsd.socket
|
|
|
|
|
|
|
|
device="/dev/ttyUSB0"
|
|
|
|
|
|
|
|
sudo gpsd ${device} -F /var/run/gpsd.sock
|
|
|
|
|
|
|
|
sudo sed -i "s|DEVICES=\"\"|DEVICES=\"${device}\"|g" /etc/default/gpsd
|
|
|
|
|
2022-10-11 06:17:13 +00:00
|
|
|
sudo grep -qxF "START_DAEMON=\"true\"" /etc/default/gpsd || echo "START_DAEMON=\"true\"" | sudo tee -a /etc/default/gpsd
|