From 05be4cb7e0c63f91b0993eb56d917b1448fa4278 Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Fri, 8 Nov 2024 18:57:12 +0100 Subject: [PATCH 1/2] Add setting to transmit NeighborInfo over LoRa Only if not using the default channel --- src/modules/NeighborInfoModule.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/NeighborInfoModule.cpp b/src/modules/NeighborInfoModule.cpp index e7160f929f..fb658421d7 100644 --- a/src/modules/NeighborInfoModule.cpp +++ b/src/modules/NeighborInfoModule.cpp @@ -121,7 +121,12 @@ Will be used for broadcast. */ int32_t NeighborInfoModule::runOnce() { - sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false); + if (moduleConfig.neighbor_info.transmit_over_lora && !channels.isDefaultChannel(channels.getPrimaryIndex()) && + airTime->isTxAllowedChannelUtil(true) && airTime->isTxAllowedAirUtil()) { + sendNeighborInfo(NODENUM_BROADCAST, false); + } else { + sendNeighborInfo(NODENUM_BROADCAST_NO_LORA, false); + } return Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval, default_neighbor_info_broadcast_secs); } From d35deeb50d91e20e1e0c05e32c8c0972b8122cba Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Fri, 8 Nov 2024 18:57:34 +0100 Subject: [PATCH 2/2] Bump minimum broadcast interval for NeighborInfo to 4 hours --- src/mesh/Default.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/Default.h b/src/mesh/Default.h index 7a7507c84e..d39886d1c3 100644 --- a/src/mesh/Default.h +++ b/src/mesh/Default.h @@ -19,7 +19,7 @@ #define default_node_info_broadcast_secs 3 * 60 * 60 #define default_neighbor_info_broadcast_secs 6 * 60 * 60 #define min_node_info_broadcast_secs 60 * 60 // No regular broadcasts of more than once an hour -#define min_neighbor_info_broadcast_secs 2 * 60 * 60 +#define min_neighbor_info_broadcast_secs 4 * 60 * 60 #define default_mqtt_address "mqtt.meshtastic.org" #define default_mqtt_username "meshdev"