cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10719
Views
5
Helpful
29
Comments
Dan Frey
Cisco Employee
Cisco Employee

This ISR sample application  uses a tclsh script managed by an EEM applet to stream NMEA formatted location data in UDP packets (with configurable port number) to a defined target.  TCLSH script is in the attached zip file and also requires the following CLI commands.

 

! CLI commands required:

event manager environment server "your server ip address"
event manager environment udp_port "your udp port"

event manager applet NMEA
event syslog pattern "LINEPROTO-5-UPDOWN: Line protocol on Interface Cellular[0-9\/]+, changed state to up" maxrun 31536000
action 010 cli command "enable"
action 020 syslog msg "NMEA streaming starting now"
action 030 cli command "tclsh flash:stream_NMEA2.tcl $server $udp_port"

aaa new-model
 aaa authentication login nologin none
 aaa authorization exec nologin none
controller Cellular <number>
  lte gps mode standalone
 "lte gps nmea ip" for 819.  "lte gps nmea" for all other platforms

 

Comments
sburton011
Level 1
Level 1

Its connecting:

STJ-TEST-KEN#sh users
    Line       User       Host(s)              Idle       Location
   0 con 0                idle                 00:24:21
   3 tty 3                Async interface      00:00:00
   7 tty 7                incoming             00:00:00 192.168.252.129
*705 vty 0     admin      idle                 00:00:00 192.168.101.130
 707 vty 2     admin      idle                 00:00:20 192.168.101.130

  Interface    User               Mode         Idle     Peer Address

STJ-TEST-KEN#sh line
   Tty Line Typ     Tx/Rx    A Modem  Roty AccO AccI  Uses  Noise Overruns  Int
*     0    0 CTY              -    -      -    -    -     0      0    0/0      -
      1    1 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
      2    2 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
A     3    3 TTY              - inout     -    -    -     0      0    0/0    Ce0
      4    4 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
*     7    7 TTY              - inout     -    -    -     9   1365    0/0    NM7
      8    8 TTY              -    -      -    -    -     0      0    0/0    Ce1
    1/3   69 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
    1/4   70 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
    1/5   71 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
    1/6   72 TTY   9600/9600  -    -      -    -    -     0      0    0/0      -
*   705  705 VTY              -    -      -    -   23     3      0    0/0      -
    706  706 VTY              -    -      -    -   23     1      0    0/0      -
*   707  707 VTY              -    -      -    -   23     2      0    0/0      -
    708  708 VTY              -    -      -    -   23     0      0    0/0      -
    709  709 VTY              -    -      -    -   23     0      0    0/0      -

Line(s) not in async mode -or- with no hardware support:
5-6, 9-68, 73-704

Dan Frey
Cisco Employee
Cisco Employee

debug ip packet using an ACL that limits it to the UDP traffic.   Need to verify that the packets are being sent.    Run TCPdump on the server to see if they are being received.    Firewall update needed on the server running NMEA application?

Dan Frey
Cisco Employee
Cisco Employee

I think it would be better if we got on a web ex to take a look.   you can contact me at dafrey@cisco.com to set up a time to troubleshoot.

sburton011
Level 1
Level 1

I don't believe the packers are being sent. There is a firewall in between and I don't see the packets hitting the firewall. I will do the debug and see what it says though. Not much traffic on it so should be fine.

Dan Frey
Cisco Employee
Cisco Employee

Also, verify that the environment variables do not have quotes.   If they have quotes I believe they will be passed as variable syntax.

event manager environment server 192.168.0.125

event manager environment udp_port 12345

sburton011
Level 1
Level 1

Might be it. No traffic from packet debug.

sburton011
Level 1
Level 1

No change... I have starting the script from the command lin e and below is the output when I clear line tty 7:

STJ-TEST-KEN#tclsh flash:nmea_829_gps.tcl $server $udp_port
server and port = $server $udp_port
invalid service name: "$udp_port" could not be converted to a port number.
while executing
"fconfigure $sock -remote [list $server $sudp_port]"
(file "flash:nmea_829_gps.tcl" line 62)

STJ-TEST-KEN#tclsh flash:nmea_829_gps.tcl 192.168.108.74 30176
server and port = 192.168.108.74 30176
error reading "sock1": broken pipe
while executing
"gets $fd line"
(file "flash:nmea_829_gps.tcl" line 1)

STJ-TEST-KEN

Not sure if that sheds any light.

It seems to do what its supposed to do by reverse telnet ting in, then it sits there and does nothing.

sburton011
Level 1
Level 1

Just an update on this.

I am still struggling to get a working solution. The IR829 platform has a streaming parameter where I can send a directed UDP stream back to my GPS server. This works and the format is: Red being the line that created the stream....

controller Cellular 0
lte gps mode standalone
lte gps nmea ip udp 192.168.252.129 192.168.108.74 30176

To try to address my GPS excessive data consumption issue I added in the following to schedule the turn and off of the red line every 60 seconds and let it run for 5 and shut it down again:

event manager applet NMEA
event timer watchdog time 60
action 010 cli command "enable"
action 015 cli command "conf te"
action 020 cli command "controller cellular 0"
action 030 cli command "lte gps nmea ip udp 192.168.252.129 192.168.108.74 30176"
action 040 wait 5
action 050 cli command "no lte gps nmea ip udp 192.168.252.129 192.168.108.74 30176"

On a reboot of the router this works for the first time and them no more streaming NMEA until the router is rebooted and the applet removed.

Is there an issue with the EEM applet?

TAC is no help at all at this point.

toddp
Level 1
Level 1

 I'd like to revive this thread.  I'm having the same problem as the original poster with the as-written script and config not sending out data.  I added in the line to rebroadcast and the cell modem just cycles up and down and nothing gets sent.  Specifically I added this line to the cell controller

lte gps nmea ip udp 1.2.3.4 <my NMEA ingester ip> <my NMEA ingester port>

the 1.2.3.4 is the loopback IP from the tcl script.  I haven't made any modifications to the NMEA tcl script.

 

I'm running ir800-universalk9-mz.SPA.156-3.M

 

 

steven.anthony
Level 1
Level 1

When I was having the issue with no data sending, I found somewhere in the forums to remove one of the lines from the original script.  Once I did that, the streaming started to work..   Also, we have an entry to pause from sending a steady stream, I believe that's where the counter is..

 

Here's our latest tcl script we're using on:

Cisco C819G-4G-A-K9

c800-universalk9-mz.SPA.154-3.M6a.bin

 

package require udp

set server [lindex $argv 0]

set sudp_port [lindex $argv 1]

puts "server and port = $server $sudp_port"

set intf [ios_config "int loopback 7" "description DO NOT REMOVE" "ip add 1.2.3.4 255.255.255.255"]

set pt [exec show line | inc NM]

regexp {.?\s+(\d+)\s+TTY} $pt -> line

set cl [exec clear line $line]

set ttyline [ios_config "line $line" "login authentication nologin"]

set transprt [ios_config "line $line" "transport input all"]

set sock [udp_open]

fconfigure $sock -remote [list $server $sudp_port]

after 1000

set IP "1.2.3.4"

set port [expr 2000 + $line]

set fd [socket $IP $port]

set counter 120

while {[gets $fd line] } {

incr counter

  if [ regexp {^\$GPRMC} $line ->line ] {

    if {$counter >= 120} {

      puts -nonewline $sock $line

      flush $sock

      set counter 0

    }

  }

}

toddp
Level 1
Level 1

Thanks - that works!

How can a UDP listener service determine the specific device ID of the sender of the NMEA strings among many Cisco devices without provisioning static IP addresses for each Cisco device?

Daniil
Level 1
Level 1

Hi,

if we use this script on lot of routers we need add hostname to line.

how we can do it on script?

 

WBR, Daniil

steven.anthony
Level 1
Level 1

I'm back to trying to control the GPS stream on a c1111-4plteea. 

 

I can't seem to control how often the GPS data is sent.. The router does send it automatically without the script, but over 200x's per second to the server... way too much data..

 

Anyone have an idea of what is need to control the GPS data flow on a c1111-4plteea?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: