Parse APRS location from packets that have that information. #26

Merged
w1cdn merged 10 commits from aprs_loc into dev 2025-11-09 03:23:51 +00:00
Owner

Closes #10.

  • add location of spotter (more command line argument(s))
  • only include location if values aren't -9999
  • allow negative numbers in lat/lon CLI https://docs.rs/clap/latest/clap/builder/struct.Arg.html - closed in 21499a93d9
  • send null when lat/long not provided in CLI, not -9999/-9999 - closed in 7ce55f020b
  • cache locations and fill in values when locations aren't parsed out of packets
  • Sometimes packets have no SSID, so we need to avoid sending even an empty string - closed in ad5f2ccd0d
Closes #10. - [x] add location of spotter (more command line argument(s)) - [x] only include location if values aren't -9999 - [x] allow negative numbers in lat/lon CLI https://docs.rs/clap/latest/clap/builder/struct.Arg.html - closed in 21499a93d9 - [x] send null when lat/long not provided in CLI, not -9999/-9999 - closed in 7ce55f020b - [x] cache locations and fill in values when locations aren't parsed out of packets - [x] Sometimes packets have no SSID, so we need to avoid sending even an empty string - closed in ad5f2ccd0d
w1cdn added 1 commit 2025-10-25 04:18:46 +00:00
Author
Owner

Had a thought about a missing piece as I was falling asleep, now I can't remember it!

EDIT: Remembered, it was that I didn't check the lat/lon values against 9999 before sending them on.

Had a thought about a missing piece as I was falling asleep, now I can't remember it! EDIT: Remembered, it was that I didn't check the lat/lon values against 9999 before sending them on.
Author
Owner

Are these values too long? Spothole doesn't seem to pick up all the locations.
"dx_latitude":47.94133333333333,"dx_longitude":-97.02683333333333,

curl seems to work:
curl --request POST --header "Content-Type: application/json" --data '{"dx_call":"M0TRT","time": 1761415746, "freq":14200000, "comment":"Test spot please ignore", "de_call":"M0TRT", "dx_latitude":47.94133333333333, "dx_longitude":-97.02683333333333}' https://spothole.w1cdn.net/api/v1/spot

Are these values too long? Spothole doesn't seem to pick up all the locations. `"dx_latitude":47.94133333333333,"dx_longitude":-97.02683333333333,` curl seems to work: `curl --request POST --header "Content-Type: application/json" --data '{"dx_call":"M0TRT","time": 1761415746, "freq":14200000, "comment":"Test spot please ignore", "de_call":"M0TRT", "dx_latitude":47.94133333333333, "dx_longitude":-97.02683333333333}' https://spothole.w1cdn.net/api/v1/spot `
Author
Owner

I think I was running on two machines at once, one only with locations and one with all UI frames. This was messing up the mapping.

I think I was running on two machines at once, one only with locations and one with all UI frames. This was messing up the mapping.
Author
Owner

Oh things got simpler; you can send an empty string to json lat/lon and it will be interpreted as a bad location by spothole. I thought I would have to send a specific None or null or empty number (whatever that looks like).

Oh things got simpler; you can send an empty string to json lat/lon and it will be interpreted as a bad location by spothole. I thought I would have to send a specific `None` or `null` or empty number (whatever that looks like).
Author
Owner

You can also send lat/lon as strings:

curl --request POST --header "Content-Type: application/json" --data '{"dx_call":"W1CDN","time": 1761447599, "freq":14200000, "comment":"Test spot please ignore", "de_call":"W1CDN", "dx_latitude":"47.94133333333333", "dx_longitude":"-97.02683333333333"}' https://spothole.w1cdn.net/api/v1/spot

And spothole will parse/map right:

  {
    "id": "54b2ca6220eaddc3b263063cb43602cbd87790c9078a3d121aeb3812e2323304",
    "dx_call": "W1CDN",
    "dx_name": "MATTHEW E BURTON-KELLY",
    "dx_country": "United States",
    "dx_flag": "🇺🇸",
    "dx_continent": "NA",
    "dx_dxcc_id": 291,
    "de_dxcc_id": 291,
    "dx_cq_zone": 5,
    "dx_itu_zone": 8,
    "dx_aprs_ssid": null,
    "dx_grid": null,
    "dx_latitude": "47.94133333333333",
    "dx_longitude": "-97.02683333333333",
    "dx_location_source": "SPOT",
    "dx_location_good": true,
    "de_call": "W1CDN",
    "de_country": "United States",
    "de_flag": "🇺🇸",
    "de_continent": "NA",
    "de_grid": "FN42EJ11",
    "de_latitude": 42.38,
    "de_longitude": -71.65,
    "mode": "USB",
    "mode_type": "PHONE",
    "mode_source": "BANDPLAN",
    "freq": 14200000,
    "band": "20m",
    "comment": "Test spot please ignore",
    "qrt": false,
    "sig": null,
    "sig_refs": null,
    "sig_refs_names": null,
    "sig_refs_urls": null,
    "activation_score": null,
    "icon": "desktop",
    "band_color": "#f2c40c",
    "band_contrast_color": "black",
    "time": 1761447599,
    "time_iso": "2025-10-26T02:59:59+00:00",
    "received_time": 1761447642.39335,
    "received_time_iso": "2025-10-26T03:00:42.393350+00:00",
    "source": "API",
    "source_id": null
  },
image.png
You can also send lat/lon as strings: `curl --request POST --header "Content-Type: application/json" --data '{"dx_call":"W1CDN","time": 1761447599, "freq":14200000, "comment":"Test spot please ignore", "de_call":"W1CDN", "dx_latitude":"47.94133333333333", "dx_longitude":"-97.02683333333333"}' https://spothole.w1cdn.net/api/v1/spot` And spothole will parse/map right: ``` { "id": "54b2ca6220eaddc3b263063cb43602cbd87790c9078a3d121aeb3812e2323304", "dx_call": "W1CDN", "dx_name": "MATTHEW E BURTON-KELLY", "dx_country": "United States", "dx_flag": "🇺🇸", "dx_continent": "NA", "dx_dxcc_id": 291, "de_dxcc_id": 291, "dx_cq_zone": 5, "dx_itu_zone": 8, "dx_aprs_ssid": null, "dx_grid": null, "dx_latitude": "47.94133333333333", "dx_longitude": "-97.02683333333333", "dx_location_source": "SPOT", "dx_location_good": true, "de_call": "W1CDN", "de_country": "United States", "de_flag": "🇺🇸", "de_continent": "NA", "de_grid": "FN42EJ11", "de_latitude": 42.38, "de_longitude": -71.65, "mode": "USB", "mode_type": "PHONE", "mode_source": "BANDPLAN", "freq": 14200000, "band": "20m", "comment": "Test spot please ignore", "qrt": false, "sig": null, "sig_refs": null, "sig_refs_names": null, "sig_refs_urls": null, "activation_score": null, "icon": "desktop", "band_color": "#f2c40c", "band_contrast_color": "black", "time": 1761447599, "time_iso": "2025-10-26T02:59:59+00:00", "received_time": 1761447642.39335, "received_time_iso": "2025-10-26T03:00:42.393350+00:00", "source": "API", "source_id": null }, ``` <img width="494" alt="image.png" src="attachments/a55a1013-f0ba-4007-a492-3381ea2506ce">
796 KiB
w1cdn added 1 commit 2025-10-26 03:46:48 +00:00
Author
Owner

Location caching is next. Deciding whether to finish off this PR with only sending spots with parsed locations (so the map always works) or to leave it as everything for now (and the map locations will be overwritten by UI frames with no location data).

We discussed #11 on Matrix: https://matrix.to/#/!bVjIHuavAgnyyjeDTM:matrix.farpn.net/$bryXVDi7prNeZBnEZwKjf9ysMh19A2D1V-ilO8zbnz0?via=matrix.farpn.net&via=matrix.org&via=im.xoo.sh

Location caching is next. Deciding whether to finish off this PR with only sending spots with parsed locations (so the map always works) or to leave it as everything for now (and the map locations will be overwritten by UI frames with no location data). We discussed #11 on Matrix: https://matrix.to/#/!bVjIHuavAgnyyjeDTM:matrix.farpn.net/$bryXVDi7prNeZBnEZwKjf9ysMh19A2D1V-ilO8zbnz0?via=matrix.farpn.net&via=matrix.org&via=im.xoo.sh
w1cdn added 1 commit 2025-10-28 02:00:03 +00:00
Author
Owner

Leaving this running for a while to see if location caching works, but fewer 20m packets in the dark.

Leaving this running for a while to see if location caching works, but fewer 20m packets in the dark.
w1cdn added 1 commit 2025-10-28 17:42:37 +00:00
w1cdn added 1 commit 2025-10-29 02:37:49 +00:00
Author
Owner

I opened a ticket with Ian to see about differentiating SSIDs in Spothole code: https://git.ianrenton.com/ian/spothole/issues/68.

I opened a ticket with Ian to see about differentiating SSIDs in Spothole code: https://git.ianrenton.com/ian/spothole/issues/68.
w1cdn added 1 commit 2025-10-30 13:30:26 +00:00
Author
Owner

Ian has updated Spothole to account for SSIDs: https://git.ianrenton.com/ian/spothole/issues/68#issuecomment-759.

I have updated https://spothole.w1cdn.net with the changes.

We really should submit dx_ssid as integer rather than string though.

Ian has updated Spothole to account for SSIDs: https://git.ianrenton.com/ian/spothole/issues/68#issuecomment-759. I have updated https://spothole.w1cdn.net with the changes. We really should submit `dx_ssid` as integer rather than string though.
Author
Owner
  • Sometimes packets have no SSID, so we need to avoid sending even an empty string (added to punchlist)
    image.png
- Sometimes packets have no SSID, so we need to avoid sending even an empty string (added to punchlist) ![image.png](/attachments/081c839a-aa6d-410d-bfda-149d8f4e7cd8)
102 KiB
w1cdn changed title from Parse APRS location from packets that have that information. to WIP: Parse APRS location from packets that have that information. 2025-11-04 16:07:31 +00:00
w1cdn added 1 commit 2025-11-08 23:03:11 +00:00
w1cdn added 1 commit 2025-11-08 23:07:45 +00:00
w1cdn added 1 commit 2025-11-09 01:14:51 +00:00
w1cdn added 1 commit 2025-11-09 02:58:42 +00:00
Author
Owner

Not sure I completely understand, but clap must be handling empty references.

Not sure I completely understand, but clap must be handling empty references.
w1cdn changed title from WIP: Parse APRS location from packets that have that information. to Parse APRS location from packets that have that information. 2025-11-09 03:23:37 +00:00
w1cdn merged commit 875da10174 into dev 2025-11-09 03:23:51 +00:00
w1cdn deleted branch aprs_loc 2025-11-09 03:25:41 +00:00
Sign in to join this conversation.