AprilNEA/OpenLogi · error
DPI write failed: requested
Error message
DPI write failed: requested {target}, device still reports {before} What it means
Round-trip verification failure in `openlogi diag dpi`: the set_dpi write was accepted, but the post-write read-back returns exactly the pre-write DPI, meaning the device applied nothing. Because the requested target was already validated against the device's supported list and is guaranteed different from the current value, a no-op read-back can only indicate a device/firmware fault (write silently ignored), not a bad input, so the diagnostic bails instead of reporting success.
Solutions
- Re-run the diagnostic — transient HID++ write failures can present as silent no-ops
- Power-cycle or re-pair the device and retry
- Try a different supported --target value to see whether all writes or just one step are ignored
- Compare with other diag round-trips to isolate whether the device's write path is generally broken
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/openlogi-cli/src/cmd/diag/dpi.rs:76 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of AprilNEA/OpenLogi@e846e6f4b4 (2026-09-13).
Data as JSON: /api/errors/5d2d6ca5b2f9f917.
Report an issue: GitHub.
Appendix: source
Thrown at crates/openlogi-cli/src/cmd/diag/dpi.rs:76
return Ok(());
}
println!(" writing DPI: {target}");
openlogi_hid::set_dpi(&route, target)
.await
.context("write DPI")?;
let after = openlogi_hid::get_dpi(&route)
.await
.context("read DPI after write")?;
println!(" read-back DPI: {after}");
// `target` is always a device-reported value, so a mismatch means the
// device adjusted it — fine if it landed on another supported value, but a
// no-op write (`after == before`) or an off-list read-back is a real fault.
// (`target != before` is guaranteed by the early return above.)
if after == before {
anyhow::bail!("DPI write failed: requested {target}, device still reports {before}");
}
if after != target {
if info.capabilities.contains(after) {
println!(" note: device snapped {target} → {after}");
} else {
anyhow::bail!(
"DPI write failed: requested {target}, device reports {after} \
which is not in its supported list"
);
}
}
println!(" restoring DPI: {before}");
openlogi_hid::set_dpi(&route, before)
.await
.context("restore DPI")?;
println!("✓ DPI round-trip OK");View on GitHub (pinned to e846e6f4b4)