Metadata-Version: 2.4
Name: hermes-agent-iot
Version: 0.23.1
Summary: IoT and low-resource packaging of Hermes Agent, maintained as a native-compatible fork
Author: Nous Research
License-Expression: MIT
Project-URL: Homepage, https://github.com/matttest0080-prog/hermes-agent-iot
Project-URL: Repository, https://github.com/matttest0080-prog/hermes-agent-iot
Project-URL: Documentation, https://github.com/matttest0080-prog/hermes-agent-iot/blob/pi2-lite/README_PI2.md
Project-URL: Upstream project, https://github.com/NousResearch/hermes-agent
Requires-Python: <3.15,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai==2.54.0
Requires-Dist: certifi==2026.10.19
Requires-Dist: truststore==0.10.5
Requires-Dist: python-dotenv==1.2.4
Requires-Dist: fire==0.7.1
Requires-Dist: httpx[socks]==0.28.1
Requires-Dist: rich==14.3.4
Requires-Dist: tomli-w==1.2.0
Requires-Dist: ruamel.yaml==0.18.16
Requires-Dist: ruamel.yaml.clib==0.2.15; python_version >= "3.14" and platform_python_implementation == "CPython" and (sys_platform == "darwin" or (sys_platform == "linux" and platform_machine in "x86_64 aarch64 i686") or (sys_platform == "win32" and platform_machine in "AMD64 x86"))
Requires-Dist: requests==2.34.2
Requires-Dist: jinja2==3.1.6
Requires-Dist: firecrawl-anydoc==0.2.4
Requires-Dist: pydantic==2.14.1
Requires-Dist: prompt_toolkit==3.0.53
Requires-Dist: croniter==6.2.4
Requires-Dist: snowballstemmer==3.1.1
Requires-Dist: packaging==26.3
Requires-Dist: Markdown==3.11.2
Requires-Dist: PyJWT[crypto]==2.15.1
Requires-Dist: urllib3<3,>=2.8.0
Requires-Dist: cryptography==50.0.2
Requires-Dist: tzdata==2025.3; sys_platform == "win32"
Requires-Dist: psutil==7.2.2; sys_platform != "android"
Requires-Dist: psutil==7.2.2; sys_platform == "android"
Requires-Dist: websockets==15.0.1
Requires-Dist: browser-harness-hermes-compat==0.1.13.post1
Requires-Dist: pathspec==1.1.1
Requires-Dist: fastapi<1,>=0.104.0
Requires-Dist: uvicorn<1,>=0.31.0
Requires-Dist: httptools<0.9,>=0.6.3
Requires-Dist: watchfiles<2,>=0.20
Requires-Dist: python-multipart<1,>=0.0.9
Requires-Dist: ptyprocess<1,>=0.7.0; sys_platform != "win32"
Requires-Dist: pywinpty<4,>=3.0.5; sys_platform == "win32"
Requires-Dist: pywin32<312,>=306; sys_platform == "win32"
Requires-Dist: winrt-windows-applicationmodel<4,>=3.2.1; sys_platform == "win32"
Requires-Dist: winrt-windows-foundation<4,>=3.2.1; sys_platform == "win32"
Requires-Dist: winrt-windows-foundation-collections<4,>=3.2.1; sys_platform == "win32"
Requires-Dist: winrt-windows-services-store<4,>=3.2.1; sys_platform == "win32"
Requires-Dist: Pillow==13.0.0
Requires-Dist: resvg-py==0.5.0
Requires-Dist: concurrent-log-handler==0.9.30; sys_platform == "win32"
Requires-Dist: nemo-relay<0.12,>=0.11; (sys_platform == "darwin" and platform_machine == "arm64") or (sys_platform == "linux" and platform_machine == "x86_64" and "android" not in platform_release) or (sys_platform == "linux" and platform_machine == "aarch64" and "android" not in platform_release) or (sys_platform == "win32" and platform_machine == "AMD64") or (sys_platform == "win32" and platform_machine == "ARM64")
Provides-Extra: uvloop
Requires-Dist: uvloop<0.24,>=0.15.1; (sys_platform != "win32" and sys_platform != "cygwin" and sys_platform != "android" and platform_machine != "armv7l" and platform_python_implementation != "PyPy") and extra == "uvloop"
Provides-Extra: anthropic
Requires-Dist: anthropic==0.125.0; extra == "anthropic"
Provides-Extra: exa
Requires-Dist: exa-py==2.26.0; extra == "exa"
Provides-Extra: firecrawl
Requires-Dist: firecrawl-py==4.53.2; extra == "firecrawl"
Provides-Extra: parallel-web
Requires-Dist: parallel-web==0.6.0; extra == "parallel-web"
Provides-Extra: ddgs
Requires-Dist: ddgs==9.16.0; extra == "ddgs"
Provides-Extra: fal
Requires-Dist: fal-client==0.14.1; extra == "fal"
Provides-Extra: edge-tts
Requires-Dist: edge-tts==7.3.1; extra == "edge-tts"
Provides-Extra: neutts
Requires-Dist: neutts[all]==1.4.1; python_version < "3.14" and extra == "neutts"
Provides-Extra: kittentts
Requires-Dist: soundfile==0.14.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or sys_platform != "darwin")) and extra == "kittentts"
Provides-Extra: piper
Requires-Dist: piper-tts==1.8.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or sys_platform != "darwin")) and extra == "piper"
Provides-Extra: modal
Requires-Dist: modal==1.6.2; extra == "modal"
Requires-Dist: cbor2==5.9.0; platform_machine == "armv7l" and extra == "modal"
Provides-Extra: daytona
Requires-Dist: daytona==0.225.0; extra == "daytona"
Provides-Extra: vercel
Requires-Dist: vercel==0.12.0; extra == "vercel"
Provides-Extra: google-meet
Requires-Dist: playwright==1.64.0; ((sys_platform in "linux darwin" and platform_machine in "x86_64 aarch64 arm64") or (sys_platform == "win32" and platform_machine in "AMD64 x86_64 ARM64 arm64 x86 i386 i686")) and extra == "google-meet"
Requires-Dist: websockets==15.0.1; ((sys_platform in "linux darwin" and platform_machine in "x86_64 aarch64 arm64") or (sys_platform == "win32" and platform_machine in "AMD64 x86_64 ARM64 arm64 x86 i386 i686")) and extra == "google-meet"
Provides-Extra: messaging
Requires-Dist: python-telegram-bot[webhooks]==22.8; extra == "messaging"
Requires-Dist: discord.py==2.7.1; extra == "messaging"
Requires-Dist: PyNaCl==1.6.2; extra == "messaging"
Requires-Dist: davey==0.1.4; extra == "messaging"
Requires-Dist: aiohttp==3.14.5; extra == "messaging"
Requires-Dist: brotlicffi==1.2.1.0; extra == "messaging"
Requires-Dist: slack-bolt==1.30.0; extra == "messaging"
Requires-Dist: slack-sdk==3.45.0; extra == "messaging"
Requires-Dist: qrcode==7.4.2; extra == "messaging"
Provides-Extra: cron
Provides-Extra: slack
Requires-Dist: slack-bolt==1.30.0; extra == "slack"
Requires-Dist: slack-sdk==3.45.0; extra == "slack"
Requires-Dist: aiohttp==3.14.5; extra == "slack"
Provides-Extra: matrix
Requires-Dist: mautrix[encryption]==0.21.1; sys_platform == "linux" and extra == "matrix"
Requires-Dist: aiosqlite==0.22.1; sys_platform == "linux" and extra == "matrix"
Requires-Dist: asyncpg==0.32.0; sys_platform == "linux" and extra == "matrix"
Requires-Dist: aiohttp-socks==0.12.0; sys_platform == "linux" and extra == "matrix"
Requires-Dist: aiohttp==3.14.5; sys_platform == "linux" and extra == "matrix"
Provides-Extra: wecom
Requires-Dist: defusedxml==0.7.1; extra == "wecom"
Provides-Extra: keychain
Requires-Dist: keyring==25.7.0; extra == "keychain"
Provides-Extra: tts-premium
Requires-Dist: elevenlabs==1.59.0; extra == "tts-premium"
Provides-Extra: voice
Requires-Dist: faster-whisper==1.2.1; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or platform_system != "Darwin")) and extra == "voice"
Requires-Dist: av==18.1.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or platform_system != "Darwin")) and extra == "voice"
Requires-Dist: sounddevice==0.5.6; extra == "voice"
Requires-Dist: numpy==2.5.4; extra == "voice"
Provides-Extra: wake
Requires-Dist: pyopen-wakeword==1.1.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or sys_platform != "darwin")) and extra == "wake"
Requires-Dist: sherpa-onnx==1.13.8; extra == "wake"
Requires-Dist: sherpa-onnx-core==1.13.8; extra == "wake"
Requires-Dist: sentencepiece==0.2.2; extra == "wake"
Requires-Dist: pypinyin==0.55.0; extra == "wake"
Requires-Dist: pvporcupine==4.0.3; extra == "wake"
Requires-Dist: sounddevice==0.5.6; extra == "wake"
Requires-Dist: numpy==2.5.4; extra == "wake"
Provides-Extra: telegram
Requires-Dist: python-telegram-bot[webhooks]==22.8; extra == "telegram"
Provides-Extra: discord
Requires-Dist: discord.py[voice]==2.7.1; extra == "discord"
Provides-Extra: stt-whisper
Requires-Dist: faster-whisper==1.2.1; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or platform_system != "Darwin")) and extra == "stt-whisper"
Requires-Dist: av==18.1.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or platform_system != "Darwin")) and extra == "stt-whisper"
Provides-Extra: audio-io
Requires-Dist: sounddevice==0.5.6; extra == "audio-io"
Requires-Dist: numpy==2.5.4; extra == "audio-io"
Provides-Extra: silk
Requires-Dist: pilk==0.2.4; extra == "silk"
Provides-Extra: wake-openwakeword
Requires-Dist: pyopen-wakeword==1.1.0; (sys_platform != "android" and platform_machine != "armv7l" and (platform_machine != "ARM64" or sys_platform != "win32") and (platform_machine != "x86_64" or sys_platform != "darwin")) and extra == "wake-openwakeword"
Provides-Extra: wake-sherpa
Requires-Dist: sherpa-onnx==1.13.8; extra == "wake-sherpa"
Requires-Dist: sherpa-onnx-core==1.13.8; extra == "wake-sherpa"
Requires-Dist: sentencepiece==0.2.2; extra == "wake-sherpa"
Requires-Dist: pypinyin==0.55.0; extra == "wake-sherpa"
Provides-Extra: wake-porcupine
Requires-Dist: pvporcupine==4.0.3; extra == "wake-porcupine"
Provides-Extra: google-chat
Requires-Dist: google-cloud-pubsub==2.43.0; (platform_machine != "ARM64" or sys_platform != "win32") and extra == "google-chat"
Provides-Extra: doc-extract
Requires-Dist: firecrawl-anydoc==0.2.4; extra == "doc-extract"
Provides-Extra: documents
Requires-Dist: python-docx==1.2.0; extra == "documents"
Requires-Dist: openpyxl==3.1.5; extra == "documents"
Requires-Dist: python-pptx==1.0.2; extra == "documents"
Requires-Dist: reportlab==5.1.0; extra == "documents"
Requires-Dist: pypdf==6.21.4; extra == "documents"
Provides-Extra: documents-pdf
Requires-Dist: pdfplumber==0.11.10; extra == "documents-pdf"
Requires-Dist: pypdfium2==5.14.0; extra == "documents-pdf"
Provides-Extra: trace-upload
Requires-Dist: huggingface-hub==1.33.0; extra == "trace-upload"
Provides-Extra: honcho
Requires-Dist: honcho-ai==2.2.0; extra == "honcho"
Provides-Extra: supermemory
Requires-Dist: supermemory==3.50.0; extra == "supermemory"
Provides-Extra: mem0
Requires-Dist: mem0ai==2.0.18; (platform_machine != "ARM64" or sys_platform != "win32") and extra == "mem0"
Provides-Extra: hindsight
Requires-Dist: hindsight-client==0.6.1; extra == "hindsight"
Provides-Extra: vision
Provides-Extra: pty
Provides-Extra: cli
Provides-Extra: mcp
Requires-Dist: mcp==2.3.0; extra == "mcp"
Requires-Dist: httpx2==2.15.1; extra == "mcp"
Requires-Dist: starlette==1.9.0; extra == "mcp"
Provides-Extra: nemo-relay
Provides-Extra: homeassistant
Requires-Dist: aiohttp==3.14.5; extra == "homeassistant"
Provides-Extra: mqtt
Requires-Dist: paho-mqtt==2.1.0; extra == "mqtt"
Provides-Extra: sms
Requires-Dist: aiohttp==3.14.5; extra == "sms"
Provides-Extra: teams
Requires-Dist: microsoft-teams-apps==2.1.1; extra == "teams"
Requires-Dist: aiohttp==3.14.5; extra == "teams"
Provides-Extra: computer-use
Requires-Dist: mcp==2.3.0; extra == "computer-use"
Requires-Dist: httpx2==2.15.1; extra == "computer-use"
Requires-Dist: starlette==1.9.0; extra == "computer-use"
Provides-Extra: acp
Requires-Dist: agent-client-protocol==0.9.0; extra == "acp"
Provides-Extra: mistral
Requires-Dist: mistralai==2.10.1; extra == "mistral"
Provides-Extra: otlp
Requires-Dist: opentelemetry-sdk==1.45.1; extra == "otlp"
Requires-Dist: opentelemetry-exporter-otlp-proto-http==1.45.1; extra == "otlp"
Provides-Extra: bedrock
Requires-Dist: boto3==1.43.115; extra == "bedrock"
Provides-Extra: vertex
Requires-Dist: google-auth==2.62.0; extra == "vertex"
Provides-Extra: azure-identity
Requires-Dist: azure-identity==1.26.0; extra == "azure-identity"
Provides-Extra: termux
Requires-Dist: python-telegram-bot[webhooks]==22.8; extra == "termux"
Requires-Dist: hermes-agent-iot[cron]==0.23.1; extra == "termux"
Requires-Dist: hermes-agent-iot[mcp]==0.23.1; extra == "termux"
Requires-Dist: hermes-agent-iot[acp]==0.23.1; extra == "termux"
Provides-Extra: termux-all
Requires-Dist: hermes-agent-iot[termux]==0.23.1; extra == "termux-all"
Requires-Dist: hermes-agent-iot[google]==0.23.1; extra == "termux-all"
Requires-Dist: hermes-agent-iot[sms]==0.23.1; extra == "termux-all"
Requires-Dist: hermes-agent-iot[web]==0.23.1; extra == "termux-all"
Requires-Dist: hermes-agent-iot[pty]==0.23.1; extra == "termux-all"
Provides-Extra: dingtalk
Requires-Dist: dingtalk-stream==0.24.3; extra == "dingtalk"
Requires-Dist: alibabacloud-dingtalk==2.2.65; extra == "dingtalk"
Requires-Dist: qrcode==7.4.2; extra == "dingtalk"
Provides-Extra: feishu
Requires-Dist: lark-oapi==1.7.5; extra == "feishu"
Requires-Dist: qrcode==7.4.2; extra == "feishu"
Provides-Extra: google
Requires-Dist: google-api-python-client==2.201.0; extra == "google"
Requires-Dist: google-auth==2.62.0; extra == "google"
Requires-Dist: google-auth-oauthlib==1.5.0; extra == "google"
Requires-Dist: google-auth-httplib2==0.4.4; extra == "google"
Requires-Dist: httplib2==0.32.0; extra == "google"
Requires-Dist: pyasn1==0.6.5; extra == "google"
Provides-Extra: youtube
Requires-Dist: youtube-transcript-api==1.2.4; extra == "youtube"
Provides-Extra: web
Requires-Dist: fastapi==0.133.1; extra == "web"
Requires-Dist: uvicorn==0.54.0; extra == "web"
Requires-Dist: starlette==1.9.0; extra == "web"
Requires-Dist: python-multipart==0.0.32; extra == "web"
Provides-Extra: all
Requires-Dist: hermes-agent-iot[cron]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[pty]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[mcp]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[uvloop]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[sms]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[acp]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[google]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[web]==0.23.1; extra == "all"
Requires-Dist: hermes-agent-iot[youtube]==0.23.1; extra == "all"
Provides-Extra: minimal
Requires-Dist: hermes-agent-iot[cli,pty]==0.23.1; extra == "minimal"
Provides-Extra: iot
Requires-Dist: hermes-agent-iot[acp,homeassistant,mcp,minimal,mqtt,sms]==0.23.1; extra == "iot"
Provides-Extra: rag
Requires-Dist: hermes-agent-iot[honcho,iot]==0.23.1; extra == "rag"
Provides-Extra: full
Requires-Dist: hermes-agent-iot[all]==0.23.1; extra == "full"
Dynamic: license-file

<p align="center">
  <img src="assets/banner.png" alt="Hermes Agent IoT" width="100%">
</p>

# Hermes Agent IoT

> Lightweight Hermes Agent for Raspberry Pi 2 / ARMv7, MQTT, Home Assistant, robotics, and low-resource edge AI.

<p align="center">
  <a href="https://pypi.org/project/hermes-agent-iot/"><img src="https://img.shields.io/badge/PyPI-hermes--agent--iot-blue?style=for-the-badge" alt="PyPI"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="License: MIT"></a>
  <a href="https://github.com/NousResearch/hermes-agent"><img src="https://img.shields.io/badge/Upstream-NousResearch%2Fhermes--agent-blueviolet?style=for-the-badge" alt="Upstream Hermes Agent"></a>
  <a href="README_PI2.md"><img src="https://img.shields.io/badge/Raspberry%20Pi%202-ARMv7-C51A4A?style=for-the-badge&logo=raspberrypi&logoColor=white" alt="Raspberry Pi 2"></a>
</p>

Hermes Agent IoT is an IoT/robotics-focused fork of [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent). The maintained `pi2-lite` branch focuses on constrained Raspberry Pi and edge deployments while preserving the upstream Hermes Agent runtime and ecosystem.

> **版本與升級注意事項：** [`0.22.5.post3` 已正式發布 PyPI](https://pypi.org/project/hermes-agent-iot/0.22.5.post3/)，使用保留 MIT 署名的獨立 `browser-harness-hermes-compat` 與 Pillow 13 修補；[正式產物與驗收紀錄](docs/release-v0.22.5.post3.md)已核對真正 tag CI／匿名 PyPI bytes。舊 `0.22.2.post1` 不含這輪安全修補。升級建議使用**全新 venv**，不要混裝官方／獨立 browser distributions；見 [相容性與遷移說明](docs/browser-harness-compat.md) 及 [同步驗證紀錄](docs/upstream-review-v0.22.5.md)。

## 相關影片

- [YouTube Shorts](https://www.youtube.com/shorts/8Nqv4ri6gH8)

## Why Hermes Agent IoT?

- **Raspberry Pi 2 / ARMv7:** verified low-resource installation path for 1 GB-class hardware.
- **IoT profiles:** dependency profiles for MQTT, Home Assistant, MCP/ACP, and remote-first RAG.
- **Edge-first deployment:** keep heavy AI inference remote while the Raspberry Pi handles agent orchestration and device integration.
- **Robotics direction:** foundation for GPIO, I2C, PWM, sensors, actuators, and robotics skills.
- **Upstream-aware:** IoT and ARMv7 compatibility changes are reviewed separately from fast-moving upstream development.

## Quick Start — Raspberry Pi 2

Hermes Agent IoT requires Python `>=3.11,<3.15`. Install it in a virtual environment:

```bash
python3 --version
python3 -m venv ~/.venvs/hermes-iot-0.22.5
source ~/.venvs/hermes-iot-0.22.5/bin/activate
python -m pip install --upgrade pip
python -m pip install 'hermes-agent-iot[minimal]==0.22.5.post3'
python -m pip check

hermes-iot setup --profile minimal
hermes-iot profile show
hermes setup model
hermes
```

> Do not use system pip, `sudo pip`, or `--break-system-packages`.

### Pi 2B 已回報：Gateway 連線失敗（原因待確認）

在 `0.22.5.post3` 的 Pi 2B 環境曾回報：

```text
Error: Gateway connection failed; no local fallback
```

**目前尚未重現原錯誤、根因未確認，不能視為已修復。** 使用者已確認啟用 `~/.venvs/hermes-iot-0.22.5`。後續唯讀診斷中，既有 gateway 回報 `ready`，本機 API TCP 可連，且一次 WebSocket 握手成功；這只代表當次連線，不等於原 CLI 啟動流程、指定 profile、冷啟動或長期連線已驗收。診斷沒有送模型請求、建立對話、重啟服務或修改設定。

此訊息表示 CLI 未完成 gateway 連線流程，且沒有轉為 local fallback；**不能僅憑訊息判定 gateway 未啟動或 venv 損壞**。先保留錯誤現場，不要為繞過錯誤強制 fallback、刪除 PID／lock 檔、重裝套件或反覆重啟服務。

回報時請提供：

```bash
printf 'VIRTUAL_ENV=%s\n' "${VIRTUAL_ENV:-<not activated>}"
command -v hermes
python -c 'import sys; from importlib.metadata import version; print(sys.executable); print(version("hermes-agent-iot"))'
```

另附**實際觸發錯誤的完整啟動指令與錯誤輸出**；若有 `-p` 等 profile 參數，請保留同一 profile 排查，不要任意切換 `HERMES_HOME` 或混用新舊 venv。若設定過 `HERMES_TUI_GATEWAY_URL`，只回報是否設定及已遮蔽憑證的目標；請勿貼出 `.env`、API key、token 或含憑證的 URL。單次握手成功不能取代原指令的重現與根因分析。

#### 復原方式：依狀態擇一，不是已證實的根因修復

先保留原錯誤輸出，確認使用同一 venv／profile。若命令指向舊環境，可重新啟用新版並清除 shell 的命令快取；不需要先重裝：

```bash
source ~/.venvs/hermes-iot-0.22.5/bin/activate
hash -r
command -v hermes

hermes_cmd=(hermes)  # 僅適用於原本沒有 -p 的 default profile
# 若原指令有 -p，改用：hermes_cmd=(hermes -p your-original-profile)
# 保留原有 HERMES_HOME，不要重設到另一個 home。
"${hermes_cmd[@]}" gateway status --deep
```

1. **Gateway 確定未執行，且已安裝對應服務：** 啟動該服務，再查狀態。若 owner／profile 被拒絕，先核對 CLI 提示的實際 owner，不加 `--force` 或 `--all`。

   ```bash
   "${hermes_cmd[@]}" gateway start
   "${hermes_cmd[@]}" gateway status --deep
   ```

2. **Gateway 確定未執行，且沒有安裝服務：** 在另一個終端重做上述 venv／profile 選擇後，前景啟動 gateway；保留該終端，再回原終端重試原啟動指令。不要在已有 owner 時另開一個 gateway，也不要加 `--replace`。

   ```bash
   "${hermes_cmd[@]}" gateway run
   ```

3. **Gateway 已就緒但 CLI 仍失敗：** 先重試原指令一次，保留同一 profile 與錯誤輸出。若有 `HERMES_TUI_GATEWAY_URL`，核對是否為原本要連的目標；只在確認設定錯誤後更正，不盲目清除它以切換成本機 gateway。`status` 顯示執行中仍不等於 WebSocket／原 CLI 路徑已通過；持續失敗就繼續蒐集遮敏後的診斷，不反覆重啟。

4. **已確認 owner 異常且安排好維護窗口時，才考慮受控重啟：** 先保留紀錄，確認受影響工作均已結束；multiplexer 可能服務多個 profiles。在維護終端執行下列命令並尊重活動工作／owner 的拒絕提示，**不加 `--force`／`--all`**。手動 gateway 可能轉為前景執行，請保留該終端，另開終端以同一 venv／profile 查狀態與重試原指令。

   ```bash
   "${hermes_cmd[@]}" gateway restart
   ```

以上是環境校正、服務啟動與受控復原的操作指引，**並未在這次診斷中執行啟動／重啟，也不是對本次錯誤已驗證的修復**。若仍失敗，請附原啟動指令、`gateway status --deep` 與已遮敏的近期 gateway log；不要刪鎖檔、改用 local fallback 或忽略服務拒絕訊息。

### Pi 2B: Gateway connection failure (English; cause not confirmed)

The following error was reported on Pi 2B with `0.22.5.post3`:

```text
Error: Gateway connection failed; no local fallback
```

**The original failure has not been reproduced and its root cause is unconfirmed. No fix has been verified.** The user confirmed the active venv was `~/.venvs/hermes-iot-0.22.5`. Later read-only checks found the existing gateway `ready`, its local API TCP port reachable, and one WebSocket handshake successful. That only verifies that particular connection, not the original CLI command, selected profile, cold start, or long-lived connection. The diagnostic made no model requests, created no conversation sessions, and did not restart services or change configuration.

The message means the CLI did not complete its gateway connection and did not fall back to local execution. **It does not, by itself, prove that the gateway is stopped or the venv is broken.** Preserve the error before trying recovery; do not force a local fallback, delete PID/lock files, reinstall packages, or repeatedly restart services to bypass it.

Collect these read-only details:

```bash
printf 'VIRTUAL_ENV=%s\n' "${VIRTUAL_ENV:-<not activated>}"
command -v hermes
python -c 'import sys; from importlib.metadata import version; print(sys.executable); print(version("hermes-agent-iot"))'
```

Also provide the **exact failing launch command and error output**, including any `-p` profile arguments. Keep the same profile and `HERMES_HOME`; do not mix old and new venvs. If `HERMES_TUI_GATEWAY_URL` was configured, report whether it is set and a credential-redacted target. Never post `.env`, API keys, tokens, or credential-bearing URLs. A later successful handshake does not establish why the original command failed.

#### Conditional recovery, not a confirmed root-cause fix

Preserve the original error and profile selection first. If the command resolves to an old environment, reactivate the intended venv and clear the shell's command cache instead of reinstalling:

```bash
source ~/.venvs/hermes-iot-0.22.5/bin/activate
hash -r
command -v hermes

hermes_cmd=(hermes)  # Default profile ONLY if the original command had no -p.
# Otherwise use: hermes_cmd=(hermes -p your-original-profile)
# Preserve the original HERMES_HOME; do not redirect it to another home.
"${hermes_cmd[@]}" gateway status --deep
```

1. **Gateway confirmed stopped, with a matching service already installed:** Start that service and check status again. If ownership/profile checks refuse the operation, inspect the reported owner rather than adding `--force` or `--all`.

   ```bash
   "${hermes_cmd[@]}" gateway start
   "${hermes_cmd[@]}" gateway status --deep
   ```

2. **Gateway confirmed stopped, with no installed service or existing owner:** In another terminal, repeat the same venv/profile selection above, then run the gateway in the foreground. Keep that terminal open and retry the original launch command from the first terminal. Do not start a second owner or add `--replace`.

   ```bash
   "${hermes_cmd[@]}" gateway run
   ```

3. **Gateway ready, but the CLI still fails:** Retry the original command once, retaining the same profile and error output. If `HERMES_TUI_GATEWAY_URL` is set, verify that it names the intended target; correct it only after confirming a configuration mistake. Do not blindly unset it to switch to a local gateway. A running process/status is not proof that the WebSocket or original CLI path works. If the error persists, collect redacted diagnostics instead of restarting repeatedly.

4. **Owner confirmed unhealthy, with an agreed maintenance window:** Preserve logs and finish all affected work before a controlled restart. A multiplexer may serve several profiles. Run the following in a maintenance terminal, respect active-work/ownership refusals, and **do not add `--force` or `--all`**. A manually managed gateway may remain in the foreground; keep its terminal open and use another terminal with the same venv/profile to check status and retry the original command.

   ```bash
   "${hermes_cmd[@]}" gateway restart
   ```

These are environment correction, startup, and controlled-recovery instructions. **No startup/restart actions were performed during this diagnostic, and none is a verified repair for this incident.** If it persists, provide the exact launch command, `gateway status --deep` output, and recent credential-redacted gateway logs. Do not delete locks, enable a local fallback, or bypass service refusals.

### Source checkout

Use the maintained `pi2-lite` branch when you need the complete repository assets:

```bash
git clone --branch pi2-lite --depth 1 \
  https://github.com/matttest0080-prog/hermes-agent-iot.git
cd hermes-agent-iot
bash setup-pi2-minimal.sh --profile minimal
source ~/.hermes-venv/bin/activate
hermes setup model
hermes
```

> Keep the clone directory. The source installer uses an editable Python installation, so moving or deleting the checkout can break the environment.

### Pi 2B 源碼實機驗收（未發布候選）

2026-11-13 在實體 Raspberry Pi 2 Model B Rev 1.1（`armv7l`、921 MiB、Raspbian 13 Trixie、Python 3.13.5）以來源 commit `690dc97c4bf4342d626a1cf3c7025f634aa7d262` 驗收 `0.23.0.post1` 的 `minimal` profile。全新隔離 venv 安裝完成，`pip check`、核心 CLI imports 與 `hermes --help` 通過。測試使用獨立 `HERMES_HOME`；**此版本未發布到 PyPI，亦未建立 release tag**。本次沒有呼叫模型或 gateway，因此不代表模型回合或其他 profiles 已驗收。詳見 [Pi 2 驗收紀錄](README_PI2.md#unreleased-source-candidate-hardware-test-0230post1)。

### Pi 2B source hardware validation (unreleased candidate)

On 2026-11-13, source commit `690dc97c4bf4342d626a1cf3c7025f634aa7d262` (`0.23.0.post1`) passed a fresh isolated `minimal` install on a physical Raspberry Pi 2 Model B Rev 1.1 (`armv7l`, 921 MiB, Raspbian 13 Trixie, Python 3.13.5). The installer, `pip check`, core CLI imports, and `hermes --help` passed with a separate `HERMES_HOME`. This candidate is **not published to PyPI and has no release tag**. No model request or gateway run was made; this does not validate a model round-trip or other profiles. See the [detailed Pi 2 test record](README_PI2.md#unreleased-source-candidate-hardware-test-0230post1).

### Pi 2B wheel validation (unreleased `0.23.1` candidate)

On 2026-11-16, the sanitized wheel built from commit `22678bc6d5175d0e8a59853ef2f4e940c3abb8ba` (`hermes_agent_iot-0.23.1-py3-none-any.whl`, SHA-256 `a54c171f419ee41c5215d0a2be9dcbcdf9a9cc6e50891cfe5f6ab7f153dac33a`) was installed on a physical Pi 2 Model B Rev 1.1 (`armv7l`, 921 MiB, Raspbian 13 Trixie, Python 3.13.5). Hash-locked `minimal` dependencies, wheel metadata/version, `pip check`, isolated `minimal` profile setup, core imports, and `hermes --help` passed. This was a local wheel candidate, not the final PyPI artifact; no model request or gateway run was made. See the [detailed Pi 2 test record](README_PI2.md#unreleased-0231-wheel-candidate-test-2026-11-16).

## Install Profiles

| Profile | Intended target |
| --- | --- |
| `minimal` | Raspberry Pi 2 / ARMv7 / 1 GB baseline |
| `iot` | MQTT, Home Assistant, MCP/ACP and related IoT integrations |
| `rag` | IoT plus Honcho / remote-first RAG |
| `full` | Stronger Raspberry Pi, ARM64, x86 edge server or VM |
| `dev` | Contributor and development systems |

Keep the PyPI extra and setup profile aligned. For example:

```bash
python -m pip install 'hermes-agent-iot[iot]==0.22.5.post3'
hermes-iot setup --profile iot
```

`full` and `dev` are not recommended for Raspberry Pi 2 / 1 GB systems.

## Project Status

| Capability | Status |
| --- | --- |
| Raspberry Pi 2 / ARMv7 minimal install | ✅ Verified |
| Public PyPI package | ✅ Available |
| Minimal dependency profile | ✅ Available |
| IoT dependency profile | ✅ Available |
| MQTT integration | ✅ Available |
| Home Assistant integration | ✅ Available |
| Remote-first RAG | ✅ Available |
| Robotics documentation | ✅ Available |
| GPIO abstraction | 🛠 Roadmap |
| I2C device layer | 🛠 Roadmap |
| PWM / servo control | 🛠 Roadmap |
| Sensor plugin framework | 🛠 Roadmap |
| ESP32 MQTT bridge | 🛠 Roadmap |

## Documentation

- [IoT Project Overview](IOT_PROJECT.md) — project goals, support status, profiles, and roadmap.
- [Raspberry Pi 2 Quick Start](README_PI2.md) — dependency matrix, configuration profiles, and Pi2 safety guidance.
- [Raspberry Pi 2 Manual](RASPBERRY_PI2_MANUAL.md) — detailed Pi2 deployment documentation.
- [Robotics](ROBOTICS.md) — robotics integration notes.
- [Security Policy](SECURITY.md) — vulnerability reporting and security guidance.
- [Upstream Hermes Agent documentation](https://hermes-agent.nousresearch.com/docs/) — general Hermes Agent features, providers, gateways, desktop/server usage, and integrations.

## Upstream vs Hermes Agent IoT

| Area | Upstream Hermes Agent | Hermes Agent IoT |
| --- | --- | --- |
| General desktop/server agent | Primary target | Uses upstream foundation |
| Raspberry Pi 2 / ARMv7 | Not primary target | Primary compatibility target |
| 1 GB-class minimal profile | General dependency model | Dedicated `minimal` profile |
| MQTT / Home Assistant deployment | General integrations | Dedicated `iot` profile |
| Low-resource edge deployment | General runtime | Primary fork focus |
| Robotics | General agent scope | IoT/robotics-oriented documentation and roadmap |

This fork may intentionally lag upstream `main` while dependency changes, IoT patches, and ARMv7 compatibility are reviewed and validated. For general desktop/server Hermes Agent usage, prefer the upstream project.

## 發行與驗證紀錄

- 本版 package／tag 識別：`hermes-agent-iot 0.22.5.post3`／`iot-v0.22.5.post3`。
- [PyPI 對應版本與正式檔案雜湊](https://pypi.org/project/hermes-agent-iot/0.22.5.post3/#files)／[GitHub release 與 tag](https://github.com/matttest0080-prog/hermes-agent-iot/releases/tag/iot-v0.22.5.post3)。正式 wheel SHA256：`46ae064a902296cb744a16ead141cf4707456b38b8a93d98f510da07b738422a`；[發布與驗收範圍](docs/release-v0.22.5.post3.md)。
- Pi 2B 正式 registry 實測：Rev 1.1、ARMv7、921 MiB RAM、Python 3.13.5；**本版正式 wheel** 在新隔離目錄完成五 profiles hash dry-run、正常 minimal 安裝與 `pip check`、10 項 smoke、12 項 SQLite deadline／逐 byte回滾控制，整體 exit 0，installed bytes 匹配正式 PyPI wheel。**實際只安裝 minimal**；localhost fixture 不是實際模型、MQTT／HA／GPIO／CDP 或長期負載驗收，未修改既有服務。
- 從舊版升級請使用前述新 venv，保留舊環境與服務供回復。`pip install --upgrade` 不一定移除舊 orphan `browser-harness`，混裝會造成 Pillow 要求衝突或同名模組互相覆寫。

### 歷史已發布驗證：0.22.2.post1

以下保留舊版 receipt，**不是 0.22.5.post3 的 artifact 或安全驗證**：

- PyPI: [`hermes-agent-iot 0.22.2.post1`](https://pypi.org/project/hermes-agent-iot/0.22.2.post1/)
- Tag: `iot-v0.22.2.post1`
- Commit: `2c08f4ec97445d8f26ab5c35515b2f94652aaddf`
- Wheel: `hermes_agent_iot-0.22.2.post1-py3-none-any.whl`
- Wheel SHA-256: `e46b7049940f14928d0dd014f44494126faca261363e9240fa700fb84d13fd8f`
- Workflow: https://github.com/matttest0080-prog/hermes-agent-iot/actions/runs/39356318990
- Python: `>=3.11,<3.15`
- Physical validation: Raspberry Pi 2 Model B Rev 1.1, 32-bit ARMv7, 921 MiB RAM, Python 3.13.5

The `minimal` wheel baseline was clean-installed from public PyPI on physical Raspberry Pi 2 hardware on 2026-10-20: `pip check` clean, `hermes --version` = 0.22.2.post1, wheel SHA-256 matched, and a one-shot agent turn returned `PI2-OK` in 81.6 s using a remote model over SSH. That verifies the Pi 2 client/runtime path, not local inference on the Pi. Heavier optional extras require hardware appropriate to their dependency set.

## Updating a Pi2 Source Installation

Always keep updates pinned to the `pi2-lite` branch:

```bash
cd ~/hermes-agent-iot
source ~/.hermes-venv/bin/activate

git status --short
git switch pi2-lite
git fetch origin pi2-lite
git merge --ff-only origin/pi2-lite

bash setup-pi2-minimal.sh --profile minimal
```

Replace `minimal` with the profile originally installed. In IoT release 0.20.4
and later, a bare `hermes update` detects the `hermes-agent-iot` distribution
and defaults to `pi2-lite`; an explicit `--branch pi2-lite` remains useful in
automation for auditability. Rerun the profile installer after a source update.

## Roadmap

- [x] Raspberry Pi 2 / ARMv7 installation path
- [x] Low-resource dependency profile
- [x] IoT dependency profile
- [x] MQTT / Home Assistant integration path
- [x] Public PyPI package
- [x] Physical Raspberry Pi 2 validation
- [ ] GPIO abstraction
- [ ] I2C device abstraction
- [ ] PWM / servo control
- [ ] Sensor plugin framework
- [ ] Robotics skill framework
- [ ] ESP32 MQTT bridge
- [ ] Raspberry Pi 3 / 4 / 5 validation matrix

## Upstream Desktop / Server Installation

Hermes Agent IoT is primarily for Raspberry Pi and edge deployments. For general desktop or server use, install the upstream Hermes Agent.

### Windows (native PowerShell)

```powershell
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
```

The source installer delegates Python 3.14, Node.js, npm, pnpm, ripgrep, FFmpeg,
and Python dependencies to PM. If Git is absent, it stages the verified Git
for Windows archive in Hermes' tool store. It does not replace your system Git.
See [installation methods](https://hermes-agent.nousresearch.com/docs/getting-started/installation)
for the separate MSIX/App Installer package and its update ownership.

### Linux / macOS / WSL2

```bash
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
```

> **Android / Termux:** A signed APT repository is available for aarch64 devices, with a `stable` channel (tagged releases) and a prerelease `canary` channel. The package includes Python, Node.js, and the TUI. Use the [Termux guide](https://hermes-agent.nousresearch.com/docs/getting-started/termux), not the desktop/server installer script.

These upstream installers do not install this fork's Pi2-specific profiles or IoT packaging.

## About Hermes Agent

Hermes Agent is the self-improving AI agent developed by [Nous Research](https://nousresearch.com). It provides a terminal interface, persistent learning and memory, scheduled automations, subagents, multiple execution backends, messaging gateways, and support for multiple LLM providers.

Hermes Agent IoT does not replace the upstream project. It adapts that foundation for Raspberry Pi 2, ARMv7, low-resource edge nodes, MQTT/Home Assistant environments, and future robotics integrations.

## License and Attribution

Hermes Agent IoT is derived from [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent) and follows this repository's [MIT License](LICENSE). Preserve upstream copyright and attribution when redistributing derived work.
