Device Registration
Register edge devices with the SeaClip hub
Registration Methods
| Method | Use Case |
|---|---|
| Automatic | One-line install script handles registration |
| CLI | Manual registration via spoke CLI |
| API | Programmatic registration via REST API |
| Dashboard | Pre-register devices in the UI |
Automatic Registration
The one-line install script automatically registers the device:
bash
curl -sSL https://raw.githubusercontent.com/t4tarzan/seaclip/main/scripts/spoke-install.sh | bash -s -- --hub http://HUB_IP:51842
This:
- Detects device type (Raspberry Pi, Jetson, generic)
- Collects system info (CPU, RAM, GPU)
- Sends registration request to hub
- Saves credentials to
~/.seaclip/device-credentials.json
CLI Registration
For manual installations:
bash
cd /opt/seaclip-spoke
pnpm spoke register
CLI Options
bash
pnpm spoke register \
--hub http://192.168.1.100:51842 \
--name "kitchen-pi" \
--type raspberry-pi \
--company default
| Option | Description | Default |
|---|---|---|
--hub |
Hub URL | From .env |
--name |
Device name | hostname |
--type |
Device type | auto-detect |
--company |
Company ID | default |
--token |
API token (if hub requires auth) | - |
API Registration
Register devices programmatically:
bash
curl -X POST http://HUB_IP:51842/api/companies/default/devices \
-H "Content-Type: application/json" \
-d '{
"hostname": "my-device",
"ipAddress": "192.168.1.50",
"deviceType": "generic-linux",
"metadata": {
"cpuCores": 4,
"ramGb": 8,
"architecture": "x86_64",
"osVersion": "Ubuntu 22.04"
}
}'
Response
json
{
"id": "dev_abc123",
"hostname": "my-device",
"ipAddress": "192.168.1.50",
"deviceType": "generic-linux",
"status": "online",
"registrationToken": "tok_xyz789",
"createdAt": "2025-01-15T10:30:00Z"
}
Save the id and registrationToken for the spoke configuration.
Dashboard Pre-Registration
Pre-register devices before physical setup:
- Open the SeaClip dashboard
- Navigate to Edge Mesh → Devices
- Click Add Device
- Enter device details:
- Name
- Expected IP (optional)
- Device type
- Copy the generated registration token
- Use the token when installing the spoke
Credentials File
After registration, credentials are saved to:
~/.seaclip/device-credentials.json
{
"deviceId": "dev_abc123",
"registrationToken": "tok_xyz789",
"hubUrl": "http://192.168.1.100:51842",
"companyId": "default"
}
Security: This file contains sensitive credentials. It's automatically set to mode 600 (owner read/write only).
Re-Registration
To re-register a device (e.g., after hub reinstall):
bash
# Remove old credentials
rm ~/.seaclip/device-credentials.json
# Re-register
pnpm spoke register --hub http://NEW_HUB_IP:51842
# Restart service
sudo systemctl restart seaclip-spoke
Verify Registration
bash — On the spoke
# Check status
pnpm spoke status
# Expected output:
# Device ID: dev_abc123
# Hub: http://192.168.1.100:51842
# Status: connected
# Last heartbeat: 5s ago
bash — On the hub
# List all devices
pnpm cli device list
# Check specific device
pnpm cli device show dev_abc123
Troubleshooting
Registration failed: Connection refused
Hub is not reachable. Check:
- Hub is running:
curl http://HUB_IP:51842/api/health - Firewall allows port 51842
- Correct IP address
Registration failed: 401 Unauthorized
Hub requires authentication. Get an API token from the hub admin and use:
bash
pnpm spoke register --token YOUR_API_TOKEN
Device shows offline after registration
The spoke service may not be running:
bash
sudo systemctl status seaclip-spoke
sudo journalctl -u seaclip-spoke -f