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 <noreply@anthropic.com>
This commit is contained in:
parent
5ab569f150
commit
33b96f4acf
@ -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")?;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user