GPS

Print version

GPS protocol for MORSE

version 7.45

2/27/2007

1. Introduction

The GPS receiver processes position signals from the satellite. It uses these signals to determine the time and location on the earth’s surface (latitude and longitude, altitude). Data from the GPS can be used for active monitoring of vehicles, for example, by transmitting data from the vehicle to the control centre in designated time intervals.

Data from the GPS can be processed in various modes. According to the type of processing other information is enclosed with the information from the GPS, and according to the set criteria packets are produced which are sent to the MORSE network.

2. Data Format

The datagram begins with the “Type of RF message”, which can take on various values.

0x06

GPS BASIC, coordinate, speed

0x05

connection to GPS on RS232 interrupted

0x07

GPS RSS, coordinate, Base, RSS

0x08

GPS REC, transmission via recorder

0x00

obsolete – GPS BASIC old

0x01

obsolete – replaced by type 0x08

0x02

obsolete – replaced by type 0x08

0x03

obsolete – replaced by type 0x04

0x04

obsolete – replaced by type 0x05

Only updated used types are described herein.

2.1. GPS BASIC

Datagram for transmission of basic information from the GPS protocol to the control centre.

Type of RF message:

0x06

Length of packet:

16 byte

Parameter (p)eriod:

(p) > 0, on

(m)ode:

(M) MOBILE/RSS/TIME

Packet format:

|type/8|fix/2|sec/6|lat/32|lon/32|speed/8|azimuth/8|status/16|height/16|

Meaning of items:

type - 1 byte - type of RF message = 0x06
fix  - 2 bits – type of information about position
       00 – not fixed
       01 – is fixed 2D, there is no differential correction
       10 - is fixed 2D, there is differential correction
       11 - is fixed 2D, no information about dif. correction
sec  - 6 bits – seconds in a running minute
lat  - 4 bytes – latitude in 1/100000 of a minute,  
       MSB = 0 means N - north
             1 means S – south
lon  – 4 bytes – longitude in 1/100000 of a minute,  
       MSB = 0 means E – east
             1 means W - west
speed   - 1 byte – speed in km/h (max 255) 
azimuth - 1 byte – azimuth in 1/256 of a circle
status  - 2 bytes - MSByte, LSByte - car status 
   MSByte contains information about the state of inputs of the connected
   unit MTS, SEP, ADIO
          0x03 – example - ADIO inputs DI0 and DI1 are in the ON state
   LSByte contains in its LSBit info about the state of the RTS signal
          0x00 - RTS = log 1 (-5 to -15V) or is disconnected
          0x01 - RTS = log 0 (+5 to +15V)
height  - 2 byte – altitude in units of 0.1 m, range 0...6500m,
          0xFFFF = not fixed in 3D mode

2.2. Lost Connection

Loss of GPS connection.

Type of RF message:

0x05

Length of packet:

1 byte

Parameter (p)eriod:

(p) > 0, no influence on frequency the message

(m)ode:

(M) MOBILE/RSS/TIME

Packet format:

|type/8|
type – 1 byte - type of RF message = 0x05

A message is sent to address (d)st when there is a loss of the connection between port SCC and GPS.

2.3. GPS RSS

Datagram for measuring coverage of the territory by the radio signal.

Type of RF message:

0x07

Packet length:

16 byte

Parameter (P):

(P) > 0, on

(m)ode:

(M) MOBILE/RSS/TIME

|type/8|fix/2|sec/6|lat/32|lon/32|base/32|res/8|RSS/8|

Meaning of items:

type – 1 byte - type of RF message = 0x07
fix  - 2 bits – type of information about position
       00 – not fixed
       01 – is fixed 2D, there is no differential correction
       10 - is fixed 2D, there is differential correction
       11 - is fixed 2D, no information about differential correction
sec  - 6 bits  – second in a running minute
lat  - 4 bytes – latitude in 1/100000 of a minute,  
       MSB = 0 means N - north
             1 means S – south
lon  – 4 bytes – longitude in 1/100000 of a minute,  
       MSB = 0 means E - east
             1 means W - west
base - 4 byte – address of base station used
res  - 1 byte - reserve
RSS  - 1 byte - RSS (-dBm)( Received Signal Strength) – strength of base
       station signal

Items fix, sec, lon, lat are zero in the case of a loss of GPS connection.

2.4. GPS REC

Datagram for transmission of basic information from the GPS protocol to the control centre using the Recorder function. It only works in the K firmware module.

Type of RF message:

0x08

Packet length:

34 byte

Parameter (p)eriod:

(p) > 0, on

(m)ode:

(m) MOBILE+REC/RSS/TIME

Packet format – first 20 bytes is public, others “proprietary” i.e. can be changed later:

|type/8|fix/2|sec/6|lat/32|lon/32|speed/8|azimuth/8|status/16|height/16|
|gmt/32|ft/32|no/32|base/32|DQ/8|RSS/8|

Meaning of items:

type – 1 byte - type of RF message = 0x06
fix  - 2 bits – type of information about position
       00 – not fixed
       01 – is fixed 2D, there is no differential correction
       10 - is fixed 2D, there is differential correction 
       11 – is fixed 2D, no information about differential correction
sec  - 6 bits  – second in a running minute
lat  - 4 bytes – latitude in 1/100000 of a minute,  
       MSB = 0 means N - north
             1 means S – south
lon  – 4 bytes – longitude in 1/100000 of a minute,  
       MSB = 0 means E - east
             1 means W - west
speed   - 1 byte  – speed in km/h (max 255) 
azimuth - 1 byte  – azimuth in 1/256 of a circle
status  - 2 bytes - MSByte,LSByte - car status 
   MSByte contains information about the status of inputs of the connected
   unit MTS, SEP, ADIO
          0x03 – example - ADIO inputs DI0 and DI1 are in the ON state
   LSByte contains information about the status of the CU:

   |res/11|st_cold/1|st_gps/1|st_rf/1|st_pwr/1|st_rts/1|

   res:     0 - reserve   
   st_cold: 0 – normal status
            1 - COLD START performed (POWER ON)
   st_gps:  0 – GPS connection working
            1 – GPS connection interrupted
   st_rf:   0 – mobile connection working
            1 – mobile connection interrupted
   st_pwr:  0 – supply from network
            1 – supply from batteries
   st_rts   0 - RTS = log 1
            1 - RTS = log 0

height  - 2 bytes – altitude in units of 0.1 m, range 0...6500m,
          0xFFFF = not fixed in 3D mode
gmt     - 4 bytes - ordinary time in seconds elapsed 
          since 00:00:00 GMT, 1st Jan. 1970
ft      - 4 bytes - format time - GMT, when the recorder was formatted,
          serves for identifying the recorder
no      - 4 bytes - sequence number of the record in the recorder
base    - 4 bytes – address of base station used
DQ      - 1 byte - data quality – quality of base station signal
RSS     - 1 byte - RSS (-dBm)( Received Signal Strength) – strength 
          of base station signal

Items fix, sec, lon, lat are zero in the case of a loss of the GPS connection.

The last 20 records of the recorder can be viewed using command “iR0”. Records have a length of 20bytes (type….gmt), and only on sending to the MORSE network are they supplemented with the remaining 14bytes.

2.5. GPS BASIC old

Datagram similar to GPS BASIC, however shorter by the item height/16 and reacts differently on a loss of GPS signal. Not recommended for use.

Type of RF message:

0x00

Packet length:

14 byte

Parameter (p)eriod:

(p) > 0, on

(m)ode:

(o) mobile/obsolete

Packet format:

|type/8|fix/2|sec/6|lat/32|lon/32|speed/8|azimuth/8|status/16|

3. Implementation in Morse

Data from the GPS is transferred via the serial port to the protocol and this then sends datagrams to the MORSE network according to the selected mode. Examples of these diagrams are given below.

3.1. GPS BASIC and GPS RSS

This example introduces both modes. Most applications only use the GPS BASIC mode.

A GPS BASIC datagram containing information about coordinates and height is sent to address (d)st:690F80AAh with period (p):10s. GPS does not move because data about speed is zero and azimuth contains a random number.

A GPS RSS datagram containing information about coordinates, about the address of the current base station 690F8101 and the strength of the signal RSS=0x55 which is 85dec, is sent to address RSS (D)st:690F80BBh.

12:50:11.000|                 |690F80AA 690F8011|S02I   OUT  16| 09 0user
064A 11BA 20A0 05BF F5E0 009A 3F00 1876
12:50:15.000|                 |690F80BB 690F8011|S02I   OUT  16| 09 0user
074E 11BA 208C 05BF F5D6 690F 8101 1E55

Item 0x3F00 “status” contains data sent from the connected device MTS, SEP or ADIO module. One of these devices is connected, for example to the adjacent node and its destination address is the same as the node determined for the GPS. The GPS protocol includes this received data into the GPS BASIC datagram and sends it together with the message about position to address (d)st. The example 0x3F corresponds to the status when digital inputs DI0 to DI5 on SEP are in the ON state and inputs DI6 and DI7 are in the OFF state. The lowest bit “0” of item 0x3F00 comes from the RTS signal on the GPS serial port. Corresponds to the status where the RTS conductor is disconnected or in the ON state, i.e. log 1. Putting in the OFF status, e.g. by connecting with the adjacent CTS conductors would change the status to 0x3F01.

3.2. Loss of communication with GPS

Loss of the GPS connection on the serial port is reported to the centre. Message “05” is sent to address (d)st:690F80AAh in place of the GPS BASIC datagram. This is first sent 3 seconds after the loss of the GPS connection, and then every 60 seconds.

A datagram containing zeros in place of coordinates is sent to address RSS (D)st:690F80BBh with a period of (P):10s

12:49:05.000|                 |690F80AA 690F8011|S02I   OUT   1| 09 0user
05
12:49:05.000|                 |690F80BB 690F8011|S02I   OUT  16| 09 0user
0700 0000 0000 0000 0000 690F 8101 1E55

3.3. GPS REC

Transmission with recorder support can be used in the case where the mobile radio connection to the centre is interrupted from time to time. The recorder is part of the memory in the radio modem, to which datagrams from the GPS protocol are written. From there they are then transferred to the radio network. If the radio connection is interrupted datagrams are only stored in the recorder. After the connection is renewed they are then sent to the centre. This operation in the centre is managed by the A-GPS daemon. The modem must contain fw module K.

Below is an example of a datagram under normal operation:

11:25:47.004|                 |690F80AA 690F8011|S00I   OUT   34| 09 3user
0840 11BA 20AA 05BF F69E 00FF 0000 1886 41E6 4CAA 41E6 2D60 0000 0471 
690F 8101 1E47

Loss of radio connection:

12:55:54.004|                 |690F80AA 690F8011|S00I   OUT   34| 09 4user
0840 11BA 138A 05BF F3BA 00F4 0004 15E9 41E6 61C9 41E6 2D60 0000 0BDC
0000 0000 00FF

In the datagram bit “st_rf” = 1 is set in the 7th word, 0x0004, and the base station address is zero. Datagrams are generated, stored in the recorder, and transferred to the node, however they are not sent over the radio channel.

Loss of GPS connection:

14:13:28.014|                 |690F80AA 690F8011|S00I   OUT   34| 09 0user
0800 0000 0000 0000 0000 0000 0008 0000 41E6 73F8 41E6 2D60 0000 0F6D 
690F 8022 1D3C

Bit “st_gps” = 1 in the 7th word, 0x0008, coordinates are zero. Only 1 datagram is generated.

3.4. Transparent Transmission

Example of data received via port SCC2 from the GPS, displayed in ASCII code:

08:44:52.099 rx;i  129 | S02
$GPRMC,074452,V,4934.1067,N,01604.6597,E,000.0,000.0,131204,002.2,E*60
$GPGGA,074452,4934.1067,N,01604.6597,E,0,00,,,M,,M,,*59

Transparent datagram sent to address (A)tra dst:690F80CCh for parameter N(M)EA:GPRMC, displayed in ASCII:

08:44:52.100|                 |690F80CC 690F8011|S02I   OUT   73| 09 2user
$GPRMC,074452,V,4934.1067,N,01604.6597,E,000.0,000.0,131204,002.2,E*60

4. Configuration Parameters

GPS parameters:
h(w) type:GARMIN
(m)ode:MOBILE/RSS/TIME
(c)orr. mode:OFF
(t)ime sync:OFF

(d)st:690F80AAh  (p)eriod:10s  d(i)stance:0*100m
TX (f)ix only:ON
(r)egion of interest:OFF
(W):0  (N):0
(E):0  (S):0

RSS (D)st:690F80BBh  (P):10s
(A)tra dst:00000000h (a)tra period:0s  N(M)EA:        
(G)ps state  o(b)solete stuff
(q)uit
>>

Meaning of individual parameters:

h(w) type:GARMIN – Selection of type of connected GPS
  (G) GARMIN
  (M) MOTOROLA

(m)ode:MOBILE/RSS/TIME  - protocol operating mode
  (M) MOBILE/RSS/TIME          - basic mode, generates GPS BASIC datagrams
  (m) MOBILE+REC/RSS/TIME      - gen. datagrams GPS REC, only for module K
  (T) CORR. SOURCE TRANSPARENT – receipt of data from correction source,
                                 transparent.
  (R) CORR. SOURCE RTCM        - receipt of data from correction source,
                                 RTCM mode
  (o) mobile/obsolete          - generates GPS BASIC old datagrams
  (O) OFF

(c)orr. mode:OFF – use of corrections in the target GPS
  (O) OFF - off
  (T) CORR. TARGET TRANSPARENT - on, transparent
  (R) CORR. TARGET RTCM        - on, RTCM mode

(t)ime sync:OFF – synchronisation of the internal clock of the modem
                  according to the GPS signal
  o(n)  - on
  o(f)f - off

Parameters for sending information about the position:

(d)st:690F80AAh   - destination address
(p)eriod:10s      - period of sending messages, (p):0 stops transmitting
d(i)stance:0*100m – after inserting a nonzero value messages about 
                    a change of GPS position by the selected distance 
                    are also generated.

Transmitting these messages is influenced by (r)egion and (f)ix parameters and the GPS connection:

TX (f)ix only:ON – a message is only sent to the (d)st address under the
   condition, that the GPS caught the necessary data, "is fixed"
   o(n)  - on
   o(f)f - off

(r)egion of interest: - a message is only sent to the (d)st address under
   the condition, that the resulting coordinate lies inside the rectangle
   (W),(E),(N),(S), it is used for filtering out erroneous coordinates 
   o(n)  - on
   o(f)f - off
(W):0 - West  - west edge of area
(E):0 - East  - east
(N):0 - North – north
(S):0 - South – south
      - edge of area "(r)egion of interest" in units 1/100000 of a minute,
        Western longitude is expressed as a negative number,
        Southern latitude is expressed as a negative number

An example of defining an area 12deg to 19deg eastern longitude and 48deg to 51deg northern latitude (Czech Republic):

(r)egion of interest:ON
(W): 72000000  (N):306000000
(E):114000000  (S):288000000                 ...48 x 6000000 = 288000000

Parameters for transmitting messages about the position and the strength of the signal from the CU Base:

RSS (D)st:690F80BBh – target address 
(P):10s             - period of transmitting messages, (P):0 stops
                      transmitting

Parameters for transmitting transparent data:

(A)tra dst:00000000h – destination address 
(a)tra period:0s     - period of sending messages,(a):0 stops transmitting
N(M)EA: first 5 ASCII characters of the required part of the message.

For example, if communication GPS -> CU looks as follows:

09:32:29.459 rx;i  141 | S02
$GPRMC,083229,A,4934.1109,N,01604.6641,E,000.0,167.5,101204,002.2,E*72
$GPGGA,083229,4934.1109,N,01604.6641,E,1,05,4.2,635.1,M,44.2,M,,*45

We can insert GPGGA characters into parameter M:

N(M)EA:GPGGA

and then the second part of the message is sent transparently in hexadecimal format to address (A)tra.

(G)ps state – auxiliary parameters for GPS:

Gps state:
(s)tatus
GARMIN:
(d)isable all
(9)600
(e)nable selected sentences
(r)eset unit
(q)uit
>>

(s)tatus – information about the status of GPS:
>>GPS status:

NSat:5                  - number of intercepted satellites
Fix:1                   - 1 = fixed, 0 = no
lon:16.077715deg        - longitude, degrees
lat:49.568445deg        - latitude, degrees
alt:621.300000m 3Dfix:1 – altitude, fixed for 3D
speed:0.000000km/h      - speed between the last two points
azimuth:355.600000deg   - direction between the last two points
UTC:2006-2-21 11:58:19  - GMT
vstat:0000              - auxiliary data about the status of the vehicle,
   same as "status" in GPS BASIC packet

Other parameters are only determined for development purposes.

(d)isable all
(9)600
(e)nable selected sentences
(r)eset unit

5. History

This description is valid from version fw704, detailed arrangement of the protocols parameters from fw745. Datagrams with the recorder are tested in version K673.