Gps library

wm.chatman

Well-Known Member
Licensed User
Longtime User
hi:)
just a Q: with the GPS library (gps.dll) we have the option to use Sats in View.
there is no way to get sats Used, with this dll.
The GPSDriver.dll has both options. So, is it possible to get a Sats Used with the Gps.dll?

Thx for all answers.

Best regards,
WmC
 

derez

Expert
Licensed User
Longtime User
Yes there is, but it is using the satellites data by checking the messages which include this information, not as a direct use of GPS library.

You get the string of data by the serial library (serial2)
Serial.InputString

Then look at messages which start with $Gpgsa:
$GPGSA
GPS DOP and active satellites

eg1. $GPGSA,A,3,,,,,,16,18,,22,24,,,3.6,2.1,2.2*3C
eg2. $GPGSA,A,3,19,28,14,18,27,22,31,39,,,,,1.7,1.0,1.3*35

1 = Mode:
M=Manual, forced to operate in 2D or 3D
A=Automatic, 3D/2D
2 = Mode:
1=Fix not available
2=2D
3=3D
3-14 = IDs of SVs used in position fix (null for unused fields)
15 = PDOP
16 = HDOP
17 = VDOP

The info taken from this link GPS - NMEA sentence information

check this link to see my application for satellites position and other data. http://www.b4x.com/forum/share-your-creations/1669-gps-satellites-map-data.html#post9075
 
Last edited:

wolfgang

Member
Licensed User
Longtime User
Gps library - GPSSerial

Maybe you can use the GPSSerial lib: gps.SatelliteUsedCount
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
i tried to implement
Sub GPS_GPSDecoded '''This is the variable that holds the GPS direction!!!
imgSatelliteoff.Visible=False
imgSatelliteon.Visible=True
lblService.Text = "Fix:3D"
lblAlti.Text = GPS.Altitude '''Shows the Altitude in Meters'''
lblTM.Text = GPS.UTCTime
lblSatsUsed.Text = gps.SatelliteUsedCount <<< does not show used sats >>>
lblSatellites.Text = GPS.NumberOfSatellites '''Shows theNumberOfSatellites'''

is it possible to implement this a different way?
 

agraham

Expert
Licensed User
Longtime User
lblSatsUsed.Text = gps.SatelliteUsedCount <<< does not show used sats >>>
It looks like you are using the GPS library so it won't as there is no such property - have you tried optimising compiling it? It will probably show an error. As Wolfgang says, you should try the http://www.b4x.com/forum/additional-libraries/3327-gpsserial-library.html#post18685 which has both SatellitesInViewCount and SatellitesUsedCount properties. It also gives you easy access to the NMEA sentences should you need it.
 

wolfgang

Member
Licensed User
Longtime User
Hi,
here is a little app which shows how to use the GPSSerial.dll and how to pars the GGA sentence. I wrote this for testing the better accuracy since EGNOS is on. Modify the UTM coordinates for your own purpos. If you don't have any known coordinates you can take the average of about 100 counts.
 

Attachments

  • egnos.sbp
    5.5 KB · Views: 201

wm.chatman

Well-Known Member
Licensed User
Longtime User
danke dir wolfgang:)
ich verwende das kleine programm GPS4PPC und moechte nur ein was mit einbinden. Und zwar SatsUsed. Wie kann ich das implementieren bitte?
Gibt es eine moeglichkeit?

beste gruesse
WmC
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
@Wolfgang/GPSSerial.dll

hi Wolfgang

eine frage bitte. Ich benoetige nur ein paar zeilen von diesen Open Source.
aber leider klapt dies noch nich ganz.Verwende GPS library in meiner GPS App.
Moechte auch diesen beibehalten. Kann ich GPSSerial.dll mit hinzufuegen, ohne den Source Code zu aendern?
Wenn ja, welchen teil des Source Code wird hierfuer verwendet?

Danke Dir im voraus
Best regards to all
Wmc

PS. the gps algos are not really my thing.
 

Attachments

  • UtmSoll - Ist.JPG
    UtmSoll - Ist.JPG
    22.3 KB · Views: 180

wm.chatman

Well-Known Member
Licensed User
Longtime User
hi Wolfgang

eine frage bitte. Ich benoetige nur ein paar zeilen von diesen Open Source.
aber leider klapt dies noch nich ganz.Verwende GPS library in meiner GPS App.
Moechte auch diesen beibehalten. Kann ich GPSSerial.dll mit hinzufuegen, ohne den Source Code zu aendern?
Wenn ja, welchen teil des Source Code wird hierfuer verwendet?

Danke Dir im voraus
Best regards to all
Wmc

PS. the gps algos are not really my thing.[/Hello Klaus]
 

wolfgang

Member
Licensed User
Longtime User
Gps Dll

Hi,
gps.NumberOfSatellites = sats used and not sats in view. I've tested this with the following code which makes no sence and I'm really surprised that it works:
B4X:
Sub Globals
   'Declare the global variables here.
End Sub

Sub App_Start
   Form1.Show
   gps.New1 'GPS DLL
   gpsserial.New1 'GPSSerial DLL
   gpsserial.Open("Com15",38400) 'please modify
   gpsserial.NMEAOpen
   Timer1.Interval = 1000
   Timer1.Enabled = True
   TimeFormat("HH:mm:ss")
End Sub

Sub Timer1_Tick
   If gpsserial.GetGpsData(2000) = True Then 
      gps.GPSStream(gpsserial.NMEAReadString) '!!!!!?????
      Show
   End If
End Sub

Sub Show
      ListBox1.Clear
      ListBox1.Add("Number of satellites in view: " & gpsserial.SatellitesInViewCount) 'from GPSSerial DLL
     ListBox1.Add("Number of satellites used: " & gpsserial.SatelliteUsedCount) 'from GPSSerial DLL
     ListBox1.Add("Number of satellites used: " & gps.NumberOfSatellites) 'from GPS DLL
     ListBox1.Add("Time: " & Time(gpsserial.Time)) 'from GPSSerial DLL
End Sub

Sub Form1_Close
   gpsserial.Close
   gpsserial.NMEAClose
   Timer1.Enabled = False
End Sub

It's better to switch to the GPSSerial DLL
 

agraham

Expert
Licensed User
Longtime User
gps.GPSStream(gpsserial.NMEAReadString) '!!!!!?????
I would expect that to work. GPSStream takes a string and adds it to an internal buffer then tries to parse it into NMEA sentences. Normally the string would come fromSerial.InputString but as it is a string it can come from anywhere and GPSSerial.NMEAReadString is in fact doing exactly what Serial.InputString does in returning successive reads of the data stream from the GPS.
It's better to switch to the GPSSerial DLL
:)
 
Last edited:

wm.chatman

Well-Known Member
Licensed User
Longtime User
The >>>GPS4PPC<<< application uses SerialDevice.dll and SerialDesktop.dll libraries.
Ok i tried the open source that Wolfgang had posted, and see there i did not have problems at all with that. only the first

1-3 seconds of SatsInView = .9999??? After 3 sec. i had positive SatsInView.
When i added the GPSSerial.dll to the GPS4PPC application it dit not work. So, do i need to replace the SerialDevice.dll /

SerialDesktop.dll libraries with the GPSSerial.dll in the GPS4PPC application? Or can i keep, and add GPSSerial.dll???
Now i am a little Confused. What am i doing wrong here?

Thx for all hlp.

Best regards to all
WmC
 

agraham

Expert
Licensed User
Longtime User
1-3 seconds of SatsInView = .9999???
It should be negative 9999, that is the value of GPSSerial.InvalidData.

When i added the GPSSerial.dll to the GPS4PPC application it dit not work.
GPSSerial is not a drop in replacement for the GPS/Serial combination but it is a totally compatible superset of GPSDriver. It has different properties and methods to GPS so the code will need modifying to use it. You do not need the GPS and Serial libraries in a GPSSerial based project.
 

wm.chatman

Well-Known Member
Licensed User
Longtime User
:)Hi Mr. Agraham
I hope all is well with you.
Thx for your responce, and I sincerely appreciate the time and effort of everyone who responded to my questions.

Best regards to all
Wmc
 
Top