Connecting NMEA data from android phone to a PC via USB
Recorded Video about the project Idea and how to use and run it --> link
- Download this Repository to your local machine
Installation of Share GPS app
- Download and install share GPS app from google play
- In Share GPS, create a new connection for NMEA USB. The default port of 50000 should be fine for most.
- Allow developer mode in android then alow USB debugging.
Installation of com0com
- Install com0com
- Open setup of com0com and change the first textbox to COM15 like in the photo below
- Click apply then close this windows
Installation of StandAlone ADB
- Install this .exe
Installation of com2tcp
- Copy all items in this folder to where ADB is installed (propably C:\Program Files (x86)\Minimal ADB and Fastboot)
- Copy gps.bat to (ADB Folder) then create a shortcut of this gps.bat to desktop to be accessed easily.
- Install JDK 8 x86 version as there are problem inversion x64 of rxtx library
- Open netbeans.conf in C:\Program Files\NetBeans 8.2\etc
- Change the following line
netbeans_jdkhome="put you jdk x86 here"
- Open netbeans and run Carmeter.java
Their jars are all included (no need to download anything other than this repository).
you may refer to this website to see Nmea sentence structure
**Assume those sentences are the output:**
**First One is:**
$GPGGA,181908.00,3404.7041778,N,07044.3966270,W,4,13,1.00,495.144,M,29.200,M,0.10,0000*40
- GPGGA --> represent GPS and it might be GL which denotes GLONASS (Global Navigation Satellite System)
- 181908.00 --> Time stamp for UTC (Coordinated Universal Time) 18 hour 19 minute and 08 second , for Egypt +2 which means 20h 19m 08s
- 3404.7041778,N --> is the latitude in DMM.MMMMM format in degrees, minutes and decimal minutes (34 degree 04.7041778 N)
- 07044.3966270,W --> is the longitude (70 deg 44.3966270 W)
- 4 --> position of quality and vary from 0 to 8: 0= invalid 1=GPS fix( SPS) 2=DGPS fix 3=PPs fix 4= Real Time Kinematic (Centimeter precicion) 5=float Real Time Kinematic (decimeter precicion) 6=estimated (dead reckoning 2.3 feature) 7=Manual input mode 8=Simulation mode
- 13 --> denotes number of satellites used in the coordinate
- 1.00 --> denotes the HDOP (horizontal dilution of position)
- 495.144,M --> altitud, meters, above sea level
- 29.200,M --> Height of geoid separation (geoid means ocean leve) subtract this from the altitude of the antenna to arrive at the height above Ellipsoid
- 0.10 --> time in seconds since last DGPS update
- 0000 --> DGPS station ID number
- 40 --> checksum data
NOTE: DGPS (Differential GPS): is essentially a system to provide positional corrections to GPS signals. DGPS uses a fixed, known position to adjust real time GPS signals to eliminate pseudorange errors, DGPS corrections improve the accuracy of position data only. it has no effect on results that are based on speed data, such as brake stop results. for more information about DGPS you can visit website
**Second One is:**
*$GPGLL,4916.45,N,12311.12,W,225444,A,1D
-
GLL --> Geographic position, Latitude and Longitude
-
4916.45,N --> Latitude 49 deg. 16.45 min. North
-
12311.12,W --> Longitude 123 deg. 11.12 min. West
-
225444 --> Fix taken at 22:54:44 UTC
-
A --> Data Active or V (void)
-
*1D --> checksum data
**Third One is:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
- RMC --> Recommended Minimum sentence C
- 123519 --> Fix taken at 12:35:19 UTC (convert according to time zone, for Egypt UTC+2)
- A --> Navigation receiver warning A = OK (means that you are getting a signal and things are working), V = warning (means you do not have a signal)
- 4807.038,N --> Latitude 48 deg 07.038' minutes Northern Hemishpere
- 01131.000,E --> Longitude 11 deg 31.000' minutes in Eastern Hemisphere
- 022.4 --> Speed over the ground in knots
- 084.4 --> Track angle in degrees True
- 230394 --> Date - 23rd of March 1994 (Day , Month , Year)
- 003.1,W --> Magnetic Variation 3.1 deg West
- *6A --> The checksum data & always begins with *
- Add Medusa library to libraries (Medusa.jar)
- Make CSS Package include css.css file (css file include the colors codes for Buttons and linear-gradient for background).
- Make 3 Buttons start(to start reading speed and position), stop and sound off (turn off the alarm speed over 20K).
- Set Action for each Button
- Set color and area for each Button
- Make gauge to display the speed
- Make GridPane to add the objects(like Buttons ,gauge,..)
- Make 3 Labels (longitude – latitude – Speed)
- Make 3 Text to show the values for longitude,latitude and speed
- Set the position for Buttons, gauge,Labels,Text
- Make HBox and add Map and your gridPane on it
- Make StackPane to add background to your GUI
- put your stackPane on scene
- Then put the scene on Stage
- Rename the Stage
- Make a GPS icon for stage