#17211: Add support for setting system clock from gps
-------------------------+------------------------
Reporter: birger@… | Owner: developers
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: packages | Version: Trunk
Keywords: |
-------------------------+------------------------
I have added one new option to /etc/config/gpsd:
option setclock "true"
And the following lines to /etc/init.d/gpsd:
config_get_bool setclock core setclock
.
.
.
[ "$setclock" != "1" ] && exit
NOW=`gpspipe -l -w -n 10 | grep -m 1 "time" | sed -e
's/.*"time":"\(....\).\(..\).\(..\).\(........\).*/\1\.\2\.\3-\4/'`
echo "Got date $NOW from GPS. Setting system time." > /dev/console
date "$NOW"
}
Does the GPS always find the time fast even if it can spend a long time
getting a position fix? Or should this be forked off into a background
thread? My Holux USB puck seems to always give me time in the first SKY
sentences before it gets a fix and starts giving position data.
Of course there should also be a way to set this config variable in the
GUI.
--
Ticket URL: <https://dev.openwrt.org/ticket/17211>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets