05-26-2013 06:41 PM - edited 07-04-2021 12:08 AM
I have a Cisco 819 router which has a built in GPS capability. GPS recieves a very accurate time from the satellite. Is it possible to use this accurate time source to set the time on the router, and then use it as an NTP server?
05-27-2013 06:13 AM
Sure.. I don't see why you can't since it is an NTP source.
Sent from Cisco Technical Support iPhone App
05-29-2013 08:10 AM
I don't see why not either, but the question is how? There are no commands that I can see to tell the unit to use its gps to set the clock.
05-29-2013 08:19 AM
Looks like it depends on the GPS. Not sure if this is truly embedded or plugged in to the 871. This doc may help...
https://supportforums.cisco.com/docs/DOC-1263
"
Can we use a GPS clock to the router?
Yes, Cisco routers can connect to a GPS clock through its AUX port. However, Cisco only support GPS clocks from Symmetricom[22] (former Telecom-solutions). However, on a 2600 and 3600, this function is not supported because the AUX port is considered as “floating”, i.e. not fixed.
For router that used support GPS clock, use this command under the line [num]:
ntp refclock telecom-solutions pps cts
"
Another potential helpful doc...
http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf012.html#wp1010044
06-01-2013 09:22 AM
Thanks for the links David, but unfortunately they do dot give any indication to using the built in GPS as a time source, just some third party sources.
05-30-2013 07:39 PM
Hello Sly,
As per your query i can suggest you the following solution-
Yes you can surely use the accurate time source to set the time on the router, and then use it as an NTP server.
For more information on how to configure please refer to the link-
http://www.cisco.com/en/US/docs/routers/access/800/819/software/configuration/Guide/3routconf.html
Hope this will help you.
06-01-2013 09:21 AM
I have already read this document, but I can not see anywhere refering to using the internal GPS to set the clock. The only GPS information is on NMEA streaming to Microsoft Streets. Nothing about using it as a reference clock. If you believe there is surely a way to do it, can you please be specific about the commands required.
06-01-2013 10:17 AM
Yeah... I don't think its possible... you need to point it to an ip or host.
Thanks,
Scott
Help out other by using the rating system and marking answered questions as "Answered"
11-08-2015 12:35 PM
It turns out there is a bodge to use the in built GPS to set the time using Event Manager and tcl scripting.
The following PDF has details.
http://www.cisco.com/c/dam/en/us/td/docs/routers/access/interfaces/software/deployment/guide/guide_120913.pdf
It consists of a script that executes the "show cellular 0 gps" command and extracts the time values to then put into the set clock command. A bit laggy and not that accurate compared to NTP, but better than having the clock drift.
I do notice that the GPS sometinmes returns a time of 06:28:16 2036 which is a bit crap but it fails to set this time, so no problem.
The default in the script is to run at mid day every day. I set it to run more often by editing the first line
from:
::cisco::eem::event_register_timer cron name gps_time.tcl cron_entry "0 12 * * *" maxrun 55
to
::cisco::eem::event_register_timer cron name gps_time.tcl cron_entry "10 * * * *" maxrun 55
this now runs ten minutes past the hour every hour.
09-24-2017 04:38 PM
I'm running into a bit of a problem with the gps_time.tlc script. Every time it executes, I get
Tcl policy execute failed: gps_time.tcl: can't read "mon": no such variable gps_time.tcl: INT = Cellular 0/0 gps_time.tcl: can't read "mon": no such variable while executing gps_time.tcl: "puts "regx = $mon $day $tod $year""
This leads me to believe it is not correctly interpreting the previous line:
regexp {:\s+[a-zA-Z]+\s+([a-zA-Z]+)\s+(\d+)\s+(\d+:\d+:\d+)\s+(\d+)} $result match mon day tod year
Any thoughts?
02-12-2019 06:27 PM
I'm running this on a 1921/K9 with an EHWIC-4G-LTE-VZ and running into the same issue. At first, it was the $interface variable having issues. I hard-coded the correct Cellular 0/1/0 interface, but now I'm seeing the $mon variable erorr.
I have GPS coordinates acquired, according to the GPS Status, and the output from "sh Cellular 0/1/0 gps | i stamp" = Timestamp (GMT): Tue Feb 12 20:18:46 2019 which, when using a regex parser, parses out correctly into 4 parts - Feb ($mon), 12 ($day), 20:18:46 ($tod), and 2019 ($year) which should be saved to $mon $day $tod $year according to the code, but throws the below error instead.
Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: can't read "mon": no such variable Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: while executing Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: "puts "regx = $mon $day $tod $year"" Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: invoked from within Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: "$slave eval $Contents" Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: (procedure "eval_script" line 7) Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: invoked from within Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: "eval_script slave $scriptname" Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: invoked from within Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: "if {$security_level == 1} { #untrusted script Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: interp create -safe slave Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: interp share {} stdin slave Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: interp share {} stdout slave Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: ..." Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: (file "tmpsys:/lib/tcl/base.tcl" line 50) Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: Tcl policy execute failed: Feb 13 02:15:01.754: %HA_EM-6-LOG: gps_time.tcl: can't read "mon": no such variable
02-17-2019 06:28 PM
Found the issue. I'm using a TACACS server with command authorization. The enable and show commands were failing with "Command authorization failed.", however, this error was not being logged. On the TACACS server, you will see:
TACACS: TACACS+ authorization request missing both User and Remote-Address attributes
The following commands failed to run, however, they were logged on the TACACS server:
if [catch {cli_exec $cli1(fd) "enable"} result] {
error $result $errorInfo
if [catch {cli_exec $cli1(fd) "show Cellular 0/1/0 gps | inc stamp" } result ] {
error $result $errorInfo
So, $result now contained "Command authorization failed."
When running:
regexp {:\s+[a-zA-Z]+\s+([a-zA-Z]+)\s+(\d+)\s+(\d+:\d+:\d+)\s+(\d+)} $result match mon day tod year
There was no match and so $mon $day $tod and $year were not being created. This is where the first error is logged:
Feb 17 23:15:01.753: %HA_EM-6-LOG: gps_time.tcl: can't read "mon": no such variable
Feb 17 23:15:01.753: %HA_EM-6-LOG: gps_time.tcl: while executing
Feb 17 23:15:01.753: %HA_EM-6-LOG: gps_time.tcl: "puts "regx = $mon $day $tod $year""
Feb 17 23:15:01.753: %HA_EM-6-LOG: gps_time.tcl: invoked from within
To resolve this, I did the following:
1) create a username on the router with priv 15 and password
2) add - "event manager session cli username "<username>" privilege 15"
3) make sure in Tacacs, there is a username and password pair that matches the one entered on the router. This is what is passed to Tacacs to authenticate.
4) Make sure the enable, show cellular, and clock set commands are authorized for this user.
02-17-2019 06:29 PM
05-05-2017 10:18 AM
This release note came out before they started lumping Cisco IR800 Industrial Integrated Services Routers and Cisco 1000 Series Connected Grid Routers together. But you may give this a try:
Cisco IOS Release 15.5(2)T - Release Notes for Cisco 1000 Series Connected Grid Routers and Cisco 500 Series WPAN Industrial Routers > NTP timing based on GPS Clock.
[no] ntp refclock gps
06-02-2017 01:05 AM
I was *so* hopeful about this. But no go.
I loaded c800-universalk9_iox-mz.SPA.155-2.T4.bin on a C819G
'ntp refclock gps' is not valid. Bummer.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide