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
1,124 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 anonymous
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