[openwrt] initial gps code
This commit is contained in:
parent
7e4fe889d9
commit
9c2922956e
1 changed files with 28 additions and 2 deletions
|
@ -1,5 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
opkg install kmod-usb-acm
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "$0 ip-address"
|
||||
echo " ip-address: where to find the device"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ugps?
|
||||
|
||||
set -x
|
||||
|
||||
openwrt_ip=$1; shift
|
||||
|
||||
ping -c3 ${openwrt_ip}
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Cannot reach ${openwrt_ip}, aborting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF | ssh -t "root@${openwrt_ip}"
|
||||
set -x
|
||||
|
||||
opkg update
|
||||
opkg install kmod-usb-acm gpsd
|
||||
|
||||
uci set gpsd.core.enabled=1
|
||||
uci set gpsd.core.listen_globally=1
|
||||
uci set gpsd.core.device="/dev/ttyACM0"
|
||||
uci commit
|
||||
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue