diff --git a/config_webrx.py b/config_webrx.py index 576dfa3..27bcd35 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -348,24 +348,15 @@ aprs_symbols_path = "/usr/share/aprs-symbols/png" # Default: OpenWebRX APRS gateway # aprs_igate_comment = "OpenWebRX APRS gateway" -# Antenna Power, Height, Gain +# Antenna Height and Gain details # Unspecified by default -# Transmitter power (0 by default as only RX is supported) -# aprs_igate_power = "0" -# Antenna height in feet -# aprs_igate_height = "20" +# Antenna height above average terrain (HAAT) in meters +# aprs_igate_height = "5" # Antenna gain in dBi # aprs_igate_gain = "0" # Antenna direction (N, NE, E, SE, S, SW, W, NW). Omnidirectional by default # 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 === # 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 diff --git a/owrx/kiss.py b/owrx/kiss.py index 478e1f0..b204704 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -11,6 +11,7 @@ FESC = 0xDB TFEND = 0xDC TFESC = 0xDD +FEET_PER_METER = 3.28084 class DirewolfConfig(object): def getConfig(self, port, is_service): @@ -52,7 +53,6 @@ IGLOGIN {callsign} {password} #Format beacon details 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" - 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 "" 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 "" @@ -60,19 +60,26 @@ IGLOGIN {callsign} {password} 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\"" + 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] != '"'))): comment = "\"" + comment + "\"" elif(len(comment) == 0): 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 ) logger.info("APRS PBEACON String: " + pbeacon) - config += """ - {pbeacon} - """.format(pbeacon=pbeacon) + config += "\n" + pbeacon + "\n" return config