0% found this document useful (0 votes)
53 views

VG01 Protocol 220403

This document describes a communication protocol between a server and connected devices. It includes packet formats for commands from the server to devices like roll call, setting timing intervals, and disabling alarms or engines. It also includes packet formats for responses from devices to the server like location data, roll call responses, and answer data. Formats specify packet headers, lengths, checksums, and terminators. Parameters set intervals in seconds or kilometers per hour. The protocol provides remote control and data exchange between servers and monitored devices.

Uploaded by

marouen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

VG01 Protocol 220403

This document describes a communication protocol between a server and connected devices. It includes packet formats for commands from the server to devices like roll call, setting timing intervals, and disabling alarms or engines. It also includes packet formats for responses from devices to the server like location data, roll call responses, and answer data. Formats specify packet headers, lengths, checksums, and terminators. Parameters set intervals in seconds or kilometers per hour. The protocol provides remote control and data exchange between servers and monitored devices.

Uploaded by

marouen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

VG01

COMMUNICATION
PROTOCOL

VERSION: V1.0

1
CONTENTS

I. EXPLAIN THE CONCEPT OF GLOSSARY ........................................................................................................... 3 

Communication Channel........................................................................................................... 3 
Packet head、Packet end .......................................................................................................... 3 
Packet length ............................................................................................................................. 3 
Verify(XOR) ........................................................................................................................ 3 
Pseudo Ip address ...................................................................................................................... 3 

II. SERVER TO DEVICE ............................................................................................................................................... 3 

Rollcall-30 .............................................................................................................................. 3 
Timing interval-34 .................................................................................................................. 4 
Stop the alarm-37 ................................................................................................................... 4 
Enable engine-38 .................................................................................................................... 5 
Disable engine-39 ................................................................................................................... 5 
Set Overspeed threshold-3F ................................................................................................... 5 
Reset the mileage—6B.............................................................................................................. 5 
Change time zone—6C ............................................................................................................. 6
Remote update—AA ................................................................................................................. 6 

III. SERVER TO DEVICE .............................................................................................................................................. 6 

GPRS data echo instruction-21 .............................................................................................. 6 

IV. FROM DEVICE TO SERVER ................................................................................................................................. 7 

Heart beat packet function 99 ................................................................................................... 7 


Position data-80 ...................................................................................................................... 7 
The return of rollcall-81 ......................................................................................................... 9 
Alarm data-82 ......................................................................................................................... 9 
Device’s answer data-85 ....................................................................................................... 10 
The blind area data of GPRS-8E .......................................................................................... 10 

APPENDIX ...................................................................................................................................................................... 11 

2
I. Explain the concept of glossary
Communication Channel
The device communicate with the server on TCP channel.
Packet head、Packet end
The packet head menas the beginning of the data stream.
The packet end means the end of the data sream.

Packet length
Packet length means the length of the data content,It is from the next byte of the packet length until the packet
end.
Explain:The packet length in some of the example of this protocol may be wrong,please according to this
algorithm.

Verify(XOR)
From the packet head of the data stream XOR with the next byte,until the previous byte of the calibration byte

Pseudo Ip address
Using specfic algorithm change the SIM card number to Pseudo IP address,the algorithm in Appendix C

II. Server to device


Rollcall-30
[Function] force the device to upload the newest location immediately, device will reply with command
81.
[Direction] from server to device
[Format]
24 24 30 00 06 0D

Packet head Main order Packet length Pseudo IP calibration Packet end
Address
For
example:
Self number: 13512345005
Platform sent:
24 24 30 00 06 0C A2 32 85 2F 0D 24 24 21 00 05 CB 81 00 6E 0D
Device feedback:
24 24 81 00 23 0C A2 32 85 10 03 06 14 59 07 02 23 46 90 11 35 29 47 00 00 00 00 C0 40 01 01 2C 0E 11 00
00 00 21 CB 0D

24 24 30 00 06 0C A2 32 85 2F 0D is the command sent for calling the roll


30 is main signaling of rollcall
00 06 is the length of the package
0C A2 32 85 2F 0D,
The 0C A2 32 85 is the pseudo IP translated by self number
0D is the terminator

24 24 21 00 05 CB 81 00 6E 0D is the response of platform when getting the datum of coordinates

3
21 is responding to main signaling
00 05 is the length
CB is checksum the data of rollcall
81 and 00 is corresponded to main signalling and sub-signalling
6E is checksum
0D is the terminator

24 24 81 00 23 0C A2 32 85 10 03 06 14 59 07 02 23 46 90 11 35 29 47 00 00 00 00 C0 40 01 01 2C 0E 11 00
00 00 21 CB 0D is the data responded to the rollcall

24 24 tip binding
81 main signalling
00 23 length
0C A2 32 85 is the pseudo IP translated by self number
10 03 06 14 59 07 02 23 46 90 11 35 29 47 00 00 00 00 C0 40 01 01 2C 0E 11 00 00 00 21 is the location
information of device
CB checksum
0D terminator

Timing interval-34
[Function] Modify the timing interval of the position data sending, device will reply with command
85.
[Direction] from server to device
[Format]

24 24 34 00 06 0D
Packet Main Packet Pseudo IP Parameter1 Parameter Parameter calibration Packet
head order length Address 2 3 end

[Instruction explanation]
Parameter1:double byte,hexadecimal form,means the ACC on time horizon(form 1 second to 18.2 hours).
Parameter2:double byte,hexadecimal form,means the ACC off time horizon(from 1 second to 18.2 hours).
Parameter3:single byte(choosing)when close the heartbeat functio,this instruction doesn’t include the
parameter 3 the packet length is 0x0A,the heartbeat time is 31 seconds or 61 seconds or 91
seconds.

Stop the alarm-37


[Function] suspend the device to upload the same kinds of alarm, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 37 00 06 0D
Packet head Main order Packet length Pseudo IP calibration Packet end
Address
4
Enable engine-38
[Function] control the relay to enable the engine, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 38 00 06 0D
Packet head Main order Packet length Pseudo IP calibration Packet end
Address

Disable engine-39
[Function] control the relay to disable the engine, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 39 00 07 0D
Packet head Main order Packet length Pseudo IP calibration Packet end
Address

Set Overspeed threshold-3F


[Fnction] set the overspeed alarm threshold, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 3F 00 7 0D
Packet head Main order Packet length Pseudo IP Setting value calibration Packet end
Address

[Instruction explantion]
 Setting value is the upper limit threshold value of the overspeed alarm,when the setting value
is 0,the overspeed alarm function is closed(form 0 to 255 km/hour)single byte, hexadecimal
form.
Reset the mileage—6B
[Function] reset the mileage from device, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 6B 00 06 XOR 0D
Packet head Main order Packet length Pseudo IP parameter calibration Packet end
Address
5
[instruction explanation]
parameter:the value of the mileage(unit:km)
Change time zone—6C
[Function] change time zone, device will reply with command 85.
[Direction] from server to device
[Format]

24 24 6C 00 08 XOR 0D
Packet head Main order Packet length Pseudo IP parameter calibration Packet end
Address

[instruction explanation]
Parameters:
Issue th differential value based on GMT, (unit: hours:minutes, )
remarks:
minute follows hour, the high order of hour is to decide whether plus or minus, if the high order is O, it means
the timezone should be adjust as GMT+time parameters
e.g.:
the 8 area east: parameters is 0x08 0x1E, current time= GMT+8hours30minutes

the 11 area west: parameters is 0x8b 0x30, current time=GMT-11hours 48minutes

III. Server to devices


GPRS data echo instruction-21
[Function] The center send the “link confirm instruction” to the device when received the linkage
information of the vehicle。
[Direction] server to the device
[Format]
24 24 21 00 05 0D
Packet head Main order Packet length Calibration Main order Sub-order calibration Packet end
value

[Instruction explanation]
 Calibration value: It is the value of the return data of the vehicle.(1 byte)
 Main order:It is the main order of the return data of the vehicle (1 byte);
Sub-order:It is the slave order of the return data of the vehicle (1 byte);

6
IV. From device to server
Heart beat packet function 99
[Function] keep the connection with server alive, server should reply with command 21.
[Direction] from device to server
[Format]

24 24 99 00 06 0D
Pseudo IP calibration
Packet head Main order Packet length Packet end
Address

Position data-80
[Function] device report location to the server, server should reply with command 21.
[Direction] from device to server
[Format]
24 24 80 00 23 (33Byte) 0D
Pseudo IP
Packet head Main order Packet length Position data calibration Packet end
Address

[instruction explanation]
 Position data form

04 12 12 08 12 00
Date &Time latitude longitude speed direction position I/O Ignition GSM Voltage mileage
angle Signal

Date &Time form:


Date range:the latter two bit of the year ;month,1-12;day,1-31
Example:2009/10/3 09 10 03
Time range: hour,00——23;minute,00——59;second,00——59
hour、minute、second is BCD。
[example]: ten minutes to eight:
07H,50H,00H
Latitude:
latitude range: 00.000 minute 0 degree——59.999 minutes 89 degrees ;
Data form is BCD form,but the highest bit is sign bit 。 “positive”means“north latitude” ,
“negative”means“south latitude”;
[example]: Latitude 37.901 Minutes 30 Degrees south:
3H,03H,79H,01H
Longitude:
longitude form: 00.000 minute 0 degree——59.999 minutes 179 degrees;
Data form is BCD form,but the highest bit is sign bit 。 “positive”means“east longitude” ,
“negative”means“west longitude”;
[example]: Longitude 45.608 Minutes 130 Degrees west
13H,04H,56H,08H
Speed form:
speed range: 0——9999km/hour
7
data form is BCD form。
[example]: 120km/hour:
01H,20H
direction angle form:
rang:000——359 degree
data form is BCD form, Due north is 0 degrees, clockwise counts。
unit:degree。
[example]: 154 degree:
01H,54H
position status:
position status is a single byte:
D7 D6 D5 D4 D3 D2 D1 D0

D7 Mark flag
0 Not locate
1 Locate

D6 Differential positioning
0 no
1 yes

D5 D4 introduction
X X reserved

D3 D2 D1 D0 satellite
0 0 0 0 range:0—15

1 1 1 1

I/O status:

D7
D6 1:default system use
D5 No load or full load examination(1:full 0:no)
D4 Antenna short(0,normal,<> 0 short)
D3 Antenna open(0,normal,<> 0 open)
D2 Air conditioning examination(0:open 1:close)
D1 Break-in examination(0:open 1:close)
D0 Low voltage examination(0:open 1:close)(G-sensor
version)

Ignition:
1:Ignition on 0:Igntion off

8
AD Data=GSM signal&Voltage (double byte Hexadecimal form )
The first 2 bytes are GSM signal, the latter two are voltage value.
Example: 50 ohm is 01F4
Example: 0000H is 0 V; 0B3AH is 11.58 V
Voltage conversion step:
1. The 16 bits of the first two byte were changed to the interger of the voltage.
2. The last two bytes were change to decimal.
Mileage:
The current mileage of the vehicle.unit:m/s
The return of rollcall-81
[Function] device reply to command 30 from the server for reporting new location , server should
reply with command 21.
[Direction] from device to server
[Format]

24 24 81 00 23 (33Byte) 0D
Pseudo IP
Packet head Main order Packet length Position data calibration Packet end
Address

Alarm data-82
[Function] Terminal send the alarm data, server should reply with command 21. and then reply with
command 37.
[Direction] from device to server
[Format]

24 24 82 00 25 (33Byte) 0D
Packet Main Packet Pseudo IP Position data Alarm data calibration Packet end
head order length Address

[Instruction explanation]
Alarm data(dobule Hexadecimal byte)
The first byte
D7 D6 D5 D4 D3 D2 D1 D0

D7 Lower Temperature Alarm (not support)


D6 Fuel Down Alarm (not support)
D5 Harsh Acceleration Alarm
D4 ACC ON Alarm
9
D3 ACC OFF Alarm
D2 Upper Temperature Alarm (not support)
D1 Overtime Driving alarm
D0 Harsh Braking Alarm

The second alarm data


D7 D6 D5 D4 D3 D2 D1 D0

D7 Refueling Alarm (not support)


D6 Reserve
D5 Vibration Alarm
D4 Sharp Cornering Alarm
D3 External Power Disconnected Alarm
D2 Parking Alarm
D1 Overspeed Alarm
D0 Emergency Alarm

1:alarm
0:no alarm

Device’s answer data-85


[Function] The terminal send the command from server, server no need to reply to command 85.
[Direction] from device to server
[Format]

24 24 85 00 0B (5Byte) 0D
Packet Main Packet Pseudo IP Answer calibr Packe
head order length Address data ation t end

[Instruction explantion]
 The format of return data

Main Slave Success or reserved


order order failure

 Main order (single byte)( Hexadecimal)


 Slave order (single byte)( Hexadecimal)
 Success or failure BCD code 1 success 0 failure

The blind area data of GPRS-8E


[Function] When the GPRS signal is not connected,the position data was stored,when the GPRS
signal is connecte,the terminal send the stored data to the server.
[Direction] from device to server
[Format]
10
24 24 8E 00 23 (24Byte) 0D
Packet head Main order Packet length Pseudo IP Position data calibration Packet end
Address

Appendix

How to change the SIM cand number to pseudo IP address


Method:
1. Cut off the first bit of the SIM card number
Example 13512345006 ,cut off the first bit is 3512345006
2. Get 5 froup number from the 10 number
Example: get 35 12 34 50 06 from 3512345006
3. Take the latter four numbers of this group,and change them in to binary form
Example:
a) The latter four numbers of group of 35 12 34 50 06 is 12 34 50 06
b) The binary of 12 is 00001100
c) The binary of 34 is 00100010
d) The binary of 50 is 00110010
e) The binary of 06 is 00000110
f) So the group number is 01100 00100010 00110010 00000110
4. Get the first froup number in second step and subtract 30,then change it into binary,at last add it in to the
four number separately which from the third step
a) The first number of 35 12 34 50 06 is 35
b) 35 – 30 = 5
c) The binary of 5 is 0101
d) Use the first number of third step,then adds 0 on the top digit(0 is the first bit of the 5 which is
binary),at last get 00001100, change 00001100 to decimal is 12.
e) Use the second number of third step,then adds 1 on the top digit(1 is the second bit of the 5 which is
binary),at last get 10100010, change 10100010 to decimal is 162.
f) Use the third number of third step,then adds 0 on the top digit(0 is the third bit of the 5 which is
binary),at last get 00110010, change 00110010 to decimal is 50
g) Use the fourth number of third step,then adds 1 on the top digit(1 is the fourth bit of the 5 which is
binary),at last get 10000110, change 10000110 to decimal is 134
5. Get the Pseudo IP Address
The Pseudo IP Address of 13512345006 is 12.162.50.134

Here I give you a example to tell you how to reply the command data from device, this is the data that you
received:
24 24 80 00 25 37 E3 00 A0 13 01 18 07 28 35 02 41 71 15 05 43 86 88 00 00 00 00 C0 47 00 07 A8 19 28 01
16 A0 1D 00 FF E2 0D

Header: 24 24
Main order: 80
11
Length: 00 25
Pseudo IP address: 37 E3 00 A0
Date: 13 01 18
Time: 07 28 35
Latitude: 02 41 71 15
Longitude: 05 43 86 88
Speed: 00 00
Angle: 00 00
GPS status: C0
Detection setting status: 47
Ignition status: 00
Oil resistance: 07 A8
Voltage: 19 28
Mileage(meter): 01 16 A0 1D
Temperature: 00 FF
Calibration: E2
Footer: 0D

Software should reply:


24 24 21 00 05 E2 80 00 46 0D
Header: 24 24
Main order: 21
Length: 00 05
Calibration of the receiving data: E2
Main order of the receiving data: 80
Slave order of the receiving data (if no such byte in receiving data, please use 0x00): 00
Calibration: 46
Footer: 0D

Here I give you some function in C# to help you parse the data:

/// <summary>
/// Convert Pseudo IP address to System No
/// </summary>
/// <param name="ip"> Pseudo IP address, if you receive 0x37, 0xE3, 0x00, 0x A0, then please give
param value55.227.0.160</param>
/// <returns>System No</returns>
public string IPToNumber(string ip)
{
long iHight = 0;
string sTemp = null;
try
{
string[] sIp = ip.Split(new char[] { '.' }, 4);
byte[] bSimNo = new byte[sIp.Length];
for (int i = 0; i < bSimNo.Length; i++)

12
{
bSimNo[i] = Convert.ToByte(sIp[i]);
}
if ((bSimNo[0] & 0x80) != 0)
{
iHight = iHight + 8;
}
bSimNo[0] = Convert.ToByte(bSimNo[0] & 0x7F);
if ((bSimNo[1] & 0x80) != 0)
{
iHight = iHight + 4;
}
bSimNo[1] = Convert.ToByte(bSimNo[1] & 0x7F);
if ((bSimNo[2] & 0x80) != 0)
{
iHight = iHight + 2;
}
bSimNo[2] = Convert.ToByte(bSimNo[2] & 0x7F);
if ((bSimNo[3] & 0x80) != 0)
{
iHight = iHight + 1;
}
bSimNo[3] = Convert.ToByte(bSimNo[3] & 0x7F);
sTemp = "1" + Convert.ToString(30 + iHight) + bSimNo[0].ToString("00")
+ bSimNo[1].ToString("00") + bSimNo[2].ToString("00") + bSimNo[3].ToString("00");
}
catch
{
sTemp = null;
}
return sTemp;
}

/// <summary>
/// Convert System No to Pseudo IP address
/// </summary>
/// <param name="sim">System No, for example: 13555990032</param>
/// <returns> Pseudo IP address</returns>
public string NumToIp(string sim)
{
string[] Temp = new string[4];
int iHigt;
switch (sim.Length)
{
case 11:
Temp[0] = sim.Substring(3, 2);

13
Temp[1] = sim.Substring(5, 2);
Temp[2] = sim.Substring(7, 2);
Temp[3] = sim.Substring(9, 2);
iHigt = Convert.ToInt32(sim.Substring(1, 2)) - 30;
break;
case 10:
Temp[0] = sim.Substring(2, 2);
Temp[1] = sim.Substring(4, 2);
Temp[2] = sim.Substring(6, 2);
Temp[3] = sim.Substring(8, 2);
iHigt = Convert.ToInt32(sim.Substring(0, 2)) - 30;
break;
case 9:
Temp[0] = sim.Substring(1, 2);
Temp[1] = sim.Substring(3, 2);
Temp[2] = sim.Substring(5, 2);
Temp[3] = sim.Substring(7, 2);
iHigt = Convert.ToInt32(sim.Substring(0, 1));
break;
default:
switch (sim.Length)
{
case 8:
return NumToIp("140" + sim);
case 7:
return NumToIp("1400" + sim);
case 6:
return NumToIp("14000" + sim);
case 5:
return NumToIp("140000" + sim);
case 4:
return NumToIp("1400000" + sim);
case 3:
return NumToIp("14000000" + sim);
case 2:
return NumToIp("140000000" + sim);
case 1:
return NumToIp("1400000000" + sim);
default:
return "";
}

}
int[] sIp = new int[4];

if ((iHigt & 0x08) != 0)

14
sIp[0] = Convert.ToInt32(Temp[0]) | 128;
else
sIp[0] = Convert.ToInt32(Temp[0]);

if ((iHigt & 0x04) != 0)


sIp[1] = Convert.ToInt32(Temp[1]) | 128;
else
sIp[1] = Convert.ToInt32(Temp[1]);

if ((iHigt & 0x02) != 0)


sIp[2] = Convert.ToInt32(Temp[2]) | 128;
else
sIp[2] = Convert.ToInt32(Temp[2]);

if ((iHigt & 0x01) != 0)


sIp[3] = Convert.ToInt32(Temp[3]) | 128;
else
sIp[3] = Convert.ToInt32(Temp[3]);

return sIp[0] + "." + sIp[1] + "." + sIp[2] + "." + sIp[3];


}

/// <summary>
/// Get calibration value
/// </summary>
/// <param name="tmp">the whole package data</param>
/// <param name="len">the length which will be used to calculate the calibration value </param>
/// <returns> calibration value </returns>
public static byte GetCheckXor(byte[] tmp, int len)
{
byte A = 0;
for (int i = 0; i < len; i++)
{
A ^= tmp[i];
}
return A;
}

For example :
Bytes=37,E3,00,A0
Id=13555990032

15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy