feat(mesh-ui): region-recommended RNode plan applies from the setup modal too
Demo images / Build & push demo images (push) Successful in 4m4s
Demo images / Build & push demo images (push) Successful in 4m4s
The device-detected modal's region selector now drives real RNode settings instead of a "managed by the daemon config" shrug: choosing a region shows its concrete plan (frequency/bw/SF/CR/power) and Apply & Connect writes it through mesh.rnode-config-apply — the same radio-confirmed round-trip as the Device panel, best-effort so a plan failure never aborts the connect. RNODE_REGION_PLANS moves to utils/loraRegions (single source shared by panel + modal). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
f394c02055
commit
4773b32a76
@@ -256,8 +256,11 @@
|
||||
<p v-if="effectiveKind === 'meshcore' && rfPreset" class="text-[11px] text-sky-300/80 mt-1">
|
||||
MeshCore RF params for {{ selectedRegion?.code }} are applied to the radio automatically on connect.
|
||||
</p>
|
||||
<p v-if="effectiveKind === 'reticulum'" class="text-[11px] text-sky-300/80 mt-1">
|
||||
RNode radio parameters (frequency / bandwidth / SF / CR) are managed by the Reticulum daemon's interface config on this node.
|
||||
<p v-if="effectiveKind === 'reticulum' && form.region && RNODE_REGION_PLANS[form.region]" class="text-[11px] text-sky-300/80 mt-1">
|
||||
RNode plan for {{ form.region }}: {{ (RNODE_REGION_PLANS[form.region].frequency / 1e6).toFixed(4) }} MHz, {{ RNODE_REGION_PLANS[form.region].bandwidth / 1000 }} kHz, SF{{ RNODE_REGION_PLANS[form.region].spreading_factor }}, CR4/{{ RNODE_REGION_PLANS[form.region].coding_rate }}, {{ RNODE_REGION_PLANS[form.region].txpower }} dBm — applied on connect, and the radio confirms it.
|
||||
</p>
|
||||
<p v-else-if="effectiveKind === 'reticulum'" class="text-[11px] text-sky-300/80 mt-1">
|
||||
Pick a region to apply its recommended RNode RF plan on connect — editable any time in Mesh → Device settings.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -302,7 +305,7 @@ import { useRouter } from 'vue-router'
|
||||
import BaseModal from '@/components/BaseModal.vue'
|
||||
import { useMeshStore, type MeshDeviceProbe, type MeshConfigureParams, type FlashFirmwareFamily, type FlashBoard, type FlashJobStatus } from '@/stores/mesh'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import { LORA_REGIONS, regionByCode, suggestRegionFromLatLon, meshcorePlanFor } from '@/utils/loraRegions'
|
||||
import { LORA_REGIONS, regionByCode, suggestRegionFromLatLon, meshcorePlanFor, RNODE_REGION_PLANS } from '@/utils/loraRegions'
|
||||
import { resolveMeshDeviceImage } from '@/utils/meshDeviceImages'
|
||||
|
||||
const mesh = useMeshStore()
|
||||
@@ -501,6 +504,18 @@ async function applySetup() {
|
||||
}
|
||||
}
|
||||
await mesh.configure(params)
|
||||
// RNode radios: the region's recommended RF plan is applied through the
|
||||
// Reticulum daemon's persisted settings (mesh.rnode-config-apply), the
|
||||
// same round-trip the Device panel uses — the radio confirms the values
|
||||
// itself after the daemon restarts with them. Best-effort here: a
|
||||
// failure must not abort the connect the user just asked for.
|
||||
if (effectiveKind.value === 'reticulum' && form.value.region) {
|
||||
const plan = RNODE_REGION_PLANS[form.value.region]
|
||||
if (plan) {
|
||||
mesh.suppressDeviceDetect()
|
||||
void mesh.applyRnodeConfig({ enabled: true, port: null, ...plan }).catch(() => {})
|
||||
}
|
||||
}
|
||||
mesh.dismissDetectedDevice(path)
|
||||
void router.push('/dashboard/mesh')
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user