PR comments edits

This commit is contained in:
Ed Sandor 2020-12-30 10:33:21 -07:00
parent dee050f338
commit daa499ab93
2 changed files with 15 additions and 17 deletions

View File

@ -348,24 +348,15 @@ aprs_symbols_path = "/usr/share/aprs-symbols/png"
# Default: OpenWebRX APRS gateway # Default: OpenWebRX APRS gateway
# aprs_igate_comment = "OpenWebRX APRS gateway" # aprs_igate_comment = "OpenWebRX APRS gateway"
# Antenna Power, Height, Gain # Antenna Height and Gain details
# Unspecified by default # Unspecified by default
# Transmitter power (0 by default as only RX is supported) # Antenna height above average terrain (HAAT) in meters
# aprs_igate_power = "0" # aprs_igate_height = "5"
# Antenna height in feet
# aprs_igate_height = "20"
# Antenna gain in dBi # Antenna gain in dBi
# aprs_igate_gain = "0" # aprs_igate_gain = "0"
# Antenna direction (N, NE, E, SE, S, SW, W, NW). Omnidirectional by default # Antenna direction (N, NE, E, SE, S, SW, W, NW). Omnidirectional by default
# aprs_igate_dir = "NE" # aprs_igate_dir = "NE"
# Frequency info to contact you by voice
# Unspecified by default
# aprs_igate_freq = "146.955"
# aprs_igate_tone = "74.4"
# aprs_igate_offset = "-0.60"
# === PSK Reporter setting === # === PSK Reporter setting ===
# enable this if you want to upload all ft8, ft4 etc spots to pskreporter.info # enable this if you want to upload all ft8, ft4 etc spots to pskreporter.info
# this also uses the receiver_gps setting from above, so make sure it contains a correct locator # this also uses the receiver_gps setting from above, so make sure it contains a correct locator

View File

@ -11,6 +11,7 @@ FESC = 0xDB
TFEND = 0xDC TFEND = 0xDC
TFESC = 0xDD TFESC = 0xDD
FEET_PER_METER = 3.28084
class DirewolfConfig(object): class DirewolfConfig(object):
def getConfig(self, port, is_service): def getConfig(self, port, is_service):
@ -52,7 +53,6 @@ IGLOGIN {callsign} {password}
#Format beacon details #Format beacon details
symbol = str(pm["aprs_igate_symbol"]) if "aprs_igate_symbol" in pm else "R&" symbol = str(pm["aprs_igate_symbol"]) if "aprs_igate_symbol" in pm else "R&"
power = str(pm["aprs_igate_power"]) if "aprs_igate_power" in pm else "0" power = str(pm["aprs_igate_power"]) if "aprs_igate_power" in pm else "0"
height = "HEIGHT=" + str(pm["aprs_igate_height"]) if "aprs_igate_height" in pm else ""
gain = "GAIN=" + str(pm["aprs_igate_gain"]) if "aprs_igate_gain" in pm else "" gain = "GAIN=" + str(pm["aprs_igate_gain"]) if "aprs_igate_gain" in pm else ""
adir = "DIR=" + str(pm["aprs_igate_dir"]) if "aprs_igate_dir" in pm else "" adir = "DIR=" + str(pm["aprs_igate_dir"]) if "aprs_igate_dir" in pm else ""
freq = "FREQ=" + str(pm["aprs_igate_freq"]) if "aprs_igate_freq" in pm else "" freq = "FREQ=" + str(pm["aprs_igate_freq"]) if "aprs_igate_freq" in pm else ""
@ -60,19 +60,26 @@ IGLOGIN {callsign} {password}
offset = "OFFSET=" + str(pm["aprs_igate_offset"]) if "aprs_igate_offset" in pm else "" offset = "OFFSET=" + str(pm["aprs_igate_offset"]) if "aprs_igate_offset" in pm else ""
comment = str(pm["aprs_igate_comment"]) if "aprs_igate_comment" in pm else "\"OpenWebRX APRS gateway\"" comment = str(pm["aprs_igate_comment"]) if "aprs_igate_comment" in pm else "\"OpenWebRX APRS gateway\""
height = ""
if "aprs_igate_height":
try:
height_m = float(pm["aprs_igate_height"])
height_ft = int(height_m * FEET_PER_METER)
height = "HEIGHT=" + str(height_ft)
except:
logger.error("Cannot parse 'aprs_igate_height': " + str(pm["aprs_igate_height"]))
if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))):
comment = "\"" + comment + "\"" comment = "\"" + comment + "\""
elif(len(comment) == 0): elif(len(comment) == 0):
comment = "\"\"" comment = "\"\""
pbeacon= "PBEACON sendto=IG delay=0:30 every=60:00 symbol={symbol} lat={lat} long={lon} POWER={power} {height} {gain} {adir} {freq} {tone} {offset} comment={comment}".format( pbeacon = "PBEACON sendto=IG delay=0:30 every=60:00 symbol={symbol} lat={lat} long={lon} POWER={power} {height} {gain} {adir} {freq} {tone} {offset} comment={comment}".format(
symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment )
logger.info("APRS PBEACON String: " + pbeacon) logger.info("APRS PBEACON String: " + pbeacon)
config += """ config += "\n" + pbeacon + "\n"
{pbeacon}
""".format(pbeacon=pbeacon)
return config return config