From 5d12edbe076068b95f25381e332dcbc05ddc2bc1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 7 Mar 2026 11:13:55 -0600 Subject: [PATCH] Add convenience userpref for disabling lora during development and testing --- src/mesh/NodeDB.cpp | 4 ++++ userPrefs.jsonc | 1 + 2 files changed, 5 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 529f50003..c0e43a460 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1302,6 +1302,10 @@ void NodeDB::loadFromDisk() RadioInterface::bootstrapLoRaConfigFromPreset(config.lora); } +#if defined(USERPREFS_LORA_TX_DISABLED) && USERPREFS_LORA_TX_DISABLED + config.lora.tx_enabled = false; +#endif + if (backupSecurity.private_key.size > 0) { LOG_DEBUG("Restoring backup of security config"); config.security = backupSecurity; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 9e916aae2..b81f09362 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -18,6 +18,7 @@ // "USERPREFS_CHANNEL_2_UPLINK_ENABLED": "false", // "USERPREFS_CONFIG_GPS_MODE": "meshtastic_Config_PositionConfig_GpsMode_ENABLED", // "USERPREFS_CONFIG_LORA_IGNORE_MQTT": "true", + // "USERPREFS_LORA_TX_DISABLED": "1", // If set, forces config.lora.tx_enabled=false during lora bootstrap // "USERPREFS_CONFIG_LORA_REGION": "meshtastic_Config_LoRaConfig_RegionCode_US", // "USERPREFS_CONFIG_OWNER_LONG_NAME": "My Long Name", // "USERPREFS_CONFIG_OWNER_SHORT_NAME": "MLN",