From 9a67fc084afb84ccbeada87b3b1fd323a7965739 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Mon, 29 Mar 2021 15:27:50 -0500 Subject: [PATCH] Fixed gate in APRS packets to always use the SSID configured in the [APRS] section of the config. Fixed failure case for loading default configuration to exit after complaining. --- ir-aprsisd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ir-aprsisd b/ir-aprsisd index f8646d5..a4fcd3e 100755 --- a/ir-aprsisd +++ b/ir-aprsisd @@ -64,6 +64,7 @@ else: #Default behavior if no file specified. if not loadConfig("/etc/" + cf): if not loadConfig(cf): print("Can't find default configuration: " + cf) + sys.exit(1) #Allow command-line arguments to override the config file. if opts.ssid: @@ -98,7 +99,7 @@ SSNum = int(SSNum) #The beginning of our APRS packets should contain a source, path, # q construct, and gateway address. We'll reuse the same SSID as a gate. # This is the part between the source and the gate. -ARPreamble = ''.join(['>APRS,','TCPIP*,','qAS,']) +ARPreamble = ''.join(['>APRS,','TCPIP*,','qAS,',conf['APRS']['SSID']]) NAME = "iR-APRSISD" REV = "0.2" @@ -263,7 +264,7 @@ def sendAPRS(Placemark): # @092345z/4903.50N/07201.75W>088/036 # with a comment on the end that can include altitude and other # information. - aprsPacket = ''.join([getSSID(IMEI),ARPreamble,getSSID(IMEI),':@',aprstime,aprspos,aprscs,aprsalt,comment]) + aprsPacket = ''.join([getSSID(IMEI),ARPreamble,':@',aprstime,aprspos,aprscs,aprsalt,comment]) #This will throw an exception if the packet is somehow wrong. aprslib.parse(aprsPacket) AIS.sendall(aprsPacket)