Teltonika Codec14 communication protocol

Supported device types and versions
Communication line configuration
Communication station configuration
I/O tag configuration
Literature
Changes and modifications
Document revisions

Supported device types and versions


The communication protocol Teltonika Codec14 supports data acquisition from the "Fleet Management Systems Unit" Teltonika devices of type FM4200 with firmware by Movys.
The protocol represents a TCP server to which the units are being connected online. The data come into the system via configuration of the so-called "master" station and I/O tags. I.e. whatever number of connected units send data to the system via one sample configuration of the unit. A unique IMEI code of the unit identifies data from single units.

Communication line configuration


  • Communication line category: TCP/IP TCP.
  • Server host: all or (TCP server), server port: well-known port according to the setting of the device.

Communication station configuration


Communication protocol: Teltonika Codec14.
Recommended setting of the station time intervals: delay 1 sec.

Station protocol parameters

Following station protocol parameters can be configured:

Table 1

Full nameMeaningUnitDefault value
Clients per Thread
A number of the connected units handled by one thread. It is used for balancing the power and the response of communication process in dependence on the number of connected units.1 up-to 20050
Send Async Message Request After Connect
KOM process will send 'Asynchronous Message Request' after a unit is connected. The unit will answer by 'Asynchronous Message Response' which contains the data (AVL record).YES/NOYES
Debug Packet Analyse
Activation of debug information about the received and sent datagrams.YES/NOYES
Debug Values
Activation of debugging information about received values.YES/NONO
Debug Packet Queue Flow
Activation of debugging information about the state of received data processing by D2000 System.YES/NONO
Debug Packet Binary Contents
Enabling of debug listings containing the received/sent datagrams in binary form.YES/NOYES
Unit Debug File

Enabling of a special form of tracing the units when the debug information is saved into a special file. The name of this file is derived from the IP address of the unit (IP1_IP2_IP3_IP4.log) in the "trace" subdirectory of the application directory. It makes easier the identification of debug lists from the unit.

Meaning of parameters:

Not_Allowed- the file will not be created
Both Line & Station- the file will be created in parallel with the standard .log file which traces the communication line
Station Only- only special log files are allowed
Warning! This setting overrides the level setting of communication tracing in the line configuration (see also the information in document Communication lines - configuration dialog box, section Communication tracing).

Not Allowed

Both Line & Station
Station Only

Not Allowed
Unit Debug File Size
Maximal size of the special debug file of unit tracing. After the file reaches this size, it will be renamed and saved like the file of communication line tracing.1 up-to 50 MBytes10

I/O tag configuration


Possible value types of I/O tags: Ai, Ao, Ci, Co, Di, Dout, TiA, ToA, TxtI, TxtO.

List of I/O tag addresses

Table 2

AddressMeaningValue type
HND.TRIGMessage handshaking - an issue of the new increment value signalizes the setting of all I/O tag values with the values of the received record and that they are ready to be processed.Ci
HND.TRIG_ACCMessage handshaking - acknowledges that data was processed by the application. It is executed by the writing of value HND.TRIG and signalizes that the KOM process can create the next record.Co
STAT.CONN_NRGlobal Statistic - an actual number of the handled TCP connections.Ci
STAT.IN_QUEUE_LENGlobal Statistic - number of received data files that are not sent to the system yet.Ci
STAT.RD_TASKS_NRGlobal Statistic - number of received threads.
STAT.VIRT_ST_NRGlobal Statistic - the actual number of connected units with a unique IMEI.
UNIT_DATA.IMEIUnit data - IMEI unit which data was received from.TxtI
UNIT_DATA.DTIMEUnit data - timestamp of received data. The timestamp of the value of all I/O tags UNIT_DATA.xxx is identical.TiA
UNIT_DATA.LATUnit data - latitude.Ai
UNIT_DATA.LONUnit data - longitude.Ai
UNIT_DATA.ALTUnit data - altitude (m).Ai
UNIT_DATA.PRIOUnit data - data priority (0/1).Ci
UNIT_DATA.SATUnit data - number of the visible satellites.Ci
UNIT_DATA.SPEEDUnit data - speed (km/h).Ci
UNIT_EVENT.EvNrUnit event - the value of the received events number EvNr. More detailed information on the events is mentioned in the literature about protocol Codec14.Ai/Di/Ci/TxtI
UNIT_DEBUG.DbgNrUnit debug - debug information with index DbgNr. More detailed information on the events is mentioned in the literature about protocol Codec14.Ai/Di/Ci/TxtI
UNIT_STAT.ST_BYTES_INUnit statistic & info - number of the received bytes from the unit since the KOM process has been started.Ci
UNIT_STAT.ST_BYTES_OUTUnit statistic & info - number of sent bytes to the unit since the KOM process has been started.Ci
UNIT_STAT.ST_CONFIG_TIMESTAMPUnit statistic & info - so-called config timestamp of the unit.TiA
UNIT_STAT.ST_CONNECTEDUnit statistic & info - state of the connection (1-connected, 0-disconnected); only when the state is changed.Ci
UNIT_STAT.ST_CONNECTSUnit statistic & info - total number of the unit connections since the KOM process has been started.Ci
UNIT_STAT.ST_FW_VERUnit statistic & info - the version of the unit firmware.TxtI
UNIT_STAT.ST_PACKETS_INUnit statistic & info - number of the received datagrams from the unit since the KOM process has been started.Ci
UNIT_STAT.ST_PACKETS_OUTUnit statistic & info - number of the sent datagrams to the unit since the KOM process has been started.Ci
UNIT_RESTART.IMEIUnit restart request - when the IMEI value is written into this I/O tag, a request to restart the unit with this IMEI is sent. If the writing failed, the unit is not connected.TxtO
UNIT_MONITORING.IMEIUnit monitoring request - when the IMEI value is written into this I/O tag, the request to monitor the unit with this IMEI is sent. If the writing failed, the unit is not connected.TxtO
UNIT_ASYNCMESS.IMEIAsync message request - when the IMEI value is written into this I/O tag, a request to receive the asynchronous info from the unit with this IMEI is sent. If the writing failed, the unit is not connected.TxtO
UNIT_DEBUG.IMEIUnit debug request - when the IMEI value is written into this I/O tag, a  request to receive the debug info from the unit with this IMEI is sent. The unit will respond by sending UNIT_DEBUG.DbgNr values. If the writing failed, the unit is not connected.TxtO
UNIT_FW_UPD.PARAMSFirmware update request - when the requested information is written, the process of firmware update for the unit with given IMEI is initialized. The format of data: IMEI,APN,APNuser,APNpasswd,server:port,fw_filename.
More detailed information on the events is mentioned in literature about protocol Codec14.
TxtO
UNIT_PARAMS_OUT.IMEIUnit parameters write messaging - IMEI of the unit which the changes of the configuration parameters are sent to.TxtO
UNIT_PARAMS_OUT.ADDRUnit parameters write messaging - address of the written parameter (parameter ID).Co
UNIT_PARAMS_OUT.VALUEUnit parameters write messaging - the value of the written parameter.TxtO
UNIT_PARAMS_OUT.VALUE_TYPEUnit parameters write messaging - the value type of the written parameter.Co


Parameter writing

The following rules hold:

  1. The values of parameters can be only written, not read.
  2. The check, if the writing was all right, is made through the so-called Configuration Timestamp (I/O tag with address UNIT_STAT.ST_CONFIG_TIMESTAMP). The value "Config Timestamp" must be set during the parameters writing - it is the parameter with ID = 0 (Profile Timestamp). The value should be the unique absolute time (the best is the time of the configuration start).
    After the parameters were written, the value UNIT_STAT.ST_CONFIG_TIMESTAMP must be set on the value of the parameter with ID=0 sent by the user.
  3. Process of writing:
    • Set IMEI to I/O tag UNIT_PARAMS_OUT.IMEI, if it ends with error (on an action WAIT) the KOM process does not recognize the unit with this IMEI or it is not online.
    • Set the value type of parameter to UNIT_PARAMS_OUT.VALUE_TYPE (see the Table 3).
    • Set UNIT_PARAMS_OUT.VALUE with the value of the parameter (as text).
    • Set UNIT_PARAMS_OUT.ADDR with the parameter ID. The parameter ID=0 "Profile Timestamp" should be the first.
    • Set UNIT_PARAMS_OUT.VALUE_TYPE of next parameter.
    • Set UNIT_PARAMS_OUT.VALUE with the value of the next parameter.
    • Set UNIT_PARAMS_OUT.ADDR with the parameter ID of next parameter.

      .... repeat as many times as many parameters you are writing. You need not write all the parameters but only those changed.....
    • Set UNIT_PARAMS_OUT.VALUE_TYPE to value 1 to finish the configuration.
    • Set UNIT_PARAMS_OUT.VALUE - empty text to finish the configuration.
    • Set UNIT_PARAMS_OUT.ADDR to value 0. It is a signal to send parameters into the unit physically.

Table 3

Type of value "UNIT_PARAMS_OUT.VALUE_TYPE"Parameter ID "UNIT_PARAMS_OUT.ADDR"Meaning
10End of configuration.
2xParameter of U8 type.
3xParameter of I32 type.
4xParameter of String type.
It is allowed to use it for all the parameters except for the parameter with ID=0. The user is responsible for the text correctness, the KOM process does not check it.
6xParameter of U16 type.
8xParameter of Float type.
10xParameter of U32 type.
110Parameter "Profile Timestamp" - a text with absolute time in the form: "dd-mm-rrrr hh:mi:ss".

Literature


  • Teltonika Codec.14 Communication Protocol Description, Rev.11.

Changes and modifications


  • Sept. 2009 - Document creation

Document revisions


  • Ver. 1.0 – September 30th, 2009

0 komentárov

Nie ste prihlásený. Akékoľvek zmeny, ktoré vykonáte, sa označia ako anonymné. Ak už máte svoj účet, pravdepodobne sa budete chcieť prihlásiť .