From 66b94d828f34f0350a34b2b225d5bf2d984cc91f Mon Sep 17 00:00:00 2001 From: stswangzhiping <59632378+stswangzhiping@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:40:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=98=E5=8E=9F=20inactive=20?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=20restartGateway=20+=20showTime=20keepalive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 还原 7737e08:removeProviderByName 重新调用 restartGateway(), inactive/active 状态变化均重启 gateway 使 openclaw.json 生效 2. led.js showTime() 加 30s keepalive 定时器:持续向 vfdservice 管道写入,防止长时间无写入后管道"冷却",导致随后 showPin() 调用 openSync(FIFO, 'w') 因无读端而阻塞、blink timer 无法触发 Made-with: Cursor --- lib/led.js | 8 +++++++- lib/openclaw-provider.js | 4 +--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/led.js b/lib/led.js index 8064f63..c778597 100644 --- a/lib/led.js +++ b/lib/led.js @@ -254,9 +254,15 @@ class Display { showTime() { this._stopBlink(); - log.debug('display', '[vfd] #s1'); writeVfdPipeClock(); log.info('display', '显示屏 → 时间'); + // 每 30s 刷新一次,保持 vfdservice 持续从管道读取, + // 防止长时间无写入后管道"冷却",导致后续 showPin 写入阻塞 + const refresh = () => { + writeVfdPipeClock(); + this._blinkTimer = setTimeout(refresh, 30_000); + }; + this._blinkTimer = setTimeout(refresh, 30_000); } showPin(pin) { diff --git a/lib/openclaw-provider.js b/lib/openclaw-provider.js index 5824ba1..a507560 100644 --- a/lib/openclaw-provider.js +++ b/lib/openclaw-provider.js @@ -161,9 +161,7 @@ function removeProviderByName(providerId) { } log.info('openclaw-provider', `provider 已移除: ${providerId}`); - // 注意:此处不重启 gateway。inactive 期间 frp 隧道已断开,无人访问 gateway; - // 下次 active 时 applyFullProviderFromVps 会写完整 config 并重启。 - // 若在此处 kill gateway,会破坏 vfdservice 管道,导致 PIN 码无法在数码管上闪烁。 + restartGateway(); } function removeProviderFromConfig(config, providerId) {