OpenClaw 实战:让 AI 拥有'眼睛'——摄像头访问完全指南
本文介绍如何在 WSL2 环境下为 OpenClaw AI 助手配置摄像头访问功能,实现图片分析与重点内容提取。
探索过程
第一阶段:OpenClaw Node 配对(失败)
在 WSL2 中安装 OpenClaw 后,尝试通过 Windows 上的 Node.js 控制摄像头。由于 WSL2 网络隔离问题,折腾 3 小时+ 后放弃。
1. 安装 Node.js 下载绿色版 Node.js (v24.14.0),遇到 PowerShell 执行策略限制等问题。
# 绿色版 Node.js 配置
$nodePath = "D:\WSL\node-v24.14.0-win-x64"
$env:Path += ";$nodePath"
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$nodePath", "User")
问题 1:PowerShell 执行策略限制
报错:npm : File D:\...\npm.ps1 cannot be loaded because running scripts is disabled on this system.
解决:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
问题 2:npm 需要 Git
报错:npm error code ENOENT ... spawn git
解决:手动下载并安装 Git for Windows (v2.47.1)。
问题 3:npm 配置错误
之前尝试 npm config set git false 导致后续安装失败。
解决:
npm config delete git
1.2 安装 OpenClaw Node
npm install -g openclaw
openclaw node install
openclaw node restart
openclaw node status
1.3 配对失败原因分析
- 端口占用:WSL Gateway 已占用 18789 端口,Windows Node 无法绑定。
- 网络隔离:WSL2 运行在 Hyper-V 虚拟机中,与 Windows 主机网络隔离。WSL 的 localhost Windows 访问不到。
gateway connect failed: Error: device signature invalid node host gateway closed (1008): device signature invalid
3. **配置验证失败**:
Invalid config at /home/kim/.openclaw/openclaw.json: - plugins.slots.memory: plugin not found: memory-core
尝试修复配置:
```bash
openclaw config.set agents.defaults.memorySearch.enabled false
openclaw doctor --fix
最终因 WSL2 架构限制导致 Windows Node 无法与 WSL Gateway 建立稳定连接,决定更换方案。
第二阶段:浏览器方案(临时可用)
使用第三方网站如 webcamtests.com 调用设备摄像头,依赖 Chrome 扩展(OpenClaw Browser Relay)。
功能:


