From c834252f1cd5646721ad9b08894f6247c9b8810d Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sat, 11 Feb 2023 17:16:48 +0100 Subject: [PATCH 1/2] Check if nodeInfoModule exists (e.g. for Repeater) --- src/mesh/MeshService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 85dbc039b..80fea011b 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -76,7 +76,7 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp) powerFSM.trigger(EVENT_PACKET_FOR_PHONE); // Possibly keep the node from sleeping nodeDB.updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio - if (!nodeDB.getNode(mp->from)->has_user) { + if (!nodeDB.getNode(mp->from)->has_user && nodeInfoModule) { LOG_INFO("Heard a node we don't know, sending NodeInfo and asking for a response.\n"); nodeInfoModule->sendOurNodeInfo(mp->from, true); } From 5ca3d9169a1d0c2767d9311d2d2bb7dba14de18f Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sat, 11 Feb 2023 17:17:11 +0100 Subject: [PATCH 2/2] Only set node_info_broadcast_secs when not a Router --- src/mesh/NodeDB.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index f8cdaf547..5c28f5261 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -170,7 +170,8 @@ void NodeDB::installDefaultConfig() config.lora.hop_limit = HOP_RELIABLE; config.position.gps_enabled = true; config.position.position_broadcast_smart_enabled = true; - config.device.node_info_broadcast_secs = 3 * 60 * 60; + if (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER) + config.device.node_info_broadcast_secs = 3 * 60 * 60; config.device.serial_enabled = true; resetRadioConfig(); strncpy(config.network.ntp_server, "0.pool.ntp.org", 32);