Sending AIS to APRS.FI

658 views
Skip to first unread message

Jeremy W

unread,
Mar 4, 2022, 2:27:04 PM3/4/22
to aprs.fi
Hi,

Can anyone help me figure out why I can't get ship names into aprs.fi? Only the MMSI shows up on the aprs.fi map when I send position reports.

Here's a sample of the post body and the aprs.fi response:
POST: {"encodetime": "20220303172042", "protocol": "jsonais", "groups": [{"path": [{"name": "N4JSW", "url": "http://aprs.fi/jsonais/post/********"}], "msgs": [{"msgtype": 1,
"mmsi": 367692890, "lon": -85.66437833333333, "lat": 38.315648333333336, "speed": 0.0, "course": 151.4, "heading": 36, "status": 0, "rxtime": "20220303172042", "shipname": "L
ESTER CRUSE", "shiptype": 56, "callsign": "WDI3882", "draught": 2.7, "length": 211, "width": 34, "ref_front": 196, "ref_left": 15}]}]}
RESPONSE {'protocol': 'jsonais', 'command': 'post', 'result': 'ok', 'description': 'received jsonais POST successfully'}

And here's a view of my area where I'm uploading AIS traffic:

I started with ais_json.py from github, but it seemed to never pick up any packets with shipnames. So I've re-written it to use pyais.stream (also found on GitHub). It caches the ship info packets into redis, and looks them up each time it gets a new position packet.

Heikki Hannikainen

unread,
Mar 6, 2022, 8:44:38 AM3/6/22
to aprs.fi

Hi,

msgtype 1 (position report) in the AIS protocol does not include ship
names, so it is not parsed out. msgtypes 5 and 24 contain detailed ship
data.

The url field in the path should not be the private/secret URL used to
perform the data upload. It can point to an information page for the
receiver, and aprs.fi will publish that URL at
https://aprs.fi/page/ais_sites :)
> --
> You received this message because you are subscribed to the Google Groups "aprs.fi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to aprsfi+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/aprsfi/714dd597-b581-4811-9267-91839462ccacn%40googlegroups.com.
>
>

- Hessu

Jeremy W

unread,
Mar 6, 2022, 11:40:30 AM3/6/22
to aprs.fi
Hi Hessu,
Thank you very much for the reply!
Looks like I made some wrong assumptions based on my "reverse engineering" the ais_json.py script I found on GitHub. 
I thought that URL data was odd. Also I had my script just caching the ship info, and not uploading type 5 msgs, I'm going to change that now.

Cheers,

Jeremy

Jeremy W

unread,
Mar 6, 2022, 3:48:48 PM3/6/22
to aprs.fi
Looks like it's working!  Sending the type 5 packets was what I needed.
I'll get my script put up on my GitHub soon once I clean it up, hopefully others will find it useful.

Thanks again!

Jeremy


On Sunday, March 6, 2022 at 8:44:38 AM UTC-5 Heikki Hannikainen wrote:

Gregory Badilla

unread,
Mar 9, 2022, 2:47:54 PM3/9/22
to aprs.fi
Hi there,

Please let us know once you post your script. I'm using  Pi3, AISdispatcher and a DAISy hat but no luck to upload the data to APRS net.
 I will appreciate the help. 

Thank you!

Jan - PA4J

unread,
May 1, 2022, 3:46:03 PM5/1/22
to aprs.fi
Any updates on this topic ? Any source available on github ? Want to share AIS data from my receiver. GNUAis only accepts sound, I use RTL_AIS which provides a datastream which I feed to AIS dispatcher. Would be nice if aprs.fi accepted UPD datastream data from AISDispatcher directly

Thank you ! 73 Jan PA4J
Op woensdag 9 maart 2022 om 20:47:54 UTC+1 schreef gregory...@gmail.com:

Jan - PA4J

unread,
May 1, 2022, 3:46:34 PM5/1/22
to aprs.fi
change in code needed for python3 :

post = json.dumps(output)
   #print what's posted
    print (post)
    try:
      r = requests.post(URL, files={'jsonais': (None, post)})
      #dump non common packets for debugging
      if parsed['id'] not in (1,2,3,4):
        print ('Error')
        print (colored('-- Uncommon packet recieved\n', 'red'))
        print (colored('id:', 'green'), parsed['id'])
        print (colored('NMEA:', 'green'), parsed['nmea'])
        print (colored('Parsed:', 'green'), parsed)
        print (colored('Post:', 'green'), post)
        print (colored('Result:', 'green'), json.loads(r.text)['description'])
    except requests.exceptions.RequestException as e:
      print (e)

Op woensdag 9 maart 2022 om 20:47:54 UTC+1 schreef gregory...@gmail.com:
Hi there,

Gregory Badilla

unread,
Jul 18, 2022, 12:38:46 PM7/18/22
to aprs.fi
Hi Pat

I´m not proficient with code, where I need to add this lines of python code? Would you please explain me how to do it? I have been stuck without any luck to upload the  information from AIS dispatcher to APRS, I will appreciate your help! Thank you.

Gregory Badilla

unread,
Jul 18, 2022, 12:38:55 PM7/18/22
to aprs.fi
I just want to confirm that the code shared by  PAT  works!



You need to modify the next code lines from the file /ais_json.py

change in code needed for python3 :

post = json.dumps(output)
   #print what's posted
    print (post)
    try:
      r = requests.post(URL, files={'jsonais': (None, post)})
      #dump non common packets for debugging
      if parsed['id'] not in (1,2,3,4):
        print ('Error')
        print (colored('-- Uncommon packet recieved\n', 'red'))
        print (colored('id:', 'green'), parsed['id'])
        print (colored('NMEA:', 'green'), parsed['nmea'])
        print (colored('Parsed:', 'green'), parsed)
        print (colored('Post:', 'green'), post)
        print (colored('Result:', 'green'), json.loads(r.text)['description'])
    except requests.exceptions.RequestException as e:
      print (e)



THANKS A LOT!!!
El domingo, 1 de mayo de 2022 a las 13:46:34 UTC-6, Jan - PA4J escribió:

Brian

unread,
Dec 15, 2024, 2:10:00 PM12/15/24
to aprs.fi
Can someone please look over this and tell me why I keep getting these errors? I have to restart the script and it run for a bit then error out. I X out my upload info.

Linux AISpi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64


The programs included with the Debian GNU/Linux system are free software;

the exact distribution terms for each program are described in the

individual files in /usr/share/doc/*/copyright.


Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent

permitted by applicable law.

Last login: Tue Dec 10 20:11:50 2024

pi@AISpi:~ $ cd ais_json

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004043", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 4093, "rxtime": "20241213004043", "lon": 181.0, "lat": 91.0, "speed": 102.30000305175781, "course": 360.0, "heading": 511                                       , "status": 0}]}]}

{"encodetime": "20241213004043", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 24, "mmsi": 338467332, "rxtime": "20241213004043", "partno": 0, "shipname": "OYSTER@@@@@@@@@@@@@@"}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004208", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 366838630, "rxtime": "20241213004208", "lon": -85.70604, "lat": 30.136693333333334, "speed": 13.600000381469727, "course"                                       : 57.70000076293945, "heading": 55, "status": 0}]}]}

{"encodetime": "20241213004212", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 4093, "rxtime": "20241213004212", "lon": 181.0, "lat": 91.0, "speed": 102.30000305175781, "course": 360.0, "heading": 511                                       , "status": 0}]}]}

{"encodetime": "20241213004216", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004216", "lon": -85.70433333333334, "lat": 30.16933, "speed": 0.0, "course": 360.0, "headin                                       g": 511, "status": 0}]}]}

{"encodetime": "20241213004218", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004218", "lon": -85.72735166666666, "lat": 30.176008333333332, "speed": 0.0, "course": 277.                                       20001220703125, "heading": 511, "status": 9}]}]}

{"encodetime": "20241213004221", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 1, "mmsi": 367307280, "rxtime": "20241213004221", "lon": -85.73376666666667, "lat": 30.183858333333333, "speed": 0.0, "course": 321.                                       8999938964844, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004222", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "ms                                       gs": [{"msgtype": 18, "mmsi": 338455211, "rxtime": "20241213004222", "lon": -85.72751166666667, "lat": 30.145615, "speed": 0.0, "course": 360.0, "head                                       ing": 511}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004304", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004304", "lon": -85.70433333333334, "lat": 30.169343333333334, "speed": 0.0, "course": 36                                       0.0, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004306", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004306", "lon": -85.72735666666667, "lat": 30.176006666666666, "speed": 0.0, "course": 27                                       7.20001220703125, "heading": 511, "status": 9}]}]}

{"encodetime": "20241213004308", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 24, "mmsi": 368086550, "rxtime": "20241213004308", "partno": 0, "shipname": "MAKIN MEMORIES@@@@@@"}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004431", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 24, "mmsi": 368166380, "rxtime": "20241213004431", "partno": 0, "shipname": "STILL DREAMIN       "}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004450", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 24, "mmsi": 368141280, "rxtime": "20241213004450", "shiptype": 37, "partno": 1, "callsign": "WDL5460", "vendorid": "GRMD@@E", "ref                                       _front": 10, "ref_left": 2}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004536", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004536", "lon": -85.72735, "lat": 30.176, "speed": 0.0, "course": 278.1000061035156, "hea                                       ding": 511, "status": 9}]}]}

{"encodetime": "20241213004540", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367307280, "rxtime": "20241213004540", "lon": -85.73374833333334, "lat": 30.18386, "speed": 0.0, "course": 301.79998779                                       296875, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004542", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 4093, "rxtime": "20241213004542", "lon": 181.0, "lat": 91.0, "speed": 102.30000305175781, "course": 360.0, "heading": 5                                       11, "status": 0}]}]}

{"encodetime": "20241213004545", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004545", "lon": -85.70436666666667, "lat": 30.169336666666666, "speed": 0.0, "course": 36                                       0.0, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004550", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 369493633, "rxtime": "20241213004550", "lon": -85.72703833333334, "lat": 30.133476666666667, "speed": 6.699999809265137                                       , "course": 111.4000015258789, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004550", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 366838630, "rxtime": "20241213004550", "lon": -85.69263, "lat": 30.144668333333332, "speed": 13.800000190734863, "cours                                       e": 48.5, "heading": 43, "status": 0}]}]}

{"encodetime": "20241213004556", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 18, "mmsi": 368141280, "rxtime": "20241213004556", "lon": -85.73752333333333, "lat": 30.151953333333335, "speed": 0.0, "course": 3                                       60.0, "heading": 511}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined

pi@AISpi:~/ais_json $ ./ais_json.py

/home/pi/ais_json/./ais_json.py:5: FutureWarning: The stream module is deprecated and will be removed in 1.0

  import ais.stream

{"encodetime": "20241213004701", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 4093, "rxtime": "20241213004701", "lon": 181.0, "lat": 91.0, "speed": 102.30000305175781, "course": 360.0, "heading": 5                                       11, "status": 0}]}]}

{"encodetime": "20241213004705", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004705", "lon": -85.70438, "lat": 30.16934, "speed": 0.0, "course": 360.0, "heading": 511                                       , "status": 0}]}]}

{"encodetime": "20241213004706", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004706", "lon": -85.72733833333334, "lat": 30.176006666666666, "speed": 0.0, "course": 27                                       8.1000061035156, "heading": 511, "status": 9}]}]}

{"encodetime": "20241213004708", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 366838630, "rxtime": "20241213004708", "lon": -85.68874166666667, "lat": 30.148318333333332, "speed": 14.0, "course": 3                                       9.900001525878906, "heading": 35, "status": 0}]}]}

{"encodetime": "20241213004711", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 369493633, "rxtime": "20241213004711", "lon": -85.724255, "lat": 30.132363333333334, "speed": 7.0, "course": 135.399993                                       89648438, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004711", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 3, "mmsi": 367307280, "rxtime": "20241213004711", "lon": -85.73375166666666, "lat": 30.18387166666667, "speed": 0.0, "course": 303                                       .1000061035156, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004715", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004715", "lon": -85.7044, "lat": 30.16934, "speed": 0.0, "course": 360.0, "heading": 511,                                        "status": 0}]}]}

{"encodetime": "20241213004723", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 4093, "rxtime": "20241213004723", "lon": 181.0, "lat": 91.0, "speed": 102.30000305175781, "course": 360.0, "heading": 5                                       11, "status": 0}]}]}

{"encodetime": "20241213004723", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 3, "mmsi": 210959000, "rxtime": "20241213004723", "lon": -85.73293666666666, "lat": 30.181466666666665, "speed": 0.0, "course": 0.                                       0, "heading": 2, "status": 5}]}]}

{"encodetime": "20241213004726", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004726", "lon": -85.72733666666667, "lat": 30.176011666666668, "speed": 0.0, "course": 27                                       8.1000061035156, "heading": 511, "status": 9}]}]}

{"encodetime": "20241213004727", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 3, "mmsi": 366838630, "rxtime": "20241213004727", "lon": -85.68789833333334, "lat": 30.149311666666666, "speed": 13.80000019073486                                       3, "course": 29.700000762939453, "heading": 25, "status": 0}]}]}

{"encodetime": "20241213004729", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367307280, "rxtime": "20241213004729", "lon": -85.73374666666666, "lat": 30.18387166666667, "speed": 0.0, "course": 302                                       .29998779296875, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004730", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 369493633, "rxtime": "20241213004730", "lon": -85.72359666666667, "lat": 30.132088333333332, "speed": 7.199999809265137                                       , "course": 109.19999694824219, "heading": 511, "status": 0}]}]}

{"encodetime": "20241213004734", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 368106020, "rxtime": "20241213004734", "lon": -85.70438, "lat": 30.169343333333334, "speed": 0.0, "course": 360.0, "hea                                       ding": 511, "status": 0}]}]}

{"encodetime": "20241213004736", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 1, "mmsi": 367461130, "rxtime": "20241213004736", "lon": -85.72733833333334, "lat": 30.176003333333334, "speed": 0.0, "course": 27                                       8.1000061035156, "heading": 511, "status": 9}]}]}

{"encodetime": "20241213004738", "protocol": "jsonais", "groups": [{"path": [{"name": "XXXXX-2", "url": "http://aprs.fi/jsonais/post/XXXXX"}], "                                       msgs": [{"msgtype": 24, "mmsi": 338229455, "rxtime": "20241213004738", "shiptype": 37, "partno": 1, "callsign": "@@@@@@@", "vendorid": "SRTD<C`", "ref                                       _front": 8, "ref_left": 1}]}]}

Error

Traceback (most recent call last):

  File "/home/pi/ais_json/./ais_json.py", line 87, in <module>

    print (colored('-- Uncommon packet recieved\n', 'red'))

NameError: name 'colored' is not defined


Leo Herzog

unread,
Dec 26, 2024, 1:54:57 AM12/26/24
to apr...@googlegroups.com
"name colored is not defined" 

pip3 install termcolor

and add
from termcolor import colored
to the top of your script.

Make sure all of your pip packages, such as ais, are updated also.

~Leo
------------------------
Sent from my phone; Please excuse brevity

Reply all
Reply to author
Forward
0 new messages