Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't get messages with Ntrip user. Java GoGPS #38

Open
RaulGPS opened this issue Apr 8, 2022 · 3 comments
Open

Couldn't get messages with Ntrip user. Java GoGPS #38

RaulGPS opened this issue Apr 8, 2022 · 3 comments

Comments

@RaulGPS
Copy link

RaulGPS commented Apr 8, 2022

Hi!

We are a researcher team trying to correct the mobile position with Ntrip and data from sattelites.

We saw your open code some weeks ago and it helped to connect through Ntrip. One problem we have is that we can get connected to the public interface with no user and get some messages which we have decodified. When we try to connect with our own user we are able to do it but it does not go through a condicional similar you have in your
code line 726 in goGPS_Java/src/main/java/org/gogpsproject/producer/parser/rtcm3/RTCM3Client.java

I don't know if you could have any idea why this is happening has the only error reported is Connetion reset.

This is te part of the code where we have the problem we think.

Also, one question we have, it is, if goGPS corrects the positions or the observations from the rover when it corrects in RTK.

Thank you in advanced.

@ZiglioUK
Copy link
Member

We saw your open code some weeks ago and it helped to connect through Ntrip. One problem we have is that we can get connected to the public interface with no user and get some messages which we have decodified. When we try to connect with our own user we are able to do it but it does not go through a condicional similar you have in your code line 726 in goGPS_Java/src/main/java/org/gogpsproject/producer/parser/rtcm3/RTCM3Client.java

I'm sorry I don't understand what you mean. Do you have a stack trace and some example code? I haven't used RTCM myself but happy to look into it.

@RaulGPS
Copy link
Author

RaulGPS commented Apr 11, 2022

Hi Ziglio, yes, the part of the code where we are stuck is this one:

                    try(Socket socket = new Socket(casterIp, port)){
                        OutputStream output = socket.getOutputStream();
                        PrintWriter writer = new PrintWriter(output, true);
                        input = socket.getInputStream();
                        InputStreamReader inRead = new InputStreamReader(input);
                        BufferedReader reader = new BufferedReader(inRead);
                        Log.e("crea ", "bufferedreader");

                        writer.println("GET /"+ mountPoint.getName()+" HTTP/1.1");
                        //writer.println("GET / HTTP/1.1");
                        writer.println("Host: "+ casterIp);
                        writer.println("Ntrip-Version: Ntrip/1.0");
                        writer.println("User-Agent: NTRIP NtripClient/1.0");
                        writer.println("Accept: */*");
                        writer.println("Connection: close");
                        writer.println("Authorization: Basic " + base64);
                        writer.println(NMEAJaen);

                        writer.flush();
                        String line;
                        int c;
                        int i = 0;
                        online = true;

                        while ((line = reader.readLine()) != null){
                            Log.e("in ", "while");
                            c = input.read();
                            if(c == 211){
                                Object o = readMessage(input);
                            }
                        }

                        //input.read();
                        Log.e("Termina ","termina");

                        reader.close();
                        inRead.close();
                        writer.close();

                    } catch (UnknownHostException ex){
                        Log.e("Server not found: ", ex.getMessage());
                    } catch (IOException ex){
                        Log.e("I/O error: ",ex.getMessage());
                    }
                }
            }catch(IOException e){
                e.printStackTrace();
            }

We are able to establish connection, has we get the connection confirmation message, but it never goes through the condicional c=211 and after some minutes we get the error Connection reset.

As I said in the previous comment, we are able to connect without problems with the public identification and we could work with some messages, but not with a private configuration.

Do you know what could be the problem?

Thank you again.

@ZiglioUK
Copy link
Member

Is this a different issue from the other one? #39
Maybe it would be useful to look at this code too: https://gitlab.com/TeamGEOLOC/geolocpvt/-/blob/master/gogps/src/main/java/org/gogpsproject/producer/parser/rtcm3/RTCM3Client.java

It looks like you guys are trying to run it on Android too.
I'm still trying to figure it out how to create an RTCM account. Do you have a link for me? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants