Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7570741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:29:57+00:00 2026-05-30T15:29:57+00:00

I bought a gps, I tested this with sms message and with its own

  • 0

I bought a gps, I tested this with sms message and with its own software to retrieve the lat / long and it works fine , see the screenshot :
enter image description here

Now I’m sure that the communication with gprs->internet works so I want to create my own software who can do a lot of other functionality that does not exist with the software manufacturer..
In my first reflection, I tried to listen the NMEA messages with socket tcp/ip (java) on the port 7070 , here is my source code:

 import java.io.*;
 import java.net.*;


 public class Serveur {
 static final int port = 7070;
  public static void main(String[] args) throws Exception {              

    ServerSocket s = new ServerSocket(port);
    System.out.println("waiting for connexion from GPS 7070");
    Socket socClient = s.accept();
    System.out.println("Connexion GPS ok");

           BufferedReader in = new BufferedReader(
                           new InputStreamReader(socClient.getInputStream())
                          ); 
            PrintWriter out = new PrintWriter(
                         new BufferedWriter(
                            new OutputStreamWriter(socClient.getOutputStream())), 
                         true);   
    String str = in.readLine(); 

    System.out.println("the GPS message  is : " + str);         

    in.close();
    out.close();

    socClient.close();
  } 
  }

I tried to send a message through a java client on the local network, and it works..

But the problem that I do not understand is : when I receive a message from the GPS, i get this error :

waiting for connexion from GPS 7070
Connexion GPS ok
Exception in thread "main" java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at java.io.BufferedReader.fill(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at serveur.Serveur.main(Serveur.java:27)

at serveur.Serveur.main(Serveur.java:27)

the error comes from the line String str = in.readLine();

if its software was able to intercept the message NMEA why not my application ??

UPDATE:

I sniffed the network ,here is the result :

[the protocol used by my GPS][4]

the first packet received from the GPS (the hidden ip adress is my fixed public address ):
enter image description here

the first response from the software(1/2) (its an empty message):

enter image description here

from the software(2/2):
enter image description here

from the GPS:

enter image description here

from the soft:
enter image description here

from the GPS(1/2)(its an empty message):
enter image description here

and finally the long/lat/speed… from the GPS(2/2):
enter image description here

as I have already written, there are empty messages sent by the GPS…So here is all details.

@Peter Lawrey:I tried to read the message byte by byte but I got an error from netbeans,,,can you give me a piece of code? thanks
Hope this help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:29:58+00:00Added an answer on May 30, 2026 at 3:29 pm

    Are you sure the GPS is sending a line (ended with a new line)?

    If not I would use read() repeatedly to get all the data it sends (until an EOF is reached)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently bought a vps server with DirectAdmin installed on it. everything works fine
I bought this program that created a pretty nice imageuploader flash script however I
I bought this website template from dreamtemplate and the copyright text displays on the
i bought this php script and all the pages are in .html when I
I bought my own application from the Mac AppStore. The app was not saved
I bought and implemented this from Vatlab: - http://demo.faceconn.net/InviteFriends.aspx If you go here and
I have bought a Joomla template from Template monster. It looks like this template
I bought [this template][1], and I’m customizing it. The only problem I’ve got is
Just bought a new Macbook Pro and tried to follow this tutorial step by
I bought a book about MVC 3. In this book, there is an example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.