aisstream / issues

8 stars 3 forks source link

Reading Binary Data #58

Open PravinRautNatpower opened 11 months ago

PravinRautNatpower commented 11 months ago

I am not able to read the binary message in Python

SingleSlotBinaryMessage/GnssBroadcastBinaryMessage

Is there a way to read binary messages? what is the format of binary message

PravinRautNatpower commented 10 months ago

@aisstream : Did you get chance to look inot this

aisstream commented 10 months ago

Here is a link to how the binary data is formatted https://navcen.uscg.gov/ais-single-slot-binary-message25.

This link is also helpful https://arundaleais.github.io/docs/ais/ais_decoder_binary.html as it contains more detailed information,.

Proton-Fjordson commented 3 months ago

Hello @PravinRautNatpower,

Did you get a chance to get it working? I'm just starting to try and decode Payload data using Python. You may be able to get me up to speed.

So far I've saved locally some payload strings I got from MultiSlotBinaryMessage. For instance : payload = "\u0001\u0001\u0001\u0001\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0000\u0001\u0001\u0001\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0001\u0001\u0001\u0001\u0000\u0001\u0000\u0000\u0001\u0001\u0000\u0001\u0000\u0000\u0001\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0001\u0000\u0001\u0001\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0001\u0000\u0001\u0001\u0000\u0001\u0001\u0000\u0001\u0001\u0001\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0000\u0001\u0001"

Which I translated back to bytes: byte_payload = bytes(payload , encoding="utf-8") I then manually tried to make sense of it by manually splitting the bytes to 6-long bytes like: ['111101', '100000', '001111', '001010', '100111', '011100', '001101', '011111', '101001', '000001', '000111', '101001', '101001', '101011', '100001', '011100', '010111', '010101', '110010', '011011', '011011', '100001', '100111', '111011']

I then tried to make some sense of it by manually getting it back to ASCII using Table 47 of ITU-R M.1371-5 page 108. But failed to make any sense of it.

I guess I'm missing some steps. If anyone has some keys to help me that would be nice!

PravinRautNatpower commented 7 hours ago

No @Proton-Fjordson , I didn't invest much time in that later , did you manage to get data?