forked from ch2i/LoraGW-Setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
5_GPS.sh
executable file
·53 lines (45 loc) · 1.06 KB
/
5_GPS.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
INSTALL_DIR="/opt/loragw"
MODEL=`cat /proc/device-tree/model`
if [ $(id -u) -ne 0 ]; then
echo "Installer must be run as root."
echo "Try 'sudo bash $0'"
exit 1
fi
echo "This script configures a Raspberry Pi"
echo "GPS for TTN gateway"
echo
echo "Device is $MODEL"
echo
echo "Run time ~1 minute. Reboot required."
echo
echo -n "CONTINUE? [Y/n] "
read
if [[ "$REPLY" =~ ^(no|n|N)$ ]]; then
echo "Canceled."
exit 0
fi
echo ""
echo "Enter GPS device to use"
echo -n "default is set to /dev/ttyS0 : "
read DEVGPS
if [[ $DEVGPS == "" ]]; then
DEVGPS="/dev/ttyS0"
fi
sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
echo
echo "now change the file $INSTALL_DIR/local_conf.json"
echo "and check that the following lines exist"
echo
echo '"fake_gps": false,'
echo '"gps": true,'
echo '"gps_tty_path": "'$DEVGPS'"'
echo
echo "you may also need to add theese lines"
echo "to /boot/config.txt (example for PI 3)"
echo
echo "dtoverlay = pi3-miniuart-bt"
echo "enable_uart=1"
echo
echo "then reboot the Raspberry Pi"