From b2efa81b0d6597960207d47779c01adcdc49a51d Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 22:54:06 -0700 Subject: [PATCH] Formatting additional PBEACON details --- owrx/kiss.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 440cdab..ccd4bba 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -39,6 +39,7 @@ IGLOGIN {callsign} {password} ) if pm["aprs_igate_beacon"]: + #Format beacon lat/lon lat = pm["receiver_gps"]["lat"] lon = pm["receiver_gps"]["lon"] direction_ns = "N" if lat > 0 else "S" @@ -48,10 +49,21 @@ IGLOGIN {callsign} {password} lat = "{0:02d}^{1:05.2f}{2}".format(int(lat), (lat - int(lat)) * 60, direction_ns) lon = "{0:03d}^{1:05.2f}{2}".format(int(lon), (lon - int(lon)) * 60, direction_we) + #Format beacon details + symbol = str(pm["aprs_igate_symbol"]) if checkKey(pm, "aprs_igate_symbol") else "R&" + power = str(pm["aprs_igate_power"]) if checkKey(pm, "aprs_igate_power") else "0" + height = "HEIGHT=" + str(pm["aprs_igate_height"]) if checkKey(pm, "aprs_igate_height") else "" + gain = "GAIN=" + str(pm["aprs_igate_gain"]) if checkKey(pm, "aprs_igate_gain") else "" + adir = "DIR=" + str(pm["aprs_igate_dir"]) if checkKey(pm, "aprs_igate_dir") else "" + freq = "FREQ=" + str(pm["aprs_igate_freq"]) if checkKey(pm, "aprs_igate_freq") else "" + tone = "TONE=" + str(pm["aprs_igate_tone"]) if checkKey(pm, "aprs_igate_tone") else "" + offset = "OFFSET=" + str(pm["aprs_igate_offset"]) if checkKey(pm, "aprs_igate_offset") else "" + comment = str(pm["aprs_igate_comment"]) if checkKey(pm, "aprs_igate_comment") else "OpenWebRX APRS gateway" + config += """ -PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat={lat} long={lon} comment="OpenWebRX APRS gateway" +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( - lat=lat, lon=lon + symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) return config