From b2efa81b0d6597960207d47779c01adcdc49a51d Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 22:54:06 -0700 Subject: [PATCH 01/21] 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 From dc3fd24903057a5d90e4c46ade5ae4ce9fbd7344 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 22:59:16 -0700 Subject: [PATCH 02/21] Correcting key check --- owrx/kiss.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index ccd4bba..ec0531c 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -50,15 +50,15 @@ IGLOGIN {callsign} {password} 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" + 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 "" + tone = "TONE=" + str(pm["aprs_igate_tone"]) if "aprs_igate_tone" 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" config += """ 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} From dc128662da119a0e192dc2325fd3faf2caf6cd96 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 23:05:04 -0700 Subject: [PATCH 03/21] log pbeacon string --- owrx/kiss.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index ec0531c..964b4a4 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,12 +60,16 @@ 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" - config += """ + 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 + return config From 9f45e8880aaf0eb6f134c28fd19ecc6508cc46bc Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 23:09:37 -0700 Subject: [PATCH 04/21] formating pbeacon string --- owrx/kiss.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 964b4a4..b842c68 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,15 +60,14 @@ 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" - 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 - ) + 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 + config += """ + {pbeacon} + """.format(pbeacon=pbeacon) return config From 5559cded851550989e9635b1a4ca606cf663d007 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 9 Dec 2020 23:17:42 -0700 Subject: [PATCH 05/21] Add quotes around default pbeacon comment --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index b842c68..66d28ce 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -58,7 +58,7 @@ IGLOGIN {callsign} {password} freq = "FREQ=" + str(pm["aprs_igate_freq"]) if "aprs_igate_freq" in pm else "" tone = "TONE=" + str(pm["aprs_igate_tone"]) if "aprs_igate_tone" 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\"" 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 ) From 0fb4ae4fc02594887a9015b341aaf5acbe99a4a2 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 09:59:34 -0700 Subject: [PATCH 06/21] sanitize comment for opening quote --- owrx/kiss.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/owrx/kiss.py b/owrx/kiss.py index 66d28ce..191b183 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,6 +60,9 @@ 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\"" + if(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( symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) From fdbbbcb64c04fa603fd50243989c1006530da365 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 10:04:42 -0700 Subject: [PATCH 07/21] Sanitize comment closing quote --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 191b183..be3a608 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,7 +60,7 @@ 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\"" - if(comment[0] != '"'): + if(comment[0] != '"' or comment[len(comment)-1] != '"'): 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( From 519b02da79211db708e8eb8fac71f5d99f4a8033 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 10:12:43 -0700 Subject: [PATCH 08/21] improve quotes check --- owrx/kiss.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index be3a608..2ef4624 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,8 +60,10 @@ 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\"" - if(comment[0] != '"' or comment[len(comment)-1] != '"'): + if(len(comment) > 0 and ((comment[0] != '"') or (comment[len(comment)-1] != '"')))): + logger.info(comment) comment = "\"" + comment + "\"" + logger.info(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( symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) From 11bb04419ba846342693e8046235362fa0e6962b Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 10:13:46 -0700 Subject: [PATCH 09/21] fix parenthesis --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 2ef4624..5ab556d 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,7 +60,7 @@ 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\"" - if(len(comment) > 0 and ((comment[0] != '"') or (comment[len(comment)-1] != '"')))): + if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): logger.info(comment) comment = "\"" + comment + "\"" logger.info(comment) From f83790a5be75374b4fbca4b70a8603ba9a7d7963 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 10:15:26 -0700 Subject: [PATCH 10/21] debug comment length --- owrx/kiss.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owrx/kiss.py b/owrx/kiss.py index 5ab556d..2c8f9ad 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,6 +60,7 @@ 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\"" + logger.info(str(len(comment))) if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): logger.info(comment) comment = "\"" + comment + "\"" From 4c3d037e5890fe73e25fdcd86050a88bfebf47c0 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:07:50 -0700 Subject: [PATCH 11/21] Cleanup debug logging --- owrx/kiss.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 2c8f9ad..5874a14 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -60,11 +60,8 @@ 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\"" - logger.info(str(len(comment))) if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): - logger.info(comment) comment = "\"" + comment + "\"" - logger.info(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( symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) From 3435052e270f8bc9fdf3407f39499299966e8cc8 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:08:47 -0700 Subject: [PATCH 12/21] sanitize empty comment --- owrx/kiss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/owrx/kiss.py b/owrx/kiss.py index 5874a14..442371a 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -62,6 +62,8 @@ IGLOGIN {callsign} {password} if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): comment = "\"" + comment + "\"" + else if(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( symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) From 1cc88ff3622e97b3c0d215f90d435f1367ef4bfd Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:09:12 -0700 Subject: [PATCH 13/21] if check fix --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 442371a..278cb87 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -62,7 +62,7 @@ IGLOGIN {callsign} {password} if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): comment = "\"" + comment + "\"" - else if(len(comment) > 0): + else if(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( From b04dcc18d04a1acf2644f9df2fd7844f92022a73 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:10:15 -0700 Subject: [PATCH 14/21] This is Python not C --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 278cb87..478e1f0 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -62,7 +62,7 @@ IGLOGIN {callsign} {password} if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): comment = "\"" + comment + "\"" - else if(len(comment) == 0): + 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( From 86fdbe45e923905e1ec48876ba89cdaa14e754dd Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:23:35 -0700 Subject: [PATCH 15/21] Add examples and comments to default config --- config_webrx.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config_webrx.py b/config_webrx.py index 427e4dc..ac6d9fa 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -336,6 +336,35 @@ aprs_igate_beacon = False # path to the aprs symbols repository (get it here: https://github.com/hessu/aprs-symbols) aprs_symbols_path = "/usr/share/aprs-symbols/png" +# Uncomment the following to customize gateway beacon details reported to the aprs network +# Plese see Dire Wolf's documentation on PBEACON configuration for complete details: +# https://github.com/wb2osz/direwolf/raw/master/doc/User-Guide.pdf + +# Symbol in its two-character form as specified by the APRS spec at http://www.aprs.org/symbols/symbols-new.txt +# Default: Receive only IGate (do not send msgs back to RF) +# aprs_igate_symbol = "R&" +# Custom comment about igate +# Default: OpenWebRX APRS gateway +# aprs_igate_comment = "OpenWebRX APRS gateway" + +# Antenna Power, Height, Gain, and Direction +# 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 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 From ae00a14a355ff8aa8e1a49387850d28c7ee8fbfc Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:38:15 -0700 Subject: [PATCH 16/21] Fix comment formatting --- config_webrx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_webrx.py b/config_webrx.py index ac6d9fa..25420d8 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -343,12 +343,13 @@ aprs_symbols_path = "/usr/share/aprs-symbols/png" # Symbol in its two-character form as specified by the APRS spec at http://www.aprs.org/symbols/symbols-new.txt # Default: Receive only IGate (do not send msgs back to RF) # aprs_igate_symbol = "R&" + # Custom comment about igate # Default: OpenWebRX APRS gateway # aprs_igate_comment = "OpenWebRX APRS gateway" # Antenna Power, Height, Gain, and Direction -# Unspecified by default +# Unspecified by default # Transmitter power (0 by default as only RX is supported) # aprs_igate_power = "0" # Antenna height in feet From dee050f3382688fc561a29b24151e080c7a25081 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Sat, 12 Dec 2020 11:38:50 -0700 Subject: [PATCH 17/21] Fix comment --- config_webrx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_webrx.py b/config_webrx.py index 25420d8..576dfa3 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -348,7 +348,7 @@ aprs_symbols_path = "/usr/share/aprs-symbols/png" # Default: OpenWebRX APRS gateway # aprs_igate_comment = "OpenWebRX APRS gateway" -# Antenna Power, Height, Gain, and Direction +# Antenna Power, Height, Gain # Unspecified by default # Transmitter power (0 by default as only RX is supported) # aprs_igate_power = "0" From daa499ab93bce4407f60651d7dc8cbd8656d6656 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 30 Dec 2020 10:33:21 -0700 Subject: [PATCH 18/21] PR comments edits --- config_webrx.py | 15 +++------------ owrx/kiss.py | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 17 deletions(-) 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 From 32fe01f128bbdbbb471551352d026068f0189873 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 30 Dec 2020 11:03:59 -0700 Subject: [PATCH 19/21] Round instead of floor height conversion --- owrx/kiss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index b204704..21eebc2 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -64,10 +64,10 @@ IGLOGIN {callsign} {password} if "aprs_igate_height": try: height_m = float(pm["aprs_igate_height"]) - height_ft = int(height_m * FEET_PER_METER) + height_ft = round(height_m * FEET_PER_METER) height = "HEIGHT=" + str(height_ft) except: - logger.error("Cannot parse 'aprs_igate_height': " + str(pm["aprs_igate_height"])) + logger.error("Cannot parse 'aprs_igate_height', expected float: " + str(pm["aprs_igate_height"])) if((len(comment) > 0) and ((comment[0] != '"') or (comment[len(comment)-1] != '"'))): comment = "\"" + comment + "\"" From 57a6db5df2fb03d0e1c426de7d26c97644d42478 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 30 Dec 2020 12:16:12 -0700 Subject: [PATCH 20/21] Removing inapplicable fields --- owrx/kiss.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index 21eebc2..ce1f13e 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -52,16 +52,13 @@ 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" 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 "" - tone = "TONE=" + str(pm["aprs_igate_tone"]) if "aprs_igate_tone" 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\"" + #Convert height from meters to feet if specified height = "" - if "aprs_igate_height": + if "aprs_igate_height" in pm: try: height_m = float(pm["aprs_igate_height"]) height_ft = round(height_m * FEET_PER_METER) @@ -74,8 +71,8 @@ IGLOGIN {callsign} {password} 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( - symbol=symbol, lat=lat, lon=lon, power=power, height=height, gain=gain, adir=adir, freq=freq, tone=tone, offset=offset, comment=comment ) + pbeacon = "PBEACON sendto=IG delay=0:30 every=60:00 symbol={symbol} lat={lat} long={lon} POWER=0 {height} {gain} {adir} comment={comment}".format( + symbol=symbol, lat=lat, lon=lon, height=height, gain=gain, adir=adir, comment=comment ) logger.info("APRS PBEACON String: " + pbeacon) From 1730ef27da4157647fb1b64f7b200609908b9ab8 Mon Sep 17 00:00:00 2001 From: Ed Sandor Date: Wed, 30 Dec 2020 12:21:07 -0700 Subject: [PATCH 21/21] Remove POWER from pbeacon string --- owrx/kiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owrx/kiss.py b/owrx/kiss.py index ce1f13e..bb20489 100644 --- a/owrx/kiss.py +++ b/owrx/kiss.py @@ -71,7 +71,7 @@ IGLOGIN {callsign} {password} elif(len(comment) == 0): comment = "\"\"" - pbeacon = "PBEACON sendto=IG delay=0:30 every=60:00 symbol={symbol} lat={lat} long={lon} POWER=0 {height} {gain} {adir} comment={comment}".format( + pbeacon = "PBEACON sendto=IG delay=0:30 every=60:00 symbol={symbol} lat={lat} long={lon} {height} {gain} {adir} comment={comment}".format( symbol=symbol, lat=lat, lon=lon, height=height, gain=gain, adir=adir, comment=comment ) logger.info("APRS PBEACON String: " + pbeacon)