AISHub Forum

AIS Technology => Software development => Topic started by: pwillemann on 05 April, 2017, 06:51:26 pm

Title: AIS Newbie - Timestamps from the NMEA Sample
Post by: pwillemann on 05 April, 2017, 06:51:26 pm
I have been asked to retrieve AIS messages from the NMEA Sample data (http://www.aishub.net/nmea-sample.php (http://www.aishub.net/nmea-sample.php)) which contains about 3 minutes of data.  I used a third party program https://github.com/dma-ais/AisLib (https://github.com/dma-ais/AisLib) and can successfully get the AIS messages.  For now, I am only interested in AIS message #1.  I need to extract some fields from the message and send them to another program.  This program requires a timestamp and I am not really sure how to get timestamps from the sample data.  Am I suppose to use an AIS message #4 to get the basic time and then use the UTCSec field in the AIS message #1?  What if my data set doesn't immediately have an AIS message #4?  Am I suppose to read the sample data twice?  Any help would be appreciated.


Thanks
Phil
Title: Re: AIS Newbie - Timestamps from the NMEA Sample
Post by: malcolmh on 07 April, 2017, 09:13:16 am
Full UTC date/time data is to be found in Base station reports, of which there are a few in the sample. Ship position reports only give the seconds after the UTC minute in their timestamps. To determine the full time, it will be necessary to fast forward to the Base Station report to get the date, hour & minute for the preceding messages.