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
3,891 views
in Vehicle tracking by

Dear Support Team, we are facing problem of TCP command in entire model. there is no any perfectly guideline about that. no any artical no any video turorial. you should have to help for that. you can check any GPS forum many customers are facing this issie. I need TCP command of digital output for FMB920. we have tired below command. but its did not working. 00000000000000160C01050000000E7365746469676F7574203110D0A0100002265 setdigout 1 00000000000000160C01050000000E7365746469676F7574203100D0A0100002265 setdigout 0 00000000000000160C01050000000E7365746469676f757420310D0A010000E258 setdigout 1 00000000000000160C01050000000E7365746469676f757420300D0A010000E258 setdigout 0

by
Nolvadex Homme Clomid Menstruations Generic Methotrexate Overseas Pharmacy  <a href=http://gnplls.com>levitra receta</a> Rogaine With Propecia ****** Senza Ricetta Forum Kamagra Sintomas

1 Answer

+2 votes
by anonymous

Hello,

Set "digout 1" command (working):

00 00 00 00 00 00 00 13 0C 01 05 00 00 00 0B 73 65 74 64 69 67 6F 75 74 20 31 01 00 00 87 A2

1. You got data size incorectlly. It is number of bytes starting from 0C to CRC

00 00 00 00 00 00 00 13 0C 01 05 00 00 00 0B 73 65 74 64 69 67 6F 75 74 20 31 01 00 00 87 A2

2. You got command size incorectlly because "setdigout 1" command has 11 bytes (0x0B)

3. You got CRC incorectlly it's calculated using CRC-16-IBM Reversed 0xA001 Little Endian (DCBA) (You can find calculator in the link below)

CRC calculation data:

00 00 00 00 00 00 00 13 0C 01 05 00 00 00 0B 73 65 74 64 69 67 6F 75 74 20 31 01 00 00 87 A2

Feel free to use this calculator:
https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/

If You have any other questions regarding this matter, feel free to contact us.

Best answer
by anonymous
Hello

The specific command is for setdigout 1. What is the command on HEX setdigout 0 and also what you need to add if you want timer on the command?

Best regards
by

"setdigout 0"

00000000000000130c01050000000b7365746469676f7574203001000017a3

Also it is not necessary for codec12 commands to add "0D0A" to the end.


As for setdigout command with timer parameters, more info is here:

by

Hello,

I'll try to give you a step by step solution how to build up a packet.

1. Make a command that you want to send to device. (this time lets make setdigout with a timer, as requested).

Command: setdigout 1 60

Lets convert it to HEX: 73 65 74 64 69 67 6f 75 74 20 31 20 36 30

(I have used this calculator to convert a command http://www.unit-conversion.info/texttools/hexadecimal/)

2. Now we have to build up a packet around the command.

 a) Packet always starts with 4 zero bytes
 

     00 00 00 00

  b) Then let’s add 4 more bytes with data size, at this point we don't know the packet data size so let's just leave a question mark here.

    00 00 00 00 00 00 00 ??

  c) Lets add one more byte 0C (it's just always 0C)
    00 00 00 00 00 00 00 ?? 0C

  d) Adding one more byte with number of commands. (in this case we are using only one command so it's 01)

    00 00 00 00 00 00 00 ?? 0C 01

  e) Lets add one more byte 05 command type (request 05, response 06)

    00 00 00 00 00 00 00 ?? 0C 01 05

  f) Now let's add 4 bytes with length of the command. So we had a hex: 73 65 74 64 69 67 6f 75 74 20 31 20 36 30 of 14 bytes. So it's 00 00 00 0E.

    00 00 00 00 00 00 00 ?? 0C 01 05 00 00 00 0E

  g) Then goes command hex which we calculated at step 1.

   00 00 00 00 00 00 00 ?? 0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 20 36 30

  h) At this point we should add one more byte with number of commands 01

  00 00 00 00 00 00 00 ?? 0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 20 36 30 01

  i) Now we can calculate data size. It contains a number of bytes that goes after it. (Except CRC witch will be calculated in next step) In this case it’s 22 byte in hex it’s 16.

   00 00 00 00 00 00 00 16 0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 20 36 30 01

  j) Finally we have to calculate CRC. It's 4 bytes calculated using same bytes that are used to calculate data size (0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 20 36 30 01). CRC is calculated using CRC-16-IBM Reversed 0xA001 Little Endian (DCBA) (Calculator link: https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/). We are getting 00 00 B3 3E

   00 00 00 00 00 00 00 16 0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 2C 36 30 01 00 00 B3 3E

3. So now we have a final command: 00 00 00 00 00 00 00 16 0C 01 05 00 00 00 0E 73 65 74 64 69 67 6f 75 74 20 31 20 36 30 01 00 00 B3 3E

 Best regards

by anonymous
Hello,

Thanks for this information.

I just have one more doubt that, how should i send this data to client by using socket or anyting else. Because i tried this using php-socket but nothing happen.

So can you please tell me??