New GPSDriver library

schimanski

Well-Known Member
Licensed User
Longtime User
It does'n run anymore....

The problem is, that it runs until I have installed and started the GPSSettings.exe. I have tried any baudrates and I have deinstalled the GPSSettings.exe, but it doesn't run anymore. So, I think, that GPSSettings write perhaps something in the registry or other thinks, that now blocked the GPS intermidiate driver......:confused:
 

schimanski

Well-Known Member
Licensed User
Longtime User
Softreset

Hello Erel!

Yes, I have made a soft reset, but the same problem. I can try a hardreset, but it's a lot of work after that and not my own device....
 

Georg

Member
Licensed User
Longtime User
I run the gpsdriverdemo.exe on a HTC3300 WM 6.0 with internal GPS and it doesn't work, also when i change the GPS to external it doesn't work but with the old GPS and serial2 it works with the settings for external GPS.
I checkted the registry settings and compared it with other devices, i couldn't found a difference. Any idea why?
 

schimanski

Well-Known Member
Licensed User
Longtime User
Convert from decimallatitude to latitude

Hello!

The new GPSDriver.dll only works with the latitude-format as "dd.dddd". To create a NMEA-protokoll, I need the latitude and longitude in the format of the GPS.dll "ddmm.mm". I have create a very big sub with a lot of sting-function to convert the new GPS.latitude and longitude in a NMEA-format. Is there an easier way to convert these things?

best regards

schimanski
 

agraham

Expert
Licensed User
Longtime User

schimanski

Well-Known Member
Licensed User
Longtime User
That's what im looking for....

Thanks, agraham!!!

I think, that I can use both of your solutions - and your convert is much shorter than my sub.....:sign0060:
 

schimanski

Well-Known Member
Licensed User
Longtime User
Hello agraham!

I have implement your sub in my application, but it dont' works all the time.

B4X:
Sub ToDegMins(DecLatLon)
  Return Int(DecLatLon) & Format((DecLatLon - Int(DecLatLon)) * 60, "N2")
End Sub

For example: 51.2345678° is 5114.07, but 51.1345678° is only 518.07.

What do I have to do, to get the right LatLon for my NMEA-protocoll?

Thanks al lot....
 

Georg

Member
Licensed User
Longtime User
DeviceState is off

Hi,

what is wrong in this code.
It always shows that the gpsint.DeviceState is "0ff"
when i change the do while to
Do While (gpsint.SatelliteUsedCount < 4)
..
GPS runs
but it shows gpsint.DeviceState is "0ff"

what is wrong? Me, the code or the GPS :confused:

Sub Displaycheck
Label52.Width = 1
n = 1
Label51.Visible = True
Label52.Visible = True
gpsint.GetGpsData(6000)
Label51.Text = gpsint.DeviceState & " " & gpsint.ServiceState
Do While (Not(gpsint.DeviceState = "On" ) OR (gpsint.SatelliteUsedCount < 4))
gpsint.GetGpsData(6000)
Label51.Text = gpsint.DeviceState & CRLF & SatelliteUsedCount & " (" & SatellitesInViewCount & ")" & CRLF & "zu wenig Sats " & SatelliteUsedCount &
Label52.Width = n/100
DoEvents
n = n + 1
If n > 8000 Then
Timerint.Enabled = False
gpsint.close
Return
End If
Loop
..
 

agraham

Expert
Licensed User
Longtime User
what is wrong? Me, the code or the GPS :confused:
You I'm afraid, you are not getting the device data. Also that Do loop is a bad idea, it will eat processor cycles and battery life. You should use a timer with a period of about one second or longer. There is no point in checking the GPS more often than that as the data only comes in slowly so won't change very quickly.

B4X:
 Sub Displaycheck
Label52.Width = 1
n = 1
Label51.Visible = True
Label52.Visible = True
gpsint.GetGpsData(6000)
[COLOR="Red"]gpsint.GetDeviceData[/COLOR]
Label51.Text = gpsint.DeviceState & " " & gpsint.ServiceState
Do While (Not(gpsint.DeviceState = "On" ) OR (gpsint.SatelliteUsedCount < 4))
gpsint.GetGpsData(6000)
[COLOR="Red"]gpsint.GetDeviceData[/COLOR]
Label51.Text = gpsint.DeviceState & CRLF & SatelliteUsedCount & " (" & SatellitesInViewCount & ")" & CRLF & "zu wenig Sats " & SatelliteUsedCount & 
Label52.Width = n/100
DoEvents
n = n + 1
If n > 8000 Then
Timerint.Enabled = False 
gpsint.close
Return
End If
Loop
 

derez

Expert
Licensed User
Longtime User
Schimanski

The problem is the leading zero, so just add it using if. It is not as clean but works.

Sub ToDegMins(DecLatLon)
st = (DecLatLon - Int(DecLatLon)) * 60
if st < 10 then st = "0" & Format(st, "N2") else st = Format(st, "N2")
Return Int(DecLatLon) & st
End Sub
 

Georg

Member
Licensed User
Longtime User
Latitute Error

Thanks agraham,

now it works with

gpsint.GetDeviceData

but here is an other error. I get an Error Message on

If gpsint.Latitude <> gpsint.InvalidData AND gpsint.Longitude <> gpsint.InvalidData Then
lat = gpsint.Latitude
lon = gpsint.Longitude
utm() = Converter.WGS84LatLonToUTM(lat,lon)
End If

12.5543616666667,52.4029533333333,148
12.5543633333333,52.402955,148
12.5543633333333,52.402955,148
12.5543616666667,52.402955,148
12.5543633333333,52.402955,148
12.55437,52.4029566666667,148
12.55437,52.4029566666667,148
12.5543683333333,52.4029566666667,148
12.55437,52.4029566666667,148
12.5543716666667,52.40296,148
12.5543716666667,52.40296,148
12.5543716666667,52.40296,148
12.55438,522.4029766666667,148

the Mistake is the lat 522.40...

I get this error also at the app gpsdriverdemo.exe

this error was not in the old GPS.dll
 

schimanski

Well-Known Member
Licensed User
Longtime User
Convert coordinates

Thanks derez and thanks agraham!!!

I've tested your new code, agraham, with all different coordinates:

B4X:
Return Format(Int(DecLatLon),"00") & Format((DecLatLon - Int(DecLatLon)) * 60, "00.00")


It runs without any problems....:sign0060:
 

Georg

Member
Licensed User
Longtime User
Hi

the input Values are the lat and the lon in my last Message. I saved it in a file and when i get the error and cancel the program it stops on this line
utm() = Converter.WGS84LatLonToUTM(lat,lon)

perhaps that is a better way to say it

If gpsint.Latitude <> gpsint.InvalidData AND gpsint.Longitude <> gpsint.InvalidData Then
lat = gpsint.Latitude
lon = gpsint.Longitude

FileOpen (c9,"latlon.txt",cWrite,cAppend,cASCII)
textlaton = lon & "," & lon & "," & gpsint.SeaLevelAltitude
FileWrite (c9,textlaton)
FileClose (c9)
utm() = Converter.WGS84LatLonToUTM(lat,lon) 'Programm canceled here

End If

latlon.txt

12.55437,52.4029566666667,148
12.5543716666667,52.40296,148
12.5543716666667,52.40296,148
12.5543716666667,52.40296,148
12.55438,522.4029766666667,148

by the way if you use this lat/lon you can see where i liv. Thats the reason of my english :(
 
Top