diff --git a/core/archipelago/src/mesh/meshtastic.rs b/core/archipelago/src/mesh/meshtastic.rs index 29206870..d8127ede 100644 --- a/core/archipelago/src/mesh/meshtastic.rs +++ b/core/archipelago/src/mesh/meshtastic.rs @@ -296,11 +296,31 @@ impl MeshtasticDevice { return Ok(false); } match self.current_region { - Some(cur) if cur == code => Ok(false), - _ => { + // The radio already has a REAL region (US, EU_868, ANZ, …). RESPECT + // it — never override the region the user flashed/configured. Forcing + // our configured region onto, say, a US radio would put it on an + // illegal band and cut it off from its local mesh. Off-the-shelf + // devices keep whatever region they came with; `code` (the + // mesh-config region) is only the fallback for a fresh radio below. + Some(cur) if cur != REGION_UNSET => { + if cur != code { + debug!( + device_region = cur, + configured_region = code, + "Respecting the radio's own LoRa region (not overriding with the configured one)" + ); + } + Ok(false) + } + // Region is UNSET → a fresh radio is RF-silent and can't mesh at all. + // Set the operator-configured region so it can transmit/receive. + Some(_) => { self.set_lora_region(code).await?; Ok(true) } + // Region unknown (never reported in want_config) — don't guess / + // don't override; leave it for the user to set. + None => Ok(false), } }