Teltonika FM1125 - Parse Serial Data (CODEC_12)

javisan9 years ago

Dear Anton,

We're using the Teltonika FM1125 model with an external device connected by serial RS232.

Your code TeltonikaProtocolDecoder.java has defined but hasn't completed the serial port data decodification:

private static final int CODEC_12 = 0x0C;

        if (codec == CODEC_12) {
            return null; // decode serial port data
        }

How can we save in the table [positions] the [attribute] serial data decoded?

Thanks in advance,
Javier

Anton Tananaev9 years ago

I need protocol documentation to implement it.

javisan9 years ago

Dear Anton,

This is the Code 12 protocol:

| 0x00000000 | Data Size |  0x0C  | Command quantity |  0x05  | Command size | Command | Command quantity |   CRC   |
|   4 Bytes  |  4 Bytes  | 1 Byte |       1 Byte     | 1 Byte |   4 Bytes    | X Bytes |      1 Byte      | 4 Bytes |

Example:

Hexadecimal stream:

00000000000000710c0106000000694154244d5347534e443d342c225354474234302c50522c3335363630313036303236353035302c313630343232313531372c313630343232313531382c432c2b3032332e332c302c2b3032332e312c302c4445414354492c302c4445414354492c302c312c30220d0a010000d8db

Parsed:

Preamble: 0x00000000
Packet Length: 0x00000071
Codec: 0x0c
Quantity of commands: 0x01
Command type: 0x06
Command size: 0x00000069
Command: AT$MSGSND=4,"STGB40,PR,356601060265050,1604221517,1604221518,C,+023.3,0,+023.1,0,DEACTI,0,DEACTI,0,1,0"<CR><LF>
Quantity of commands: 0x01
CRC: 0x0000d8DB

Is this possible to save Command serial data to data table [positions] using [attributes] column or similar?

Thanks for your help,

Javier

Anton Tananaev9 years ago

I have added support for codec 12 to Traccar.

javisan9 years ago

Dear Anton, thanks for your hard work.

We're able to collect serial data from Teltonkia FM1125 devices now!

Is it possible to send commands back to device using codec_12 with Traccar web page Command function?

The response message structure is nearly the same:

|0x00000000|Data Size| 0x0C |Response quantity| 0x06 |Response size|Response|Response quantity|  CRC  |
|  4 Bytes | 4 Bytes |1 Byte|      1 Byte     |1 Byte|  4 Bytes    | X Bytes|      1 Byte     |4 Bytes|

Thanks in advance,
Javier

Anton Tananaev9 years ago

What kind of command do you want to send? It is just arbitrary text?

javisan9 years ago

Yes Anton, It can be considered as an arbitrary text.
It is a command that the serial device connected to Teltonika FM1125 can understand.

Anton Tananaev9 years ago

Please create a GitHub request to add it.

javisan8 years ago

Dear Anton,
I've created an issue #1948 in GitHub.
I'm not sure if you have asked me to create a Pull request. Is this the way to continue with the requeriment?

Thanks

Anton Tananaev8 years ago

I saw the issue. I haven't had time to do anything about it yet.

salara8 years ago

Good day.
Someone tried to send a multiple command packages (avl with codec_id=12) to FM1110?
If one command in the package - everything works (for example: getparam 1245)
Is it possible to put in a single package multiple command?
(According to the package structure - can be), but I did not succeed.
Maybe someone knows how to do it? Share your experiences, please.
And another question: via GPRS not work command "flush IMEI,APN,.....", but via SMS it work,
as it should be?
Thank you

Anton Tananaev8 years ago

You can send any arbitrary text to the device. If device doesn't accept it, it means that either format is incorrect or device doesn't support it.

salara8 years ago

I would like to execute AT commands,for example AT+CNUM or ATI, but getting from FM1110 - #ERROR\r\n. Apparently this is not possible, sorry. Maybe i must set in package command_type != 0x05 for AT-command ? (maybe 0x06 or other)
Someone can have such an experience?

Anton Tananaev8 years ago

I guess it's better to clarify it with Teltonika support.

salara8 years ago

Teltonika tech support did not bother communicating with me, say - you bought the device does not have, and that's displayed as your dealer. That's how it was. Therefore, I am writing here, on your forum, can someone already passed these questions.