FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

4167 questions

4739 answers

3460 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
2,264 views
in Vehicle tracking by

Hello,

FMB125 fw version: 03.16.18

My setup follow this diagram:  

Server < ...   ....  ... ... > FMB125 < -----RS232------ > (Management Device (MD)

(0) FMB125 should send IMEI Packets and Server should acknowledge this packet with 01.

(1) The MD should send a specific packet with a certain number of bytes to FMB125. 

(2) FMB125 should encapsulate packet with codec12 header and send it to the server. 

(3.1) Server should Acknowledge the packet

(3.2) Server decapusulate codec12 headers, should interpret the sent bytes and should trigger an answer.

(3.3) Server should encapsulate the bytes of the answer with codec12  headers and send them to FMB125.

(4) FMB125 should decapsulate codec12 headers, and as it isnt a codec12 known message, should forward to the external device all the packet without codec12 headers.

The step number 4 is not happening. Why is that? I am working TCP binary mode.

Best regards

2 Answers

0 votes
by anonymous
Hi...could you please provide more information on how your device is connected to FMB125?I assume you are using RS232 rx/tx cables? If you do, what are your FMB125 RS232 configuration settings? For your project, you should be looking to use TCP Binary/Ascii modes.
by
Hello,

Thank you for answering. The information about the configuration is in the question. I am using RS232 rx/tx cables on TCP Binary mode. Does the messages from server to the connected device has to be any special structure?
+1 vote
by
For ASCII you can use the #EXT DAT=<ascii data>, or just send unknown command.

For Binary, implemented 0x0E CODEC12 command (cmd byte in header)

This is valid >=03.18.19
by

Hello, 

Thank for the input. I am using Binary mode and I did not saw anything about 0x0E Codec12. What do you mean by cmd byte in header? Where is that information? Here: https://wiki.teltonika.lt/view/Codec_12 ?

I tried this message from server -> external device without success:

 00 00 00 00 00 00 00 0a 0c 01 0e 00 00 00 02 03 01 01 00 00 cb 7d

 00 00 00 00 - preamble

 00 00 00 0a - length

 0c - codec12

 01 - command number

 0e - Is this he Cmd byte  you have mentioned?

 00 00 00 02 - command length

 03 01 - data

01 - command number

 00 00 cb 7d - crc

Although I did not received the message on external device, i am able to see that same message on logs of FMB125 and an error associated with is:

[2019.03.21 08:35:46]-[GPRS.CMD] WARNING @ 151:Invalid cmd len: 12 < 20

Do you know what am I doing wrong?

Thanks in advance

by

s this he Cmd byte  you have mentioned?

Exactly. Also Binary data size must be specified into Command size  field

Please, check the the FW version - must be >=03.18.19

If it works you will see in log: "Forwarded to RS232, len:<data len>"

by

I dont get what i am doing wrong.. In fact with that cmd byte it works sometimes. But the odd thing is that with the exactly same message i get sometimes "Forwarded to RS232, len:<data len>" and sometimes : "WARNING @ 151:Invalid cmd len: 12 < 20". DO you know any probable cause?

Thank you for your time.

by

Okay, I found the problem! You were right with frame structure. I was not able to receive messages, because somehow, the Ack from server when receive a message from external device (forward from fmb125) was interfering on the communication. But now i have another problem:

-> If i send Ack to fmb (00 00 00 nod) the messages from the external device I cannot send the server answer to the fmb which it would be forwared to the external device.

-> If i dont Ack the message, the connection closes after the response timeout.

Questions:

-> It is supposed to ack the messages from external device?

->  How can i both have the messages forward to rs232 and have the connection open after response timeout?

Thank you for your time and support.

Regards

by anonymous

-> It is supposed to ack the messages from external device?
No, you are not supposed to ACK messages which FW forwards from ext device -> server.

->  How can i both have the messages forward to rs232 and have the connection open after response timeout?

Send proper ACK to sent records from device -> server.

Regards

by
Ok, now everything works fine with the communication between server and rs232 device. The problems were the 0xe byte and the wrong Acks to rs232 messages from the server.

Thank you for the good support.

Regards