- Notifications
You must be signed in to change notification settings - Fork105
Java Marine API - NMEA 0183 library for Java
License
ktuukkan/marine-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Java Marine API is anNMEA 0183 parserlibrary for decoding and encoding the data provided by various electronic marinedevices such as GPS, echo sounder and weather instruments.
- Generic and extentable API
- Detects NMEA 0183 sentences from most input streams
- E.g. from file, serial port, TCP/IP or UDP socket
- The provided data readers can be overridden with custom implementation
- Converts the ASCII data stream to event/listener model with interfaces and parsers forselected sentences
- Additional parsers may be added by extending the provided base classes
- This can be done at runtime and does not require compiling the library
- Sentence encoding with common validation and unified formatting
- Several sentences can be aggregated to single event by usingproviders
- For example, to record current position and depth of water
- Decoding of selectedAIS messages
- The NMEA 0183 layer ofRaymarine SeaTalk1
- Utilities and enumerations for handling the extracted data
Java Marine API is free software: you can redistribute it and/or modify itunder the terms of theGNU Lesser General Public License publishedby the Free Software Foundation, either version 3 of the License, or (at youroption) any later version.
Java Marine API is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public Licensefor more details.
You should have received a copy of the GNU Lesser General Public Licensealong with Java Marine API. If not, seehttp://www.gnu.org/licenses/.
- See also:LGPL and Java
Java Marine API is not official NMEA 0183 software. Further, it is not relatedtoNational Marine Electronics Association.
The interpretation of NMEA 0183 and related protocols is based entirely onvarying set of publicly availabledocuments in the Internet.Thus, it is not guaranteed that the library follows and implements thesestandards correctly.
Electronic devices and software do not replace safe navigation practices andshould never be your only reference.
- Java 2 SE JRE/JDK 11 or newer
- For serial port communication (choose one):
Write a listener:
classGGAListenerextendsAbstractSentenceListener<GGASentence> {publicvoidsentenceRead(GGASentencegga) {Positionpos =gga.getPosition();// .. your code }}
Set up the reader:
Filefile =newFile("/var/log/nmea.log");SentenceReaderreader =newSentenceReader(newFileInputStream(file));reader.addSentenceListener(newGGAListener());reader.start();
Manual parsing:
Stringnmea ="$GPGSA,A,3,03,05,07,08,10,15,18,19,21,28,,,1.4,0.9,1.1*3A";SentenceFactorysf =SentenceFactory.getInstance();GSASentencegsa = (GSASentence)sf.createParser(nmea);
Recommended Android Proguard settings whenminifyEnabled
is settrue
:
-keep class net.sf.marineapi.** { *; }-keep interface net.sf.marineapi.** { *; }-keepattributes MethodParameters-dontwarn gnu.io.CommPortIdentifier-dontwarn gnu.io.RXTXPort-dontwarn gnu.io.SerialPort
See also:
- Examples
- Javadocs
- Graphical User Interface using marine-api by @aitov
The following sentences are decoded and encoded. The provided parsers may beoverridden and additional parsers may be added at runtime,without compilingthe library. See wiki forinstructions.
ID | Description |
---|---|
ALK | The NMEA 0183 layer of Raymarine SeaTalk1 ($STALK ) |
APB | Autopilot cross-track error, destination bearings and heading |
BOD | Bearing from origin to destination |
CUR | Water currents information |
DBT | Water depth below transducer in meters, feet and fathoms |
DPT | Water depth in meters with offset to transducer |
DTA | Boreal GasFinder2 and GasFinderMC |
DTB | Boreal GasFinder2 and GasFinderMC |
DTM | Datum reference |
GBS | Glonass satellite fault detection (RAIM support) |
GGA | GPS fix data |
GLL | Current geographic position and time |
GNS | Glonass fix data |
GSA | Precision of GPS fix |
GST | GPS pseudorange noise statistics |
GSV | Detailed GPS satellite data |
HDG | Heading with magnetic deviation and variation |
HDM | Magnetic heading in degrees |
HDT | True heading in degrees |
HTC | Heading/Track control systems input data and commands. |
HTD | Heading/Track control systems output data and commands. |
MDA | Meteorological composite |
MHU | Relative and absolute humidity with dew point |
MMB | Barometric pressure |
MTA | Air temperature in degrees Celcius |
MTW | Water temperature in degrees Celcius |
MWD | Wind speed and direction. |
MWV | Wind speed and angle |
OSD | Own ship data |
RMB | Recommended minimum navigation information "type B" |
RMC | Recommended minimum navigation information "type C" |
ROT | Vessel's rate of turn |
RPM | Engine or shaft revolutions |
RSA | Rudder angle in degrees |
RSD | Radar system data |
RTE | GPS route data with list of waypoints |
TLB | Target label |
TTM | Tracked target message |
TXT | Text message |
VBW | Dual ground/water speed. |
VDM | The NMEA 0183 layer of AIS: other vessels' data |
VDO | The NMEA 0183 layer of AIS: vessel's own data |
VDR | Set and drift |
VHW | Water speed and heading |
VLW | Distance traveled through water |
VTG | Course and speed over ground |
VWR | Relative wind speed and angle |
VWT | True wind speed and angle |
WPL | Destination waypoint location and ID |
XDR | Transducer measurements |
XTE | Measured cross-track error |
ZDA | UTC time and date with local time offset |
The followingAISmessages are decoded.
ID | Description |
---|---|
01 | Position Report Class A |
02 | Position Report Class A (Assigned schedule) |
03 | Position Report Class A (Response to interrogation) |
04 | Base Station Report |
05 | Static and Voyage Related Data |
09 | Standard SAR Aircraft Position Report |
18 | Standard Class B CS Position Report |
19 | Extended Class B Equipment Position Report |
21 | Aid-to-Navigation Report |
24 | Static Data Report |
27 | Position Report for long range applications |
Not to be confused with SeaTalkng derived from NMEA 2000.
Only the NMEA layer is currently supported, seeSTALKSentenceandIssue #67.
The followingu-bloxvendor extension messages are supported:
ID | Description |
---|---|
PUBX,01 | Lat/Long Position Data |
PUBX,03 | Satellite Status |
Releases and snapshots are published every now and then, but there is no clearplan or schedule for this as most of the development happens per user requestsor contribution.
Release JARs may be downloaded fromreleasesandSourceforge.net.The ZIP package should contain all to get you going.
The project was first published in Sourceforge, hence thenet.sf.marineapi
package naming.
Both releases and snapshots are deployed toMaven Central Repositoryand may be imported by adding the following dependency in yourpom.xml
.
<dependency> <groupId>net.sf.marineapi</groupId> <artifactId>marineapi</artifactId> <version>0.10.0</version> <type>bundle</type></dependency>
The snapshots should be mostly stable, but they are stillWork In Progress andshould be considered as a preview of the next release.
Seechangelog.txt for the currentSNAPSHOT
version. Notice thatyou may need to tweak yourMaven settingsto enable snapshot dependencies.
<dependency> <groupId>net.sf.marineapi</groupId> <artifactId>marineapi</artifactId> <version>0.11.0-SNAPSHOT</version> <type>bundle</type></dependency>
Snapshots may also be downloaded manually from therepository.
Any feedback or contribution is welcome. You have several options:
- Contact me
- Report a bug
- Fork and open apull requestto share improvements.
All information and specifications for this library has been gathered from thefollowing documents, availability last checked on 2020-03-15.
Notice: any warnings regarding the accuracy of the information in belowdocuments apply equally to Java Marine API.
- Amendment to NMEA 0183 v4.10 # 20130814
- Amendment to NMEA0183 v4.10 # 20130815
- Amendment to NMEA0183 v4.10 # 20131216
- Approved 0183 Manufacturer's Mnemonic Codes
- Manufacturer Mnemonic Codes and Sentence Formatters List
- NMEA 0183 Sentences Not Recommended for New Designs
- Standards Update October 2014 by Steve Spitzer
- BD9xx GNSS Receivers Help by Trimble Navigation Limited
- Guide for AgGPS Receivers by Trimble Navigation Limited
- Hydromagic NMEA 0183 documentation by Eye4Software
- NM-2C User's Guide by Nuova Marea Ltd
- PB100 WeatherStation Manual by Airmar
- RT Intertial+ NMEA Description (rev. 100720) by Oxford Technical Solutions Ltd
- SeaTalk/NMEA/RS232 Converter Manual by gadgetPool
- SiRF NMEA Reference Manual by SiRF Technology, Inc.
- The NMEA Information Sheet by Actisense
- ZED-F9P F9 high precision GNSS receiver Interface Description by u-blox
- AIVDM/AIVDO protocol decoding by Eric S. Raymond
- NMEA Revealed by Eric S. Raymond
- SeaTalk Technical Reference by Thomas Knauf
- NMEA Data by Dale DePriest
- NMEA Sentence Information by Glenn Baddeley (not found)
- RS232/SeaTalk/NMEA Converter manual by gadgetPool (not found)
- The NMEA FAQ by Peter Bennett (seeolder copy)