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:

  1. Detects device type (Raspberry Pi, Jetson, generic)
  2. Collects system info (CPU, RAM, GPU)
  3. Sends registration request to hub
  4. 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:

  1. Open the SeaClip dashboard
  2. Navigate to Edge Mesh → Devices
  3. Click Add Device
  4. Enter device details:
    • Name
    • Expected IP (optional)
    • Device type
  5. Copy the generated registration token
  6. 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:

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