M0r13n / pyais

AIS message decoding and encoding in Python (AIVDM/AIVDO)
MIT License
176 stars 61 forks source link

Stream from serial/COM port #106

Closed CharlieKay2163 closed 1 year ago

CharlieKay2163 commented 1 year ago

Is there a way to process the incoming stream of data from a serial/COM port similar to the TCP and UDP examples?

M0r13n commented 1 year ago

It’s definitely possible. But you need to implement the actual logic to read the raw messages from the serial port by yourself. The actual decoding can then be done by pyais.

I don’t have a serial device, therefore I can not provide you with any sample code.

Did you take a look at pyserial? It looks promising: https://pyserial.readthedocs.io/en/latest/shortintro.html

CharlieKay2163 commented 1 year ago

Thanks that seems to be working great.