Changes

110 bytes added ,  10:14, 25 August 2023
Line 2,568: Line 2,568:  
*'''<big>About Codec13</big>'''
 
*'''<big>About Codec13</big>'''
   −
Codec13 is original Teltonika protocol for device-server communication over GPRS messages and it is based on Codec12 protocol. Main differences of Codec13 are that timestamp is using in messages and communication is one way only (Codec13 is used for Device -> Server sending). <br>
+
Codec13 is original Teltonika protocol for device-server communication over GPRS messages. This protocol is necessary for using following FM features: COM TCP Link Mode (binary/ASCII/binary buffered/ASCII buffered) if message timestamp parameter is enabled in device configuration. Codec13 messages are one way only (Device Server sending).<br>
    
*'''<big>General Codec13 message structure</big>'''
 
*'''<big>General Codec13 message structure</big>'''
Line 2,578: Line 2,578:  
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Data Size
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Data Size
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Codec ID
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Codec ID
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Command Quantity 1
+
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Response Quantity 1
 
! colspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Type
 
! colspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Type
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Command Size
+
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Response Size
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Timestamp
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Timestamp
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Command
+
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Response
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Command Quantity 2
+
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Response Quantity 2
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |CRC-16
 
! rowspan="1" style="width:10%; border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |CRC-16
 
|-
 
|-
Line 2,601: Line 2,601:     
'''Preamble''' – the packet starts with preamble field (four zero bytes). <br>
 
'''Preamble''' – the packet starts with preamble field (four zero bytes). <br>
'''Data Size''' – size is calculated from Codec ID field to the second Command Quantity field. <br>
+
'''Data Size''' – size is calculated from Codec ID field to the second Response Quantity field. <br>
 
'''Codec ID''' – in Codec13 it is always <code>0x0D</code>. <br>
 
'''Codec ID''' – in Codec13 it is always <code>0x0D</code>. <br>
'''Command Quantity 1''' – <code>0x01</code>, it is ignored when parsing the message. <br>
+
'''Response Quantity 1''' – <code>0x01</code>, it is ignored when parsing the message. <br>
'''Command Type''' – it is always <code>0x05</code> since the packet is direction is FM->Server. <br>
+
'''Response Type''' – it is always <code>0x06</code> since the packet is direction is FM->Server. <br>
'''Command Size''' – command size field includes size of timestamp too, so it is equal to size of payload + size of timestamp. <br>
+
'''Response Size''' – response size field includes size of timestamp too, so it is equal to size of payload + size of timestamp. <br>
 
'''Timestamp''' – a difference, in seconds, between the current time and midnight, January, 1970 UTC (UNIX time). <br>
 
'''Timestamp''' – a difference, in seconds, between the current time and midnight, January, 1970 UTC (UNIX time). <br>
'''Command''' – actual received data. <br>
+
'''Response''' – actual received data. <br>
'''Command Quantity 2''' – a byte which defines how many records (commands) is in the packet. This byte will not be parsed but it’s recommended that it should contain same value as Command/Response Quantity 1. <br>
+
'''Response Quantity 2''' – a byte which defines how many records (responses) is in the packet. This byte will not be parsed but it’s recommended that it should contain same value as Response Quantity 1. <br>
 
'''CRC-16''' – calculated from Codec ID to the Second Number of Data. CRC (Cyclic Redundancy Check) is an error-detecting code using for detect accidental changes to RAW data. For calculation we are using [[Codec#CRC-16|CRC-16/IBM]].<br> <br>
 
'''CRC-16''' – calculated from Codec ID to the Second Number of Data. CRC (Cyclic Redundancy Check) is an error-detecting code using for detect accidental changes to RAW data. For calculation we are using [[Codec#CRC-16|CRC-16/IBM]].<br> <br>
 
'''Note:''' Codec13 packets are used only when “Message Timestamp” parameter in RS232 settings is enabled. <br>  
 
'''Note:''' Codec13 packets are used only when “Message Timestamp” parameter in RS232 settings is enabled. <br>  
Line 2,615: Line 2,615:     
Hexadecimal stream of GPRS command in this example is given in hexadecimal form. The different fields of message are separate into different table columns for better readability and some of them are converted to ASCII values for better understanding. <br> <br>
 
Hexadecimal stream of GPRS command in this example is given in hexadecimal form. The different fields of message are separate into different table columns for better readability and some of them are converted to ASCII values for better understanding. <br> <br>
Sending ''[[FMB getinfo|getinfo]]'' SMS command via GPRS Codec13. <br> <br>
+
Receiving "hello lets test" SMS response via GPRS Codec13<br> <br>
 
Hexadecimal stream: <br>
 
Hexadecimal stream: <br>
<code>00000000000000170D01050000000F0A81C320676574696E666F0100006855</code> <br> <br>
+
<code>000000000000001D0D01060000001564E8328168656C6C6F206C65747320746573740D0A0100003548</code> <br> <br>
 
Parsed:  
 
Parsed:  
 
{| class="nd-othertables_2" style="width:100%;"
 
{| class="nd-othertables_2" style="width:100%;"
 
|+
 
|+
! colspan="2" style="border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Server Command
+
! colspan="2" style="border-bottom: 2px solid #0054A6; vertical-align: middle; text-align: center;" |Device answer
 
|-
 
|-
! rowspan="1" style="width:50%; vertical-align: middle; text-align: center;" |Server Command Part
+
! rowspan="1" style="width:50%; vertical-align: middle; text-align: center;" |Device answer part
 
! rowspan="1" style="width:50%; vertical-align: middle; text-align: center;" |HEX Code Part
 
! rowspan="1" style="width:50%; vertical-align: middle; text-align: center;" |HEX Code Part
 
|-
 
|-
Line 2,630: Line 2,630:  
|-
 
|-
 
| style="vertical-align: middle; text-align: center;" |Data Size
 
| style="vertical-align: middle; text-align: center;" |Data Size
| style="vertical-align: middle; text-align: center;" |00 00 00 17
+
| style="vertical-align: middle; text-align: center;" |00 00 00 1D
 
|-
 
|-
 
| style="vertical-align: middle; text-align: center;" |Codec ID
 
| style="vertical-align: middle; text-align: center;" |Codec ID
 
| style="vertical-align: middle; text-align: center;" |0D
 
| style="vertical-align: middle; text-align: center;" |0D
 
|-
 
|-
| style="vertical-align: middle; text-align: center;" |Command Quantity 1
+
| style="vertical-align: middle; text-align: center;" |Response Quantity 1
 
| style="vertical-align: middle; text-align: center;" |01
 
| style="vertical-align: middle; text-align: center;" |01
 
|-
 
|-
| style="vertical-align: middle; text-align: center;" |Command Type
+
| style="vertical-align: middle; text-align: center;" |Response Type
| style="vertical-align: middle; text-align: center;" |05
+
| style="vertical-align: middle; text-align: center;" |06
 
|-
 
|-
| style="vertical-align: middle; text-align: center;" |Command Size
+
| style="vertical-align: middle; text-align: center;" |Response Size
| style="vertical-align: middle; text-align: center;" |00 00 00 07
+
| style="vertical-align: middle; text-align: center;" |00 00 00 15
 
|-
 
|-
 
| style="vertical-align: middle; text-align: center;" |Timestamp
 
| style="vertical-align: middle; text-align: center;" |Timestamp
| style="vertical-align: middle; text-align: center;" |0A 81 C3 20
+
| style="vertical-align: middle; text-align: center;" |64 E8 32 81
 
|-
 
|-
| style="vertical-align: middle; text-align: center;" |Command
+
| style="vertical-align: middle; text-align: center;" |Response
| style="vertical-align: middle; text-align: center;" |67 65 74 69 6E 66 6F
+
| style="vertical-align: middle; text-align: center;" |68 65 6C 6C 6F 20 6C 65 74 73 20 74 65 73 74 0D 0A
 
|-
 
|-
| style="vertical-align: middle; text-align: center;" |Command Quantity 2
+
| style="vertical-align: middle; text-align: center;" |Response Quantity 2
 
| style="vertical-align: middle; text-align: center;" |01
 
| style="vertical-align: middle; text-align: center;" |01
 
|-
 
|-
 
| style="vertical-align: middle; text-align: center;" |CRC-16
 
| style="vertical-align: middle; text-align: center;" |CRC-16
| style="vertical-align: middle; text-align: center;" |00 00 68 55
+
| style="vertical-align: middle; text-align: center;" |00 00 35 48
 
|-
 
|-
 
|}  
 
|}  
      −
Note that Server Command converted from HEX to ASCII means ''[[FMB getinfo|getinfo]]''
+
Note that Server Response converted from HEX to ASCII means "hello lets test"
    
=='''<big>Codec 14</big>'''==
 
=='''<big>Codec 14</big>'''==
Line 2,890: Line 2,890:  
|-
 
|-
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Communication
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Communication
| style="vertical-align: middle; text-align: center;" |Server - Device Communication
+
| style="vertical-align: middle; text-align: center;" |Server Device Communication
| style="vertical-align: middle; text-align: center;" |One-way (Device -> Server communication)
+
| style="vertical-align: middle; text-align: center;" |One-way (Device Server communication)
| style="vertical-align: middle; text-align: center;" |Server - Device Communication
+
| style="vertical-align: middle; text-align: center;" |Server Device Communication
 
|-
 
|-
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Codec ID
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Codec ID
Line 2,901: Line 2,901:  
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Response Message Type
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Response Message Type
 
| style="vertical-align: middle; text-align: center;" |0x06
 
| style="vertical-align: middle; text-align: center;" |0x06
| style="vertical-align: middle; text-align: center;" | -
+
| style="vertical-align: middle; text-align: center;" | 0x06
 
| style="vertical-align: middle; text-align: center;" |0x06 (if it is ACK) or 0x11 (if it is nACK)
 
| style="vertical-align: middle; text-align: center;" |0x06 (if it is ACK) or 0x11 (if it is nACK)
 
|-
 
|-
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Command / Response size
 
! rowspan="1" style="width:10%; vertical-align: middle; text-align: center;" |Command / Response size
| style="vertical-align: middle; text-align: center;" |Only Command/Response
+
| style="vertical-align: middle; text-align: center;" |Command/Response
| style="vertical-align: middle; text-align: center;" |Only Command
+
| style="vertical-align: middle; text-align: center;" |Only Response
 
| style="vertical-align: middle; text-align: center;" |Command/Response + IMEI
 
| style="vertical-align: middle; text-align: center;" |Command/Response + IMEI
 
|-
 
|-
0

edits

Navigation menu