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
570 views
in Vehicle tracking by anonymous
I am trying to receive the information of the device fmb0100, through java websockets, once I receive the imei and send the 01, I receive the data in a very strange way as well as k Bl @ H    5 K     B, the code is as follows:
DataInputStream a = new DataInputStream (new BufferedInputStream (clientSocket.getInputStream ()));

                 ByteArrayOutputStream os = new ByteArrayOutputStream ();
                    byte [] buffer = new byte [0xFFFF];
                    for (int len ​​= a.read (buffer); len! = -1; len = a.read (buffer)) {
                        os.write (buffer, 0, len);
                    }
                    byte [] ab = os.toByteArray ();
How can I read that information?

1 Answer

0 votes
by anonymous

Hello,

Thank you for question.

Is this code is a part of your code or it is your main code?

If this code is a main code for getting data please check information about our Data sending in our Teltonika Wiki page: https://wiki.teltonika.lt/view/Codec

How FM devices are sending data packets:

  • The unit is sending own IMEI to the server;
  • After receiving IMEI, server should determine if it would accept data from this module. If yes, server will reply to module 01, if not - 00. Note that confirmation should be sent as binary packet. I.e. 1 byte 0x01 or 0x00;
  • When the server will answer 0x01, then module starts to send first AVL data packet. After server receives packet and parses it, server must report to module number of data received as integer (four bytes).

Note that if sent data number and reported by server doesn’t match module resends sent data.

Please let us know if we misunderstood your situation or you will have more questions.

Best regards,

Teltonika Support