APRS API in Python.
Go to file
2023-12-13 10:13:25 -06:00
templates Clean up a bit. 2023-08-26 16:23:55 -05:00
.gitignore Add basic logging. 2023-07-12 12:43:24 -05:00
api_app.py Very rough workaround for relative API urls. 2023-08-26 16:47:23 -05:00
api_waitress.py Update waitress IP to make it work on production. 2023-04-15 16:37:31 -05:00
config_default.ini Very rough workaround for relative API urls. 2023-08-26 16:47:23 -05:00
constants.py Flail. 2023-12-11 21:41:57 -06:00
init_db.py Snapshot. 2023-04-13 20:46:28 -05:00
kiss_and_db.py Working snapshot. 2023-12-13 10:13:25 -06:00
README.md Update docs. 2023-04-23 21:13:06 -05:00
requirements.txt Very rough workaround for relative API urls. 2023-08-26 16:47:23 -05:00
schema.sql Add stations table definiton. 2023-07-08 21:56:15 -05:00
start-aprs_api.sh Fix path. 2023-07-07 18:25:20 -05:00
test_async.py Stub out fix-kiss. 2023-08-26 19:24:00 -05:00
test_db.py Snapshot after adding station table update code, but hasn't been tested on real frames yet. 2023-07-09 09:14:09 -05:00

README

I got tired of APRS-IS websites not showing me all the paths that packets take, only the shortest path to IS. So this is a Python 3 tool that turns direwolf logs into a REST API in JSON format.

Setup

  1. Run direwolf with logging to CSV on by using -l. (-L not yet implemented).
  2. Install requirements using pip install -r requirements.txt.
  3. Set up database file with python init_db.py.
  4. Run app.py with either a Python call or a real WSGI server. You can use screen to detach the session.
    • Default URL is http://127.0.0.1:5001
    • Example waitress and screen scripts are included, see
      • api_waitress.py and
      • start-aprs_api.sh
  5. Access the API from whatever other system you want.

Endpoints:

-/packets - gives the most recent packets, sorted descending by time received. - argument n will return a specific number of packets, default 10. E.g., https://digi.w1cdn.net/aprs_api/packets?n=1 returns one packet. - argument from will return packets from the named station-SSID (no wildcards). E.g., https://digi.w1cdn.net/aprs_api/packets?n=1&from=W1CDN-1 returns one packet from W1CDN-1.

Example of an object packet sent by W1CDN-1 and digipeated by K0UND-2:

{
      "id": 1,
      "addresse": null,
      "alive": null,
      "altitude": null,
      "comment": "Leave a message to say hi!",
      "course": null,
      "created": "2023-04-16 15:04:03",
      "format": "uncompressed",
      "frame": null,
      "from": "W1CDN-2",
      "gpsfixstatus": null,
      "latitude": 47.94133333333333,
      "longitude": -97.02683333333333,
      "mbits": null,
      "messagecapable": 1,
      "message_text": null,
      "mtype": null,
      "object_format": null,
      "object_name": null,
      "path": "['K0UND-2', 'WIDE2-2']",
      "phg": null,
      "phg_dir": null,
      "phg_gain": null,
      "phg_height": null,
      "phg_power": null,
      "phg_range": null,
      "posambiguity": 0,
      "raw": "W1CDN-2>APQTH1,K0UND-2,WIDE2-2:@150321h4756.48N/09701.61W-Leave a message to say hi!",
      "raw_timestamp": "150321h",
      "speed": null,
      "station_call": "W1CDN-1",
      "station_lat": 47.9415,
      "station_lon": -97.027,
      "status": null,
      "symbol": "-",
      "symbol_table": "/",
      "telemetry": null,
      "timestamp": 1681657401,
      "to": "APQTH1",
      "tEQNS": null,
      "tPARM": null,
      "tUNIT": null,
      "via": "",
      "weather": null,
      "wx_raw_timestamp": null
    }

Contributing

If you want to contribute, please get in touch with me on Mastodon at https://mastodon.radio/@W1CDN.