fix: stabilize rk3588 wifi provisioning

This commit is contained in:
2026-05-24 20:36:37 +08:00
parent 306243eb6a
commit a85732aa80
5 changed files with 267 additions and 52 deletions

View File

@@ -263,11 +263,12 @@ class ClawClient {
_connect() {
if (this._stopped) return;
// AP 模式 + 无网:不建立 WS5s 后重新检查(有线经 -I ping 仍通则建立,避免热点误挡 WS
if (this._provisionMgr && this._provisionMgr.isApMode() && !hasInternet() && !hasWiredInternetProbe()) {
// AP 模式下 hasInternet() 可能被热点本地网络 / NetworkManager limited 状态误判。
// 只有明确探测到有线口可访问公网时,才允许进入 WS 连接流程并显示 Conn。
if (this._provisionMgr && this._provisionMgr.isApMode() && !hasWiredInternetProbe()) {
led.display.showAP();
log.info('clawd', 'AP 模式无网络5s 后重新检查...');
this._backoff = 1_000; // 有时立即快速重连
log.info('clawd', 'AP 模式无有线网络5s 后重新检查...');
this._backoff = 1_000; // 有线恢复时立即快速重连
this._wsFailCount = 0; // 不计入失败
setTimeout(() => this._connect(), 5_000);
return;