Terradrones
Active Member
Hi All
I need help again please. I want to access the Service Provider (www.trignet.co.za) that has GPS Base Stations all over South Africa that transmits GPS corrections. I have registered with Trignet and have a Username and Password. I also know the IP address and Port number of Trignet.
I am trying to access the mountpoints with the following code:
It is giving me the following error:
ResponseError. Reason: java.net.ProtocolException: Unexpected status line: SOURCETABLE 200 OK, Response:
Job failed: java.net.ProtocolException: Unexpected status line: SOURCETABLE 200 OK
HTTP Status Code: -1
What does "sourcetable 200 ok" mean?
I need help again please. I want to access the Service Provider (www.trignet.co.za) that has GPS Base Stations all over South Africa that transmits GPS corrections. I have registered with Trignet and have a Username and Password. I also know the IP address and Port number of Trignet.
I am trying to access the mountpoints with the following code:
B4X:
Sub FindMountPoints
Dim su As StringUtils
Dim HttpClient As HttpJob
HttpClient.Initialize("NTRIP", Me)
' Set the NTRIP caster URL and credentials
Dim IPAddress As String = CGlobals.DF(64)
Dim Port As String = CGlobals.DF(65)
Dim NTRIP_URL As String = "http://" & IPAddress & ":" & Port '& "/caster"
Dim Username As String = CGlobals.DF(66)
Dim Password As String = CGlobals.DF(67)
ProgressDialogShow2("Searching Mount Points...", True)
Dim AuthString As String = Username & ":" & Password
Dim AuthHeader As String = "Basic " & su.EncodeBase64(AuthString.GetBytes("UTF8"))
HttpClient.Download(NTRIP_URL)
' Set headers before sending the request
HttpClient.GetRequest.SetHeader("Authorization", AuthHeader)
HttpClient.GetRequest.SetHeader("User-Agent", "Ceaser")
HttpClient.GetRequest.SetHeader("Accept", "*/*")
HttpClient.GetRequest.SetHeader("Connection", "close")
' Send the request
' HttpClient.Download(NTRIP_URL)
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success Then
CmbMountPoints.cmbBox.Clear
Dim response As String = Job.GetString
' Log("NTRIP Response: " & response)
' Process the NTRIP data here to extract mount points
Dim MountPoints As List
MountPoints.Initialize
Dim Lines() As String = Regex.Split(CRLF, response)
For Each Line As String In Lines
Log(Line)
If Line.StartsWith("STR") Then
CmbMountPoints.cmbBox.Add(Line)
' Log(Line)
MountPoints.Add(Line)
End If
Next
Log("Available Mount Points: " & MountPoints)
Else
Log("Job failed: " & Job.ErrorMessage)
Log("HTTP Status Code: " & Job.Response.StatusCode) ' Log the status code for more details
' Log("Full Response: " & Job.GetString) ' Log the full response to understand why it fails
MsgboxAsync("Mount Points Are Not Available" & CRLF & "The Server Might Be Down", "No Mount Points")
End If
Job.Release
ProgressDialogHide
End Sub
It is giving me the following error:
ResponseError. Reason: java.net.ProtocolException: Unexpected status line: SOURCETABLE 200 OK, Response:
Job failed: java.net.ProtocolException: Unexpected status line: SOURCETABLE 200 OK
HTTP Status Code: -1
What does "sourcetable 200 ok" mean?