Deploy to Device
The SDK ships with an onboarding script that copies SDK modules to a fresh Dev Edition, installs system dependencies, and runs a smoke test in one shot. There's also a manual path if you prefer to script your own deployment.
One-shot onboarding (recommended)
python onboarding/onboard_device.py <host> <user> --password <pw>
What it does, in order:
- SSH into
<host>as<user>. - Create
~/sdk/audio/and~/sdk/ssh/. - SFTP-copy
audio/audio_sdk.pyandssh/ssh_sdk.py. sudo apt-get install -y python3-pyaudio(idempotent).sudo usermod -a -G audio systemso the SDK can open the codec withoutsudo.- Register any bundled OpenClaw skills.
- Run
health_check(loopback=True)and report.
The script is idempotent — running it twice is safe and will only re-do work that's actually missing.
Arguments
onboard_device.py <host> <user> [options]
--password TEXT SSH password (mutually exclusive with --key)
--key PATH SSH private key path
--port INT SSH port (default 22)
--no-audio Skip audio SDK install (only deploy ssh_sdk)
--no-ssh Skip ssh SDK install (only deploy audio_sdk)
--dry-run Print what would happen, do nothing
Manual path
If you'd rather script the deploy yourself:
HOST=172.168.20.145
USER=system
ssh "$USER@$HOST" "mkdir -p ~/sdk/audio ~/sdk/ssh"
scp audio/audio_sdk.py "$USER@$HOST:~/sdk/audio/"
scp ssh/ssh_sdk.py "$USER@$HOST:~/sdk/ssh/"
ssh "$USER@$HOST" "
sudo apt-get update &&
sudo apt-get install -y python3-pyaudio &&
sudo usermod -a -G audio system
"
After usermod, the new group only takes effect on next login. Either log out and back in, or use newgrp audio to apply it to the current shell.
Using the SDK from Python on the device
Once deployed, you can import the modules:
ssh system@172.168.20.145
python3
>>> import sys
>>> sys.path.insert(0, "/home/system/sdk")
>>> from audio.audio_sdk import AudioSDK
>>> AudioSDK().health_check()
To make the import path permanent, append to ~/.bashrc:
echo 'export PYTHONPATH="$HOME/sdk:$PYTHONPATH"' >> ~/.bashrc
Deploying your own code alongside the SDK
The same SSH SDK from your workstation works for shipping your own scripts:
from ssh_sdk import InternSSH
with InternSSH("172.168.20.145", "system", key_path="~/.ssh/id_ed25519") as ssh:
ssh.put_dir("./my_project", "/home/system/my_project")
result = ssh.run("cd /home/system/my_project && python3 main.py")
print(result.stdout)
If your project needs extra Python deps, add a requirements.txt and install via SSH:
ssh.put("requirements.txt", "/home/system/my_project/requirements.txt")
ssh.run("pip install -r /home/system/my_project/requirements.txt", check=True)
Running as a systemd service
Long-running scripts should run under systemd, not in an SSH session.
/etc/systemd/system/my-project.service:
[Unit]
Description=My Intern project
After=network-online.target openclaw.service
[Service]
Type=simple
User=system
WorkingDirectory=/home/system/my_project
ExecStart=/usr/bin/python3 /home/system/my_project/main.py
Restart=on-failure
[Install]
WantedBy=multi-user.target
Install and enable:
sudo systemctl daemon-reload
sudo systemctl enable --now my-project
journalctl -u my-project -f
Watch out for OTA
bootstrap-server updates intern-server, bootstrap-server, OpenClaw, and the web SPA. It does not touch anything under /home/system/, so your code is safe across updates. But the OS itself is managed by apt unattended-upgrades — if you depend on a specific Python or library version, pin it in your project's venv or pip install it explicitly during deploy.