From 4ef939d43c429737abaedfe06fd597fbccbfff4b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Wed, 31 Jul 2024 19:24:44 -0700 Subject: [PATCH] cleanup --- README.md | 8 ++++++++ config.template | 8 ++++++++ mesh_bot.py | 2 +- modules/radio.py | 50 ++++++++++++++++++++++++++++++++++++------------ 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0881bec..1c2eb2b 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,15 @@ A module allowing a Hamlib compatable radio to connect to the bot, when functipo [radioMon] enabled = False rigControlServerAddress = localhost:4532 +# channel to brodcast to can be 2,3 sigWatchBrodcastCh = 2 +# minimum SNR as reported by radio via hamlib +signalDetectionThreshold = -10 +# hold time for high SNR +signalHoldTime = 10 +# the following are combined to reset the monitor +signalCooldown = 5 +signalCycleLimit = 5 ``` # requirements can also be installed with `pip install -r requirements.txt` diff --git a/config.template b/config.template index b64ec93..aab56b7 100644 --- a/config.template +++ b/config.template @@ -74,4 +74,12 @@ repeater_channels = # using Hamlib rig control will monitor and alert on channel use enabled = False rigControlServerAddress = localhost:4532 +# brodcast to all nodes on the channel can alsp be = 2,3 sigWatchBrodcastCh = 2 +# minimum SNR as reported by radio via hamlib +signalDetectionThreshold = -10 +# hold time for high SNR +signalHoldTime = 10 +# the following are combined to reset the monitor +signalCooldown = 5 +signalCycleLimit = 5 diff --git a/mesh_bot.py b/mesh_bot.py index af8dfff..7ffb732 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -323,7 +323,7 @@ async def start_rx(): if repeater_enabled: print(f"System: Repeater Enabled for Channels: {repeater_channels}") if radio_dectection_enabled: - print(f"System: Radio Detection Enabled using rigctld at {rigControlServerAddress}") + print(f"System: Radio Detection Enabled using rigctld at {rigControlServerAddress} brodcasting to channels: {sigWatchBrodcastCh} for {get_freq_common_name(sigWatchBrodcastCh[0])}") # Start the receive subscriber using pubsub via meshtastic library pub.subscribe(onReceive, 'meshtastic.receive') diff --git a/modules/radio.py b/modules/radio.py index 7e37b64..a16e52d 100644 --- a/modules/radio.py +++ b/modules/radio.py @@ -42,32 +42,54 @@ def get_freq_common_name(freq): return "GRMS CH6" elif freq == 462712500: return "GRMS CH7" - elif freq == 462737500: + elif freq == 467562500: return "GRMS CH8" - elif freq == 462762500: + elif freq == 467587500: return "GRMS CH9" - elif freq == 462787500: + elif freq == 467612500: return "GRMS CH10" - elif freq == 462812500: + elif freq == 467637500: return "GRMS CH11" - elif freq == 462837500: + elif freq == 467662500: return "GRMS CH12" - elif freq == 462862500: + elif freq == 467687500: return "GRMS CH13" - elif freq == 462887500: + elif freq == 467712500: return "GRMS CH14" - elif freq == 462912500: + elif freq == 467737500: return "GRMS CH15" - elif freq == 462937500: - return "GRMS CH16" elif freq == 462550000: + return "GRMS CH16" + elif freq == 462575000: + return "GMRS CH17" + elif freq == 462600000: + return "GMRS CH18" + elif freq == 462625000: + return "GMRS CH19" + elif freq == 462675000: + return "GMRS CH20" + elif freq == 462670000: + return "GMRS CH21" + elif freq == 462725000: + return "GMRS CH22" + elif freq == 462725500: + return "GMRS CH23" + elif freq == 467575000: + return "GMRS CH24" + elif freq == 467600000: + return "GMRS CH25" + elif freq == 467625000: + return "GMRS CH26" + elif freq == 467650000: + return "GMRS CH27" + elif freq == 467675000: + return "GMRS CH28" + elif freq == 467700000: return "FRS CH1" elif freq == 462575000: return "FRS CH2" elif freq == 462600000: return "FRS CH3" - elif freq == 462625000: - return "FRS CH4" elif freq == 462650000: return "FRS CH5" elif freq == 462675000: @@ -94,6 +116,10 @@ def get_freq_common_name(freq): return "FRS CH16" elif freq == 146520000: return "2M Simplex Calling" + elif freq == 446000000: + return "70cm Simplex Calling" + elif freq == 156800000: + return "Marine CH16" else: #return Mhz freq = freq/1000000