Commit Graph

16 Commits

Author SHA1 Message Date
stswangzhiping
8f5a8ec896 fix(led): swap WiFi(play)/LAN(wifi+eth), LAN carrier via CLAWD_ETH_IFACE, faster alarm
- WifiLed drives play; LanLed drives wifi+eth pair (matches panel silkscreen)
- hasLanCableCarrier(): CLAWD_ETH_IFACE-only carrier when set (reliable unplug)
- LAN poll 1s; config.activated persisted for immediate setApps on boot/reconnect
- setApps double vfdOn alarm after 50ms for slow OpenVFD
- Clear activated + setSetup on credential errors
- install.sh env comment for CLAWD_ETH_IFACE

Made-with: Cursor
2026-03-28 21:50:56 +08:00
stswangzhiping
347b19a0c9 feat(led): OpenVFD sysfs (wifi+eth, alarm, play/lan), skip BT without hci
- Write /sys/class/leds/openvfd led_on/led_off (CLAWD_OPENVFD_PATH)
- WiFi product LED: wifi+eth together; SETUP/APPS -> alarm off/on
- LanLed polls hasWiredCarrier -> play; export led.lan, start/stop from client
- BT monitor only if CLAWD_DISABLE_BT unset and hci* exists (RK3528)
- Display strings remain debug-only (数码管暂不驱动)
- install.sh env template: CLAWD_DISABLE_BT, CLAWD_OPENVFD_PATH comments

Made-with: Cursor
2026-03-28 21:35:38 +08:00
stswangzhiping
06d06fdd1e fix(systemd): use systemd-notify + NotifyAccess=all for watchdog
unix_dgram to NOTIFY_SOCKET failed on rk3528 (embedded Node), so WATCHDOG=1 never
reached systemd despite WATCHDOG_USEC fallback. Switch to exec systemd-notify with
NOTIFY_SOCKET in child env; unit sets NotifyAccess=all so cgroup may notify.

Users must reload unit (re-run install.sh or add NotifyAccess=all manually).

Made-with: Cursor
2026-03-28 14:54:56 +08:00
stswangzhiping
fdc1e9fbd3 fix(systemd): pet watchdog when WATCHDOG_USEC missing; StartLimitInterval for old systemd
Embedded units may set WatchdogSec but omit WATCHDOG_USEC; SD_NOTIFY_INTERVAL was 0 so no
WATCHDOG=1 was sent and systemd killed the main process after ~60s.

Replace StartLimitIntervalSec with StartLimitInterval= for older systemd (journal warning).

Made-with: Cursor
2026-03-28 14:49:07 +08:00
stswangzhiping
402440aadc refactor(led): drop openvfd sysfs writes, log [vfd] at debug
- WiFi/BT/status/display: no fs/tee; preserve info-level state messages
- install: remove ExecStartPre openvfd init

Made-with: Cursor
2026-03-27 16:31:17 +08:00
stswangzhiping
7823edc7b3 fix(install): skip git/tarball when package.json already present (offline BOX)
Made-with: Cursor
2026-03-27 13:59:54 +08:00
stswangzhiping
884b0dc50a feat(openclaw): persist config as ~/.openclaw/openclaw.json
- Read gateway token/port via JSON.parse (same structure as former YAML)
- Update claw.cutos.ai origin by replacing URLs in JSON string fields
- Export resolveOpenclawConfigFile() for frpc + client
- Drop js-yaml dependency
- install: ExecStartPre touches openvfd only if nodes exist (3528-friendly)
- Add tools/deploy-rsync.sh for syncing /opt/clawd over SSH

Made-with: Cursor
2026-03-27 13:49:23 +08:00
stswangzhiping
ffa13b7c81 fix: captive portal 改用 IP 地址 10.42.0.1 替代域名
Made-with: Cursor
2026-03-22 08:04:20 +08:00
stswangzhiping
d3bd5ca3e7 fix: replace network-online.target with NetworkManager.service to avoid 60s+ startup delay
Made-with: Cursor
2026-03-20 08:28:55 +08:00
stswangzhiping
8f158eeeb2 fix: turn off LEDs on service start, suppress Err0 before first WS success
Made-with: Cursor
2026-03-19 23:27:42 +08:00
stswangzhiping
64f4050014 fix: EROFS dns config, double WS connection, and watchdog timeout
1. EROFS: install.sh pre-writes DNS hijack config to dnsmasq-shared.d
   since /etc may be read-only at runtime. dns-hijack.js gracefully
   falls back to checking if config already exists.

2. Double WS: add _connectionStarted guard to prevent _proceedWithConnection
   from being called twice (via event + hasInternet check).

3. Watchdog: move _startSdNotify() to start() beginning so READY=1
   is sent immediately, not delayed until network is ready.

Made-with: Cursor
2026-03-16 12:54:46 +08:00
stswangzhiping
dac68f78b4 fix: clawd-rfkill.service failed due to systemd $ expansion
systemd expands $rf as env var (empty), breaking the inline script.
Move rfkill logic to standalone script to avoid escaping issues.
Also use quoted heredoc to prevent bash expansion in install.sh.

Made-with: Cursor
2026-03-16 11:49:07 +08:00
stswangzhiping
8a6e5b3666 fix: dnsmasq path detection and WiFi rfkill persistence
- dns-hijack.js: replace `which` with multi-path search (/usr/sbin etc.)
  since dnsmasq is often not in normal user PATH
- install.sh: auto-enable NetworkManager for WiFi provisioning
- install.sh: unblock WiFi rfkill at install time
- install.sh: create clawd-rfkill.service for persistent boot-time unlock

Made-with: Cursor
2026-03-16 10:06:30 +08:00
stswangzhiping
eb9f4ab1c3 feat: add WiFi provisioning for headless devices (AP + Captive Portal)
- Add lib/network.js: WiFi scan, connect, AP hotspot via nmcli
- Add lib/dns-hijack.js: dnsmasq management for DNS hijack + DHCP
- Add lib/captive-server.js: embedded HTTP captive portal with WiFi setup page
- Add lib/provisioning.js: orchestrator (detect network -> AP mode -> wait -> exit)
- Update client.js: call ensureNetwork() before WS connection
- Update install.sh: auto-install dnsmasq dependency

Made-with: Cursor
2026-03-16 08:58:51 +08:00
stswangzhiping
b3770d21d4 feat: add structured logging, process watchdog, and systemd hardening
- Add lib/logger.js: timestamped structured logging with 5MB x 5 file rotation
- Add lib/watchdog.js: generic child process supervisor with rate-limited restarts
- Enhance client.js: WS ping/pong liveness detection, uncaughtException/unhandledRejection handlers, systemd sd-notify integration
- Refactor frpc.js: FrpcManager now delegates to Watchdog instead of manual spawn/exit
- Enhance install.sh: environment file, log directory, systemd resource limits, security hardening, WatchdogSec=60
- Replace all console.log/warn/error with structured logger across modules

Made-with: Cursor
2026-03-16 07:31:19 +08:00
stswangzhiping
222c38a707 feat: initial clawd implementation - WebSocket daemon for claw box
Made-with: Cursor
2026-03-14 20:41:26 +08:00