Skip to content

Commit

Permalink
Add an experimental designator to software ID
Browse files Browse the repository at this point in the history
  • Loading branch information
afourney committed Oct 18, 2024
1 parent b02dc7e commit 2cc1f95
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/aprstastic/_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from aprslib.parsing import parse

APRS_SOFTWARE_ID = "APZMAG" # Experimental Meshtastic-APRS Gateway
MQTT_TOPIC = "meshtastic.receive"
REGISTRATION_BEACON = "MESHID-01"
GATEWAY_BEACON_INTERVAL = 3600 # Station beacons once an hour
Expand Down Expand Up @@ -355,7 +356,9 @@ def _send_aprs_message(self, fromcall, tocall, message):
tocall += " "
packet = (
fromcall
+ ">APRS,WIDE1-1,qAR,"
+ ">"
+ APRS_SOFTWARE_ID
+ ",WIDE1-1,qAR,"
+ self._gateway_call_sign
+ "::"
+ tocall
Expand All @@ -372,7 +375,9 @@ def _send_aprs_ack(self, fromcall, tocall, messageId):
tocall += " "
packet = (
fromcall
+ ">APRS,WIDE1-1,qAR,"
+ ">"
+ APRS_SOFTWARE_ID
+ ",WIDE1-1,qAR,"
+ self._gateway_call_sign
+ "::"
+ tocall
Expand Down Expand Up @@ -408,7 +413,13 @@ def _send_aprs_position(self, fromcall, lat, lon, t, message):

aprs_msg = "@" + aprs_ts + aprs_lat + "/" + aprs_lon + ">" + message
packet = (
fromcall + ">APRS,WIDE1-1,qAR," + self._gateway_call_sign + ":" + aprs_msg
fromcall
+ ">"
+ APRS_SOFTWARE_ID
+ ",WIDE1-1,qAR,"
+ self._gateway_call_sign
+ ":"
+ aprs_msg
)
logger.debug(f"Sending to APRS: {packet}")
self._aprs_client.send(packet)
Expand All @@ -417,7 +428,9 @@ def _send_aprs_gateway_beacon(self, lat, lon, icon, message):
aprs_lat = self._aprs_lat(lat)
aprs_lon = self._aprs_lon(lon)
aprs_msg = "!" + aprs_lat + icon[0] + aprs_lon + icon[1] + message
packet = self._gateway_call_sign + ">APRS,TCPIP*:" + aprs_msg
packet = (
self._gateway_call_sign + ">" + APRS_SOFTWARE_ID + ",TCPIP*:" + aprs_msg
)
logger.debug(f"[Testing] would beacon to APRS: {packet}")
# self._aprs_client.send(packet)

Expand Down

0 comments on commit 2cc1f95

Please sign in to comment.