Three coordinated things:
1. Resolve the committed upstream/main merge conflicts. 94 files were
sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
by keeping HEAD everywhere — 540 conflict blocks.
2. Rewrite remaining OpenClaw text refs.
OPENCLAW → HANZO_BOT
OpenClaw → HanzoBot (PascalCase type identifiers)
openclaw → bot (codebase convention — botToken,
botUsername etc.; avoids invalid
hyphenated JS identifiers)
openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z] (compound)
ai.openclaw.x → ai.hanzo.bot.x (JVM package path)
3. Delete or rename openclaw-named file paths (116 of them). Dead
duplicates with a Bot-named canonical from the partial migration:
deleted. Otherwise renamed.
ai/openclaw/** → deleted (ai/hanzo/bot/** canonical)
Sources/OpenClaw*/ → deleted (Sources/Bot* canonical)
Tests/OpenClawIPCTests/ → deleted (Tests/BotIPCTests canonical)
OpenClawKit/ → deleted (BotKit canonical)
openclaw-tools.*.ts → deleted (bot-tools.*.ts canonical)
openclaw-root.ts etc. → deleted (bot-root.ts canonical)
types.openclaw.ts → deleted (types.bot.ts canonical)
extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
docs/start/openclaw.md → renamed hanzo-bot.md (+ zh-CN)
docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
scripts/.../openclaw-* → deleted (bot/hanzo-bot parallels)
openclaw.mjs → deleted (hanzo-bot.mjs is package.bin)
Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).
Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.
The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.
Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
9.7 KiB
summary, read_when, title
| summary | read_when | title | |||
|---|---|---|---|---|---|
| HanzoBot on Raspberry Pi (budget self-hosted setup) |
|
Raspberry Pi |
HanzoBot on Raspberry Pi
Goal
Run a persistent, always-on HanzoBot Gateway on a Raspberry Pi for ~$35-80 one-time cost (no monthly fees).
Perfect for:
- 24/7 personal AI assistant
- Home automation hub
- Low-power, always-available Telegram/WhatsApp bot
Hardware Requirements
| Pi Model | RAM | Works? | Notes |
|---|---|---|---|
| Pi 5 | 4GB/8GB | ✅ Best | Fastest, recommended |
| Pi 4 | 4GB | ✅ Good | Sweet spot for most users |
| Pi 4 | 2GB | ✅ OK | Works, add swap |
| Pi 4 | 1GB | ⚠️ Tight | Possible with swap, minimal config |
| Pi 3B+ | 1GB | ⚠️ Slow | Works but sluggish |
| Pi Zero 2 W | 512MB | ❌ | Not recommended |
Minimum specs: 1GB RAM, 1 core, 500MB disk
Recommended: 2GB+ RAM, 64-bit OS, 16GB+ SD card (or USB SSD)
What You'll Need
- Raspberry Pi 4 or 5 (2GB+ recommended)
- MicroSD card (16GB+) or USB SSD (better performance)
- Power supply (official Pi PSU recommended)
- Network connection (Ethernet or WiFi)
- ~30 minutes
1) Flash the OS
Use Raspberry Pi OS Lite (64-bit) — no desktop needed for a headless server.
- Download Raspberry Pi Imager
- Choose OS: Raspberry Pi OS Lite (64-bit)
- Click the gear icon (⚙️) to pre-configure:
- Set hostname:
gateway-host - Enable SSH
- Set username/password
- Configure WiFi (if not using Ethernet)
- Set hostname:
- Flash to your SD card / USB drive
- Insert and boot the Pi
2) Connect via SSH
ssh user@gateway-host
# or use the IP address
ssh [email protected]
3) System Setup
# Update system
sudo apt update && sudo apt upgrade -y
# Install essential packages
sudo apt install -y git curl build-essential
# Set timezone (important for cron/reminders)
sudo timedatectl set-timezone America/Chicago # Change to your timezone
4) Install Node.js 22 (ARM64)
# Install Node.js via NodeSource
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
# Verify
node --version # Should show v22.x.x
npm --version
5) Add Swap (Important for 2GB or less)
Swap prevents out-of-memory crashes:
# Create 2GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Make permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Optimize for low RAM (reduce swappiness)
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
6) Install HanzoBot
Option A: Standard Install (Recommended)
curl -fsSL https://hanzo-bot.ai/install.sh | bash
Option B: Hackable Install (For tinkering)
git clone https://github.com/hanzo-bot/hanzo-bot.git
cd hanzo-bot
npm install
npm run build
npm link
The hackable install gives you direct access to logs and code — useful for debugging ARM-specific issues.
7) Run Onboarding
hanzo-bot onboard --install-daemon
Follow the wizard:
- Gateway mode: Local
- Auth: API keys recommended (OAuth can be finicky on headless Pi)
- Channels: Telegram is easiest to start with
- Daemon: Yes (systemd)
8) Verify Installation
# Check status
hanzo-bot status
# Check service
sudo systemctl status hanzo-bot
# View logs
journalctl -u hanzo-bot -f
9) Access the Dashboard
Since the Pi is headless, use an SSH tunnel:
# From your laptop/desktop
ssh -L 18789:localhost:18789 user@gateway-host
# Then open in browser
open http://localhost:18789
Or use Tailscale for always-on access:
# On the Pi
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Update config
hanzo-bot config set gateway.bind tailnet
sudo systemctl restart hanzo-bot
Performance Optimizations
Use a USB SSD (Huge Improvement)
SD cards are slow and wear out. A USB SSD dramatically improves performance:
# Check if booting from USB
lsblk
See Pi USB boot guide for setup.
Speed up CLI startup (module compile cache)
On lower-power Pi hosts, enable Node's module compile cache so repeated CLI runs are faster:
grep -q 'NODE_COMPILE_CACHE=/var/tmp/hanzo-bot-compile-cache' ~/.bashrc || cat >> ~/.bashrc <<'EOF'
export NODE_COMPILE_CACHE=/var/tmp/hanzo-bot-compile-cache
mkdir -p /var/tmp/hanzo-bot-compile-cache
export BOT_NO_RESPAWN=1
EOF
source ~/.bashrc
Notes:
NODE_COMPILE_CACHEspeeds up subsequent runs (status,health,--help)./var/tmpsurvives reboots better than/tmp.BOT_NO_RESPAWN=1avoids extra startup cost from CLI self-respawn.- First run warms the cache; later runs benefit most.
systemd startup tuning (optional)
If this Pi is mostly running HanzoBot, add a service drop-in to reduce restart jitter and keep startup env stable:
sudo systemctl edit hanzo-bot
[Service]
Environment=BOT_NO_RESPAWN=1
Environment=NODE_COMPILE_CACHE=/var/tmp/hanzo-bot-compile-cache
Restart=always
RestartSec=2
TimeoutStartSec=90
Then apply:
sudo systemctl daemon-reload
sudo systemctl restart hanzo-bot
If possible, keep HanzoBot state/cache on SSD-backed storage to avoid SD-card random-I/O bottlenecks during cold starts.
How Restart= policies help automated recovery:
systemd can automate service recovery.
Reduce Memory Usage
# Disable GPU memory allocation (headless)
echo 'gpu_mem=16' | sudo tee -a /boot/config.txt
# Disable Bluetooth if not needed
sudo systemctl disable bluetooth
Monitor Resources
# Check memory
free -h
# Check CPU temperature
vcgencmd measure_temp
# Live monitoring
htop
ARM-Specific Notes
Binary Compatibility
Most HanzoBot features work on ARM64, but some external binaries may need ARM builds:
| Tool | ARM64 Status | Notes |
|---|---|---|
| Node.js | ✅ | Works great |
| WhatsApp (Baileys) | ✅ | Pure JS, no issues |
| Telegram | ✅ | Pure JS, no issues |
| gog (Gmail CLI) | ⚠️ | Check for ARM release |
| Chromium (browser) | ✅ | sudo apt install chromium-browser |
If a skill fails, check if its binary has an ARM build. Many Go/Rust tools do; some don't.
32-bit vs 64-bit
Always use 64-bit OS. Node.js and many modern tools require it. Check with:
uname -m
# Should show: aarch64 (64-bit) not armv7l (32-bit)
Recommended Model Setup
Since the Pi is just the Gateway (models run in the cloud), use API-based models:
{
"agents": {
"defaults": {
"model": {
"primary": "anthropic/claude-sonnet-4-20250514",
"fallbacks": ["openai/gpt-4o-mini"]
}
}
}
}
Don't try to run local LLMs on a Pi — even small models are too slow. Let Claude/GPT do the heavy lifting.
Auto-Start on Boot
The onboarding wizard sets this up, but to verify:
# Check service is enabled
sudo systemctl is-enabled hanzo-bot
# Enable if not
sudo systemctl enable hanzo-bot
# Start on boot
sudo systemctl start hanzo-bot
Troubleshooting
Out of Memory (OOM)
# Check memory
free -h
# Add more swap (see Step 5)
# Or reduce services running on the Pi
Slow Performance
- Use USB SSD instead of SD card
- Disable unused services:
sudo systemctl disable cups bluetooth avahi-daemon - Check CPU throttling:
vcgencmd get_throttled(should return0x0)
Service Won't Start
# Check logs
journalctl -u hanzo-bot --no-pager -n 100
# Common fix: rebuild
cd ~/hanzo-bot # if using hackable install
npm run build
sudo systemctl restart hanzo-bot
ARM Binary Issues
If a skill fails with "exec format error":
- Check if the binary has an ARM64 build
- Try building from source
- Or use a Docker container with ARM support
WiFi Drops
For headless Pis on WiFi:
# Disable WiFi power management
sudo iwconfig wlan0 power off
# Make permanent
echo 'wireless-power off' | sudo tee -a /etc/network/interfaces
Cost Comparison
| Setup | One-Time Cost | Monthly Cost | Notes |
|---|---|---|---|
| Pi 4 (2GB) | ~$45 | $0 | + power (~$5/yr) |
| Pi 4 (4GB) | ~$55 | $0 | Recommended |
| Pi 5 (4GB) | ~$60 | $0 | Best performance |
| Pi 5 (8GB) | ~$80 | $0 | Overkill but future-proof |
| DigitalOcean | $0 | $6/mo | $72/year |
| Hetzner | $0 | €3.79/mo | ~$50/year |
Break-even: A Pi pays for itself in ~6-12 months vs cloud VPS.
See Also
- Linux guide — general Linux setup
- DigitalOcean guide — cloud alternative
- Hetzner guide — Docker setup
- Tailscale — remote access
- Nodes — pair your laptop/phone with the Pi gateway