Ask a question

3612 questions

4122 answers

3059 comments

35574 members

Ask a question
0 votes
998 views
in Vehicle tracking by

Hi,

i'm trying to sending data over TCP/IP following your codec guide.

I implemented a java server socket that correctly receive the IMEI from the device (FMB202), but then when it responds with the 0x01 byte the device doesn't receive anything and the connection expires.

I can see from the Configurator application that the bytes of data received doesn't change over several attemps.

Why i'm not enable to send data to the FMB202 device?

Thanks

Luca

1 Answer

0 votes
by
Hello.

Because your server does not send data packet.

Provide source code.

Regards
by

Below my source code.

In the variable line i receive correctly the imei and than in my teltonika configurator don't receive any byte.

            ServerSocket serverSocket = new ServerSocket(port);
            Socket clientSocket = serverSocket.accept();
            InputStream inputStream = clientSocket.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
            String line = reader.readLine();
            System.out.println("From Client: " + line);

            byte response = (byte)0x01;
            OutputStream output = clientSocket.getOutputStream();
            output.write(response);
            output.flush();

Even with the Hercules utilitity, i can receive only the IMEI data:

Thanks