-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can i decode TYPE AIVDO Message? #27
Comments
Hey, it seems that there is a bug in the library. Currently it raises an error if no Channel is given. Which is actually correct for AIVDM messages. But it is not correct for AIVDO messages. I fill fix it. Kind regards, |
The bug is fixed in the newest version of pyais ( Update with:
|
the print message just like this:MessageType1(msg_type=1, repeat=0, mmsi='247061100', status=<NavigationStatus.UnderWayUsingEngine: 0>, turn=0, speed=1.2, accuracy=0, lon=23.268065, lat=37.900988, course=273.0, heading=258, second=48, maneuver=<ManeuverIndicator.NotAvailable: 0>, spare=0, raim=False, radio=34527) |
Hey @tangchenggang I added an example for you: """
The following example shows how you could write the decoded data to CSV.
You first need to decode the data into a dictionary and then write the
dictionary to a CSV file using a `DictWriter`.
"""
import csv
from pyais import decode
ais_msg = "!AIVDO,1,1,,,B>qc:003wk?8mP=18D3Q3wgTiT;T,0*13"
data_dict = decode(ais_msg).asdict()
with open('decoded_message.csv', 'w') as f:
w = csv.DictWriter(f, data_dict.keys())
w.writeheader()
w.writerow(data_dict) |
l try to decode it but failed. But I can decode in https://www.aggsoft.com/ais-decoder.htm
did i make something wrong?
The text was updated successfully, but these errors were encountered: