Difference between revisions of "Manual:System/GPS"

From MikroTik Wiki
Jump to navigation Jump to search
(Created page with '{{Versions|v3, v4, v5 +}} __TOC__ <div class=manual> ==Summary== <p id="shbox"><b>Sub-menu:</b> <code>/system gps</code> <br /> <b>Standards:</b> <code>GPS, NMEA 0183, [http:/…')
 
 
(29 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Versions|v3, v4, v5 +}}
{{Versions|v3, v4, v5, v6 +}}
__TOC__
__TOC__


<div class=manual>


==Summary==
==Summary==


<p id="shbox"><b>Sub-menu:</b> <code>/system gps</code>
<p id="shbox">
<b>Package requirement:</b> <code>gps</code>
<br />
<b>Sub-menu:</b> <code>/system gps</code>
<br />
<br />
<b>Standards:</b> <code>GPS, NMEA 0183, [http://www8.garmin.com/support/text_out.html Simple Text Output Protocol]</code>
<b>Standards:</b> <code>GPS, NMEA 0183, [http://www8.garmin.com/support/text_out.html Simple Text Output Protocol]</code>
</p>
</p>


Global Positioning System (GPS) is used for determining precise location of a GPS receiver. There are two types of GPS service:
Global Positioning System (GPS) is used for determining precise location of a GPS receiver.
* Precise Positioning Service (PPS) that is used only by U. S. and Allied military, certain U. S. Government agencies, and selected civil users specifically approved by the U. S. Government. Its accuracy is 22m horizontally, 27.7m vertically and 200ns of time
* Standard Positioning Service (SPS) can be used by civil users worldwide without charge or restrictions except that SPS accuracy is intentionally degradated to 100m horizontally, 156m vertically and 340ns of time
GPS system is based on 24 satellites rotating on 6 different orbital planes with 12h orbital period. It makes that at least 5, but usually 6 or more satellites are visible at any time anywhere on the Earth. GPS receiver calculates more or less precise position (latitude, longitude and altitude) and time based on signals received from 4 satellites (three are used to determine position and fourth is used to correct time), which are broadcasting their current positions and UTC time.


MikroTik RouterOS can communicate with many GPS receivers which are able to send the positioning and time via asynchronous serial line using NMEA 0183, NMEA/RTCM or Simple Text Output Protocol.
==Configuration Properties==
 
{{Mr-arg-table-h
|prop=Property
|desc=Description
}}


Precise time is mainly intended to be used by built-in NTP server, which can use it as a time source without any additional configuration if GPS is configured to set system time.
{{Mr-arg-table
|arg=channel
|type=integer [0..4294967295]
|default=0
|desc=Port channel used by device
}}


==Properties==
{{Mr-arg-table
<p id="shbox"><b>Sub-menu:</b> <code>/system gps</code></p>
|arg=coordinate-format
|type=dd {{!}} dms {{!}} ddmm
|default=no
|desc=Which coordinate format to use, "Decimal Degrees", "Degrees Minutes Seconds" or "NMEA format DDDMM.MM[MM]"
}}


This submenu allows to synchronize with a GPS Receiver


{{Mr-arg-table-h
{{Mr-arg-table
|prop=Property
|arg=enabled
|desc=Description
|type=yes {{!}} no
|default=no
|desc=Whether GPS is enabled
}}
 
 
{{Mr-arg-table
|arg=gps-antenna-select
|type=external {{!}} internal
|default=internal
|desc=Depending on model. Can be used to select internal antenna, if device has one.
}}
 
{{Mr-arg-table
|arg=init-channel
|type=integer [0..4294967295]
|default=
|desc=Channel for init-string execution
 
}}
}}


{{Mr-arg-table
{{Mr-arg-table
|arg=
|arg=init-string
|type=string
|type=string
|default=<>
|default=
|desc=
|desc=AT init string for GPS initialization


}}
}}


{{Mr-arg-table-end
{{Mr-arg-table
|arg=
|arg=port
|type=string
|type=string
|default=""
|default=
|desc=
|desc=Name of the USB/Serial port where GPS receiver is connected
 
}}


{{Mr-arg-table-end
|arg=set-system-time
|type=yes {{!}} no
|default=no
|desc=Whether to set router's date and time to one received from GPS.
}}
}}


==Monitoring Status==


{{Note | . }}
<p id="shbox"><b>Command:</b> <code>/system gps monitor</code></p>


==Monitor==


This command is used for monitoring the data received from a GPS receiver
This command is used for monitoring the data received from a GPS receiver


Pparameters:
'''Parameters:'''
{{Mr-arg-table-h
|prop=Property
|desc=Description
}}
 
{{Mr-arg-ro-table
|arg=date-and-time
|type=date
|desc=Date and time received from GPS
}}
 
{{Mr-arg-ro-table
|arg=latitude
|type= none {{!}} string
|desc=Latitude in DM (Degrees Minute decimal) format
}}
 
{{Mr-arg-ro-table
|arg=longitude
|type=none {{!}} string
|desc=Longitude in DM (Degrees Minute decimal) format
}}
 
{{Mr-arg-ro-table
|arg=altitude
|type=none {{!}} string
|desc=Altitude based on GPS data
}}
 
{{Mr-arg-ro-table
|arg=speed
|type=none {{!}} string
|desc=Current moving speed of the GPS unit
}}
 
{{Mr-arg-ro-table
|arg=destination-bearing
|type=none {{!}} string
|desc=The direction toward which a GPS is moving
}}
 
{{Mr-arg-ro-table
|arg=true-bearing
|type=none {{!}} string
|desc=The direction toward which a GPS is moving
}}
 
{{Mr-arg-ro-table
|arg=magnetic-bearing
|type=none {{!}} string
|desc=The direction toward which a GPS is moving
}}
 
 
{{Mr-arg-ro-table
|arg=valid
|type=yes {{!}} no
|desc=
}}
 
{{Mr-arg-ro-table
|arg=satellites
|type=integer
|desc=Number of satellites seen by the device.
}}
 
{{Mr-arg-ro-table
|arg=fix-quality
|type=integer
|desc=Quality of the signal
}}
 
 
{{Mr-arg-ro-table
|arg=satellites
|type=integer
|desc=Number of satellites seen by the device.
}}
 
{{Mr-arg-ro-table-end
|arg=horizontal-dilution
|type=integer
|desc=Horizontal dilution of precision (HDOP);
}}


''Note: The time is not stratum 1 as RouterBOARD devices do not have [http://en.wikipedia.org/wiki/Pulse_per_second PPS] implemented'' as of RouterOS v6. This might change with new NTP server in v7.


==Basic examples==
==Basic examples==


Check port usage, only one instance can use serial port simultaneously
<pre>
[admin@MikroTik] /port print
Flags: I - inactive
#  DEVICE NAME                    CHANNELS USED-BY                  BAUD-RATE
0          serial0                        1 Serial Console            auto 
</pre>
In case there is one port and it is used by console, release it from console menu:
<pre>
[admin@MikroTik] > /system console print
Flags: X - disabled, U - used, F - free
#  PORT                                                                      TERM                                                                   
0 U serial0                                                                    vt102
[admin@MikroTik] > /system console disable 0 
</pre>


{{cont}}
Adjust port settings specific for your device (leave "auto" for LtAP mini)
<pre>
[admin@MikroTik] /port> set 0 baud-rate=4800 parity=odd
[admin@MikroTik] /port> print detail
Flags: I - inactive
0  name="usb1" used-by="" channels=1 baud-rate=4800 data-bits=8 parity=odd stop-bits=1 flow-control=none
</pre>
 
Enable GPS
<pre>
[admin@MikroTik] /system gps> set enable=yes port=usb1
[admin@MikroTik] /system gps> print
          enabled: yes
            port: usb1
          channel: 0
    init-channel: 0
      init-string:
  set-system-time: no
 
</pre>
 
Monitor status
<pre>
[admin@MikroTik] /system gps> monitor 
  date-and-time: jul/02/2015 14:36:08
            latitude: N 56 57' 32.262''
            longitude: E 24 9' 7.262''
            altitude: 36.700001m
                speed: 0.000000 km/h
  destination-bearing: none
        true-bearing: 0.000000 deg. True
    magnetic-bearing: 0.000000 deg. Mag
                valid: yes
          satellites: 7
</pre>
 
 
Port and GPS settings for '''LtAP'''
<pre>
/port set serial1 baud-rate=115200
</pre>
<pre>
/system gps set port=serial1 channel=0 enabled=yes
</pre>
 
We have also created an in-depth article about live GPS tracking, using scripting and a web server: [[Manual:GPS-tracking]].
 
== Troubleshooting ==
 
Note that sometimes in order to make GPS module to be recognized under RouterOS you need to change the baud-rate setting in the '/port' menu.
 
[https://mikrotik.com/product/ltap_mini LtAP mini] has low gain GPS antenna build in, for better experience we suggest using additional [https://mikrotik.com/product/acgpsa external antenna]
 
Switch between internal and external antennas under GPS menu:
<pre>
[admin@MikroTik] > /system gps set gps-antenna-select=external
</pre>


</div>
On some modems with GPS support you need to send multiple init commands for the continuous GPS monitoring, for example, for Huawei cards you need to send "AT^WPDST=1,AT^WPDGP" init string to get continuous monitoring.


[[Category:Manual|G]]
[[Category:Manual|G]]
[[Category:System|G]]
[[Category:System|G]]
{{cont}}

Latest revision as of 05:48, 21 August 2019

Version.png

Applies to RouterOS: v3, v4, v5, v6 +


Summary

Package requirement: gps
Sub-menu: /system gps
Standards: GPS, NMEA 0183, Simple Text Output Protocol

Global Positioning System (GPS) is used for determining precise location of a GPS receiver.

Configuration Properties

Property Description
channel (integer [0..4294967295]; Default: 0) Port channel used by device
coordinate-format (dd | dms | ddmm; Default: no) Which coordinate format to use, "Decimal Degrees", "Degrees Minutes Seconds" or "NMEA format DDDMM.MM[MM]"
enabled (yes | no; Default: no) Whether GPS is enabled
gps-antenna-select (external | internal; Default: internal) Depending on model. Can be used to select internal antenna, if device has one.
init-channel (integer [0..4294967295]; Default: ) Channel for init-string execution
init-string (string; Default: ) AT init string for GPS initialization
port (string; Default: ) Name of the USB/Serial port where GPS receiver is connected
set-system-time (yes | no; Default: no) Whether to set router's date and time to one received from GPS.

Monitoring Status

Command: /system gps monitor


This command is used for monitoring the data received from a GPS receiver

Parameters:

Property Description
date-and-time (date) Date and time received from GPS
latitude (none | string) Latitude in DM (Degrees Minute decimal) format
longitude (none | string) Longitude in DM (Degrees Minute decimal) format
altitude (none | string) Altitude based on GPS data
speed (none | string) Current moving speed of the GPS unit
destination-bearing (none | string) The direction toward which a GPS is moving
true-bearing (none | string) The direction toward which a GPS is moving
magnetic-bearing (none | string) The direction toward which a GPS is moving
valid (yes | no)
satellites (integer) Number of satellites seen by the device.
fix-quality (integer) Quality of the signal
satellites (integer) Number of satellites seen by the device.
horizontal-dilution (integer) Horizontal dilution of precision (HDOP);

Note: The time is not stratum 1 as RouterBOARD devices do not have PPS implemented as of RouterOS v6. This might change with new NTP server in v7.

Basic examples

Check port usage, only one instance can use serial port simultaneously

[admin@MikroTik] /port print
Flags: I - inactive 
 #   DEVICE NAME                     CHANNELS USED-BY                   BAUD-RATE
 0          serial0                         1 Serial Console            auto   

In case there is one port and it is used by console, release it from console menu:

[admin@MikroTik] > /system console print 
Flags: X - disabled, U - used, F - free
 #   PORT                                                                       TERM                                                                     
 0 U serial0                                                                    vt102 

[admin@MikroTik] > /system console disable 0  

Adjust port settings specific for your device (leave "auto" for LtAP mini)

[admin@MikroTik] /port> set 0 baud-rate=4800 parity=odd
[admin@MikroTik] /port> print detail 
Flags: I - inactive 
 0   name="usb1" used-by="" channels=1 baud-rate=4800 data-bits=8 parity=odd stop-bits=1 flow-control=none

Enable GPS

[admin@MikroTik] /system gps> set enable=yes port=usb1
[admin@MikroTik] /system gps> print 
          enabled: yes
             port: usb1
          channel: 0
     init-channel: 0
      init-string:
  set-system-time: no

Monitor status

[admin@MikroTik] /system gps> monitor  
  date-and-time: jul/02/2015 14:36:08
             latitude: N 56 57' 32.262''
            longitude: E 24 9' 7.262''
             altitude: 36.700001m
                speed: 0.000000 km/h
  destination-bearing: none
         true-bearing: 0.000000 deg. True
     magnetic-bearing: 0.000000 deg. Mag
                valid: yes
           satellites: 7


Port and GPS settings for LtAP

/port set serial1 baud-rate=115200
/system gps set port=serial1 channel=0 enabled=yes

We have also created an in-depth article about live GPS tracking, using scripting and a web server: Manual:GPS-tracking.

Troubleshooting

Note that sometimes in order to make GPS module to be recognized under RouterOS you need to change the baud-rate setting in the '/port' menu.

LtAP mini has low gain GPS antenna build in, for better experience we suggest using additional external antenna

Switch between internal and external antennas under GPS menu:

[admin@MikroTik] > /system gps set gps-antenna-select=external

On some modems with GPS support you need to send multiple init commands for the continuous GPS monitoring, for example, for Huawei cards you need to send "AT^WPDST=1,AT^WPDGP" init string to get continuous monitoring.

[ Top | Back to Content ]