From 33b96f4acfb670d12be6df7c5a5ef6781c4224a7 Mon Sep 17 00:00:00 2001 From: ssmithx Date: Mon, 29 Jun 2026 16:52:06 +0000 Subject: [PATCH] fix(openwrt): enable radio0 when configuring WISP configure_wisp was setting up wireless.wwan but leaving radio0.disabled=1, so wifi reload did nothing and the sta interface never appeared. Explicitly set radio0.disabled=0 before committing the wireless UCI config. Co-Authored-By: Claude Sonnet 4.6 --- core/openwrt/src/wan.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/openwrt/src/wan.rs b/core/openwrt/src/wan.rs index b75ef866..4620b131 100644 --- a/core/openwrt/src/wan.rs +++ b/core/openwrt/src/wan.rs @@ -13,6 +13,9 @@ pub fn configure_wisp(router: &Router, config: &WispConfig) -> Result<()> { let radio = detect_radio(router)?; + // Ensure the radio is enabled (disabled=1 by default on fresh flash) + router.uci_set("wireless.radio0.disabled", "0")?; + // Create/update named sta wifi-iface "wwan" (idempotent: uci set creates if absent) router.uci_set("wireless.wwan", "wifi-iface")?; router.uci_set("wireless.wwan.device", &radio)?; @@ -34,8 +37,9 @@ pub fn configure_wisp(router: &Router, config: &WispConfig) -> Result<()> { ensure_wwan_in_wan_zone(router)?; // Apply wireless changes; fall back to full network restart if wifi reload fails - let (_, code) = router.run("wifi reload 2>&1")?; + let (out, code) = router.run("wifi reload 2>&1")?; if code != 0 { + info!("[{}] wifi reload failed ({}): {} — falling back to network restart", router.host, code, out.trim()); router.run_ok("/etc/init.d/network restart 2>&1")?; }