Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
V0.1
Contents
1
1. FM1100 DATA PROTOCOL
Because the smallest information amount that can be written is one bit, there can be some bits left unused
when result is byte array. Any unused bits should be left blank.
Codec ID Number of Data Data Number of Data
1 Byte 1 Byte … 1 Byte
1.2 Data
1.4 Priority
0 Low
1 High
2 Panic
3 Security
2
X- Longitude1
Y- Latitude1
Altitude - In meters above sea level1
Angle - In degrees, 0 is north, increasing clock-wise 1
Satellites - Number of visible satellites1
Speed - Speed in km/h. 0x0000 if GPS data is invalid1
Longitude and latitude are integer values built from degrees, minutes, seconds and milliseconds by formula.
m s ms
d * p
60 3600 3600000
d - Degrees
m- Minutes
s - Seconds
ms - Milliseconds
p- Precision (10000000)
If longitude is in west or latitude in south, multiply result by –1. To determine if the coordinate is
negative, convert it to binary format and check the very first bit. If it is 0, coordinate is positive, if it is 1,
coordinate is negative. Example:
Received value: 20 9c ca 80
Converted to BIN: 00100000 10011100 11001010 10000000 first bit is 0, which means coordinate is
positive
Convered to DEC: 547146368For more information see two‘s compliment arithmetics.
1.6 IO element
N8 of Eight Bytes IO
N4 of Four Bytes IO
N2 of Two Bytes IO
N1 of One Byte IO
N1’th IO Value
N2’th IO Value
N4’th IO Value
N8’th IO Value
1’st IO Value
1’st IO Value
1’st IO Value
1’st IO Value
N of Total IO
N1’th IO ID
N2’th IO ID
N4’th IO ID
N8’th IO ID
Event IO ID
1’st IO ID
1’st IO ID
1’st IO ID
1’st IO ID
…
…
2 Bytes
2 Bytes
4 Bytes
4 Bytes
8 Bytes
8 Bytes
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
1 Byte
Event IO ID – if data is acquired on event – this field defines which IO property has changed and
generated an event. If data cause is not event – the value is 0.
1
If record is without valid coordinates – (there were no GPS fix in the moment of data acquisition) – Longitude, Latitude and
Altitude values are last valid fix, and Angle, Satellites and Speed are 0.
3
N - total number of properties coming with record (N=N1+N2+N4+N8)
N1- number of properties, which length is 1 byte
N2- number of properties, which length is 2 bytes
N4- number of properties, which length is 4 bytes
N8- number of properties, which length is 8 bytes
4
250 Trip 1 1 – trip start, 0 – trip stop
251 Immobilizer 1 1 – iButton connected
252 Authorized driving 1 1 – authorized iButton connected
253 Green driving type 1 1 – harsh acceleration, 2 – harsh braking, 3 - harsh cornering
Depending on green driving type: if harsh acceleration or
254 Green driving value 1 braking – g*100 (value 123 -> 1.23g), if harsh cornering –
degrees (value in radians)
255 Over Speeding 2 At over speeding start km/h, at over speeding end km/h
1.7 Example
Received data:
08090000014694820AD8000F0D13A82098D9F5008D00000D00000010060100B3004501F0001503C8000709
001FB5000FB60008422E67180000CD038BCE000102C700000000F10000601A014E00000000000000000000
014694811C90000F0D13E22098D9CA008E00000D00000010060100B3004501F0001503C8000709001DB500
11B60009422E83180000CD038BCE000102C700000000F10000601A014E0000000000000000000001469480
3230000F0D13A92098D934008F00000A00000010060100B3004501F0001503C8000709001FB50012B6000A
422E7A180000CD038BCE000102C700000000F10000601A014E000000000000000000000146947F47D0000F
0D13352098D9480091013A0C00000010060100B3004501F0001503C8000709001FB50010B60009422E8318
0000CD038BCE000102C700000000F10000601A014E000000000000000000000146947E5D70000F0D128C20
98D97F0092012A0E00000010060100B3004501F0001503C8000709001FB5000FB60008422E7A180000CD03
8BCE000102C700000000F10000601A014E000000000000000000000146947D7310000F0D121E2098D97500
9200000D00000010060100B3004501F0001503C80007090022B5000FB60008422E70180000CD038BCE0001
02C700000000F10000601A014E000000000000000000000146947C88B0000F0D11BA2098D97A009300000E
00000010060100B3004501F0001503C8000709001FB5000FB60008422E70180000CD038BCE000102C70000
0000F10000601A014E000000000000000000000146947B9E50000F0D12072098D9CA009300000D00000014
0A010002000300B300B4004501F00050001503C8000709001FB50011B60009422E67180000CD038BCE0001
03C700000000F10000601A48000000000000000146947AB3F0000F0D11E72098D982009300000D00000014
0A010002000300B300B4004501F00050001503C8000709001FB50010B60009422E70180000CD038BCE0001
03C700000000F10000601A480000000000
08 – Codec ID
09 - Number of Data (9 records)
GPS Element
IO Element
00 – IO element ID of Event generated (in this case when 00 – data generated not on event)
5
10 – 16 IO elements in record
06 – 6 IO elements, which length is 1 Byte
01 – IO element ID = 01
00 – 1’st IO element’s value = 0
B3 – IO element ID = 179
00 – 179‘th IO element’s value = 0
45 – IO element ID = 69
01 – 69’th IO element’s value = 1
F0 – IO element ID = 240
00 – 240’th IO element’s value = 0
15 - IO element ID = 21
03 – 21‘st IO element’s value = 3
C8 - IO element ID = 200
00 - 200‘th IO element’s value = 00
07 – 7 IO elements, which value length is 2 Bytes
09 - IO element ID = 9
001F – 9’th IO element’s value = 31
B5 - IO element ID = 181
000F – 181’st IO element’s value = 15
B6 - IO element ID = 182
0008 – 182’nd IO element’s value = 8
42 - IO element ID = 66
2E67 – 66’th IO element’s value = 11879
18 - IO element ID = 24
0000 – 24’th IO element’s value = 0
CD - IO element ID = 205
038B – 205’th IO element’s value = 907
CE - IO element ID = 206
0001 – 206’th IO element’s value = 1
02 – 2 IO elements, wich value length is 4 Bytes
C7 - IO element ID = 199
00000000 - 199’th IO element’s value = 0
F1 - IO element ID = 241
0000601A - 241’st IO element’s value = 24602
01 - 1 IO elements, wich value length is 8 Bytes
4E – IO element ID = 78
0000000000000000 - 78’th IO element’s value = 0
6
6’th record data
00000146947D7310000F0D121E2098D975009200000D00000010060100B3004501F000
1503C80007090022B5000FB60008422E70180000CD038BCE000102C700000000F10000601A
014E0000000000000000
7’th record data
00000146947C88B0000F0D11BA2098D97A009300000E00000010060100B3004501F000
1503C8000709001FB5000FB60008422E70180000CD038BCE000102C700000000F10000601A
014E0000000000000000
8’th record data
00000146947B9E50000F0D12072098D9CA009300000D000000140A010002000300B300
B4004501F00050001503C8000709001FB50011B60009422E67180000CD038BCE000103C700
000000F10000601A480000000000
9’th record data
00000146947AB3F0000F0D11E72098D982009300000D000000140A010002000300B30
0B4004501F00050001503C8000709001FB50010B60009422E70180000CD038BCE000103C70
0000000F10000601A480000000000
7
2. SENDING DATA OVER TCP/IP
First when module connects to server, module sends its IMEI. IMEI is sent the same way as encoding
barcode. First comes short identifying number of bytes written and then goes IMEI as text (bytes).
For example IMEI 356307046735121 would be sent as 000F333536333037303436373335313231
After receiving IMEI, server should determine if it would accept data from this module. If yes server will
reply to module 01 if not 00. Note that confirmation should be sent as binary packet.
Then module starts to send first AVL data packet. After server receives packet and parses it, server must
report to module number of data received as integer (four bytes).
If sent data number and reported by server doesn’t match module resends sent data.
Example:
Module connects to server and sends IMEI:
000F333536333037303436373335313231
Server accepts the module:
01
Module sends data packet:
8
3. SENDING DATA OVER UDP/IP
UDP channel is a transport layer protocol above UDP/IP to add reliability to plain UDP/IP using
acknowledgment packets. The packet structure is as follows:
UDP datagram
UDP channel packet x Packet length (excluding this field) in big endian byte
N Packet length 2 bytes order
Packet Type
0 Data packet requiring acknowledgment
1 Data packet NOT requiring acknowledgment
2 Acknowledgment packet
Acknowledgment packet should have the same packet id as acknowledged data packet and empty data
payload. Acknowledgement should be sent in binary format.
Acknowledgment packet
Packet length 2 bytes 0x0003
Packet id 2 bytes same as in acknowledged packet
Packet type 1 byte 0x02
AVL data are sent encapsulated in UDP channel packets (Data payload field).
9
AVL packet id (1 byte) – id identifying this AVL packet
Module IMEI – IMEI of a sending module encoded the same as with TCP
AVL data array – array of encoded AVL data
Scenario:
Module sends UDP channel packet with encapsulated AVL data packet (Packet type=1 or 0). If packet
type is 0, server should respond with valid UDP channel acknowledgment packet. Since server should respond
to the AVL data packet, UDP channel acknowledgment is not necessary in this scenario, so Packet type=1 is
recommended.
Server sends UDP channel packet with encapsulated response (Packet type=1 – this packet should not
require acknowledgment)
Module validates AVL packet id and Number of accepted AVL elements. If server response with valid AVL
packet id is not received within configured timeout, module can retry sending.
Example:
Module sends the data:
10
4. SENDING DATA USING SMS
AVL data or events can be sent encapsulated in binary SMS. TP-DCS field of these SMS should indicate
that message contains 8-bit data (for example: TP-DCS can be 0x04).
SM data (TP-UD)
AVL data array IMEI: 8 bytes
11
5. 24 POSITION SMS DATA PROTOCOL
24-hour SMS is usually sent once every day and contains GPS data of last 24 hours. TP-DCS field of this
SMS should indicate that message contains 8-bit data (i.e. TP-DCS can be 0x04).
Note, that 24 position data protocol is used only with subscribed SMS. Event SMS use standard AVL data
protocol.
5.1 Encoding
To be able to compress 24 GPS data entries into one SMS (140 octets), the data is encoded extensively
using bit fields. Data packet can be interpreted as a bit stream, where all bits are numbered as follows:
Bits in a byte are numbered starting from least significant bit. A field of 25 bits would consist of bits 0 to
24 where 0 is the least significant bit and bit 24 – most significant bit.
5.2 Structure
The time of only the first GPS data element is specified in Timestamp field. Time corresponding to each
further element can be computed as elementTime = Timestamp + (1 hour * elementNumber).
12
GPSDataElement
Size Field Description
(bits)
1 ValidElement ValidElement=1 – there is a valid GpdDataElement
following,
ValidElement=0 – no element at this position.
1 DifferentialCoords Format of following data.
14 LongitudeDiff Difference from previous element‘s longitude.
== 1
DifferentialCoords
When decoding GPS data with DifferentialCoords=1, Latitude and Longitude values can be computed as
follows: Longitude=prevLongitude – LongitudeDiff + 213 – 1, Latitude=prevLatitude – LatitudeDiff + 213 – 1.
If there were no previous non-differential positions, differential coordinates should be computed assuming
prevLongitude=prevLatitude=0.
When Longitude and Latitude values are known, longitude and latitude representation in degrees can be
computed as follows:
13
6. CHANGE LOG
00412
New
Nr. Date version Comments
number
1 140613 0.1 File created
14