Changes

11,271 bytes added ,  07:28, 3 September 2021
Created page with "=='''Introduction'''== This document describes the Crash Trace data and illustrates how to parse it. Two data examples are used. Understanding raw data / Parsing raw data. T..."
=='''Introduction'''==

This document describes the Crash Trace data and illustrates how to parse it. Two data examples are used. Understanding raw data / Parsing raw data.

The Crash Detection Scenario monitors acceleration on each axis to detect an accident. To parse it correctly, note that “Crash Trace” must be enabled, otherwise only one eventual crash record will be generated.

=='''Understanding RAW data'''==

When the “Crash Trace” is enabled, device will generate and send the accelerometer data in HEX format over AVL ID 257 (Crash trace data)

{|
|-
| [[File:Alert.png|left|20px]] || <b>'''NOTE: Such RAW data is considered as a variable length value. Codec 8 Extended is required'''</b>
|}

Hexadecimal stream of AVL Data Packet receiving and response in this example are given in hexadecimal form. The different fields of packet are separate into different table columns for better readability and some of them are converted to ASCII values for better understanding. <br> <br>
Received data in hexadecimal stream: <br>
<code>00BDCAFE0120000F3335383X38303X3X3136383X34393X8E0100000178B0C1D4450100000000000000000000000000000000F70002000100F70400000000000000010101<span style="background:#FF9524">0078<span style="background:#87CEEB">001 <br> D003F03F3001E003C03F30026004C04020022004603FD0023004603FC0024004803FC001F004303FB001F004103F10026004903FC0025004D03FF001E004303F70023004503FB001<br>
F004103F6001C003B03F40022004703FB001E003B03F50025004A03FB001E003F03F30021004303FB0024004603FF01</code>

Parsed:
{| class="nd-othertables_2" style="width:100%;"
|+
! colspan="3" style="border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |AVL Data Packet
|-
! colspan="2" rowspan="1" style="width:60%; vertical-align: middle; text-align: center;" |AVL Data Packet Part
! rowspan="1" style="width:40%; vertical-align: middle; text-align: center;" |HEX Code Part
|-
| rowspan="3" style="vertical-align: middle; text-align: center;" |UDP Channel Header
| style="vertical-align: middle; text-align: center;" |Length
| style="vertical-align: middle; text-align: center;" |00 BD
|-
| style="vertical-align: middle; text-align: center;" |Packet ID
| style="vertical-align: middle; text-align: center;" |CA FE
|-
| style="vertical-align: middle; text-align: center;" |Not usable byte
| style="vertical-align: middle; text-align: center;" |01
|-
| rowspan="3" style="vertical-align: middle; text-align: center;" |AVL Packet Header
| style="vertical-align: middle; text-align: center;" |AVL packet ID
| style="vertical-align: middle; text-align: center;" |20
|-
| style="vertical-align: middle; text-align: center;" |IMEI Length
| style="vertical-align: middle; text-align: center;" |00 0F
|-
| style="vertical-align: middle; text-align: center;" |IMEI
| style="vertical-align: middle; text-align: center;" |33 35 38 3X 38 30 3X 3X 31 36 38 3X 34 39 3X
|-
| rowspan="27" style="vertical-align: middle; text-align: center;" |AVL Data Array
| style="vertical-align: middle; text-align: center;" |Codec ID
| style="vertical-align: middle; text-align: center;" |8E
|-
| style="vertical-align: middle; text-align: center;" |Number of Data 1 (Records)
| style="vertical-align: middle; text-align: center;" |01
|-
| style="vertical-align: middle; text-align: center;" |Timestamp
| style="vertical-align: middle; text-align: center;" |00 00 01 78 B0 C1 D4 45(GMT: Thursday, April 08, 2021 09:13:16 AM)
|-
| style="vertical-align: middle; text-align: center;" |Priority
| style="vertical-align: middle; text-align: center;" |01
|-
| style="vertical-align: middle; text-align: center;" |Longitude
| style="vertical-align: middle; text-align: center;" |00 00 00 00
|-
| style="vertical-align: middle; text-align: center;" |Latitude
| style="vertical-align: middle; text-align: center;" |00 00 00 00
|-
| style="vertical-align: middle; text-align: center;" |Altitude
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |Angle
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |Satellites
| style="vertical-align: middle; text-align: center;" |00
|-
| style="vertical-align: middle; text-align: center;" |Speed
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |Event IO ID
| style="vertical-align: middle; text-align: center;" |00 F7
|-
| style="vertical-align: middle; text-align: center;" |N of Total ID
| style="vertical-align: middle; text-align: center;" |00 02
|-
| style="vertical-align: middle; text-align: center;" |N1 of One Byte IO
| style="vertical-align: middle; text-align: center;" |00 01
|-
| style="vertical-align: middle; text-align: center;" |1’st IO ID
| style="vertical-align: middle; text-align: center;" |00 F7 (AVL ID: 239, Name: Ignition)
|-
| style="vertical-align: middle; text-align: center;" |1’st IO Value
| style="vertical-align: middle; text-align: center;" |00 01
|-
| style="vertical-align: middle; text-align: center;" |N2 of Two Bytes IO
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |N4 of Two Bytes IO
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |N8 of Two Bytes IO
| style="vertical-align: middle; text-align: center;" |00 00
|-
| style="vertical-align: middle; text-align: center;" |NX of X Byte IO
| style="vertical-align: middle; text-align: center;" |00 01
|-
| style="vertical-align: middle; text-align: center;" |1’st IO ID
| style="vertical-align: middle; text-align: center;" |01 01 (AVL ID: 257, Name: Crash trace data)
|-
| style="vertical-align: middle; text-align: center;" |1’st IO data lenght
| style="vertical-align: middle; text-align: center;" |<span style="background:#FF9524">00 78
|-
| style="vertical-align: middle; text-align: center;" |1’st IO Value
| style="vertical-align: middle; text-align: center;" |<span style="background:#87CEEB">00 1D 00 3F 03 F3 00 1E 00 3C 03 F3 00 26 00 4C 04 02 00 22 00 46 03 FD 00 23 00 46 03 FC 00 24 00 48 03 FC 00 1F 00 43 03 FB 00 1F 00 41 03 F1 00 26 00 49 03 FC 00 25 00 4D 03 FF 00 1E 00 43 03 F7 00 23 00 45 03 FB 00 1F 00 41 03 F6 00 1C 00 3B 03 F4 00 22 00 47 03 FB 00 1E 00 3B 03 F5 00 25 00 4A 03 FB 00 1E 00 3F 03 F3 00 21 00 43 03 FB 00 24 00 46 03 FF
|-
| style="vertical-align: middle; text-align: center;" |Number of Data 2 (Number of Total Records)
| style="vertical-align: middle; text-align: center;" |01
|}
<br/>
IO Value is considered as the accelerometer data.<br/>
{|
|-
| '''NOTE: The crash data is packed in order as follows:'''
|-
|<span style="background:#24a752">1.“X” Axis data<br/>
|-
|<span style="background:#ea922e">2.“Y” Axis data<br/>
|-
|<span style="background:#ff0000">3.“Z” Axis data<br/>
|-
|'''Every Axis data has 2 bytes data length info.'''
|}

If you have any doubt about data packet structure, please refer to our '''[https://wiki.teltonika-gps.com/view/Codec#Codec_8_Extended Data Sending protocols]'''

=='''Processing “Crash Trace” data'''==

Handling the '''Crash Trace data (AVL ID:257)''' as described in '''[https://internalwiki.teltonika-gps.com/view/How_to_parse_crash_data#Understanding_RAW_data|Understanding RAW data]''' by axis order and data length, we will have:

'''Table 1. Axis values from AVL ID 257.'''
{| class="wikitable"
|'''<span style="background:#24a752">AXIS X'''
|'''<span style="background:#ea922e">AXIS Y'''
|'''<span style="background:#ff0000">AXIS Z'''
|-
|'''<span style="background:#24a752">001D'''
|'''<span style="background:#ea922e">003F'''
|'''<span style="background:#ff0000">03F3'''
|-
|'''<span style="background:#24a752">001E'''
|'''<span style="background:#ea922e">003C'''
|'''<span style="background:#ff0000">03F3'''
|-
|0026
|004C
|0402
|-
|0022
|0046
|03FD
|-
|0023
|0046
|03FC
|-
|0024
|0048
|03FC
|-
|001F
|0043
|03FB
|-
|001F
|0041
|03F1
|-
|0026
|0049
|03FC
|-
|0025
|004D
|03FF
|-
|001E
|0043
|03F7
|-
|0023
|0045
|03FB
|-
|001F
|0041
|03F6
|-
|001C
|003B
|03F4
|-
|0022
|0047
|03FB
|-
|001E
|003B
|03F5
|-
|0025
|004A
|03FB
|-
|001E
|003F
|03F3
|-
|0021
|0043
|03FB
|-
|0024
|0046
|03FF
|}

==='''Processing the “Crash Trace” data manually'''===
As a brief example, here we have 6 axis values: Two from X axis, two from Y axis and two from Z axis. (Refers to “Table 1)

We will convert the HEX RAW data into the real axis value (mG)

<span style="text-align: center">'''<span style="background:#24a752">001D <span style="background:#ea922e">003F <span style="background:#ff0000">03F3'''

<span style="text-align: center">'''<span style="background:#24a752">x:29mG <span style="background:#ea922e">y:63mG <span style="background:#ff0000">z:1.011mG'''

<span style="text-align: center">'''<span style="background:#24a752">001E <span style="background:#ea922e">003C <span style="background:#ff0000">03F3'''

<span style="text-align: center">'''<span style="background:#24a752">x:30mG <span style="background:#ea922e">y:60mG <span style="background:#ff0000">z:1.011mG'''

==='''Configuring the Crash Detection scenario'''===

First, and according to technical details about AVL ID 257 (variable data length), run the Teltonika Configurator, go to “System” menu and chose “Codec 8 Extended” as the main Data Protocol, then go to “Accelerometer Features” menu and configure the “Crash Detection Scenario” according to your needs. <br>
You can consult Crash Detection details at our Wiki Page.<br>
[[File:Crash Detection configuration example.png|center|700px]]

==='''The Parser'''===
'''[[File:Crash Trace Tool.xlsx||Crash Trace Parser Tool]]'''
The “Parser tool” consists in one editable sheet where the Crash Data must be entered. This should be done in the “C1” cell.
Once you enter Trace Data, the parser will decode it automatically.<br>
<br>
In cell C6 you’ll get the packet elements.<br>
From cell C8 towards down you´ll get the count of axis packet. (“X” axis value, “Y” axis value and “Z” axis value)<br>
In cell E8 towards down you´ll get the axis packet information<br>
In cell F8 and G8 both towards down you will get all the axis “X” info (1byte per cell)<br>
In cell H8 and I8 both towards down you will get all the axis “Y” info (1byte per cell)<br>
In cell J8 and K8 both towards down you will get all the axis “Z” info (1byte per cell)<br>
<br>
[[File:The parser distribution.png|center|700px]]

==='''Parsing'''===

After you insert the Crash Trace data in C1 cell, the parser will display processed info in mentioned cells.
Note that all mentioned data is given in HEX.<br>
Cell L8 towards down will show the converted HEX Crash Data into DEC (mG) data that belong to X Axis<br>
Cell M8 towards down will show the converted HEX Crash Data into DEC (mG) data that belong to Y Axis<br>
Cell N8 towards down will show the converted HEX Crash Data into DEC (mG) data that belong to X Axis<br>
<br>

[[File:Real axis values.png|center|700px]]

==='''Graphing'''===

As the Crash Trace data is inserted and processed by the own tool, the graph will be built automatically.<br>
<br>

[[File:Axis Graph.png|center|700px]]