Skip to main content

Installation

Prerequisites

  • Raspberry Pi with Raspberry Pi OS installed
  • SSH access or physical keyboard/monitor
  • Internet connectivity

Step 1: System Setup

sudo apt update && sudo apt upgrade -y
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

Step 2: Install Tailscale

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --authkey=YOUR_TAILSCALE_AUTH_KEY

Step 3: Deploy IoT Adapter

git clone https://github.com/ZenSpace2-0/zs-iot.git
cd zs-iot
npm install

Step 4: Configure

Copy the environment template and configure:

cp .env.example .env

Key environment variables:

  • PORT — Service port (default: 3000)
  • API_KEY — Authentication key for ZenEdge
  • UNIFI_HOST — UniFi controller address (if using UniFi devices)
  • UNIFI_USERNAME / UNIFI_PASSWORD — UniFi credentials

Step 5: Initialize Database

npm run migrate

Step 6: Start the Service

npm start

For production, use PM2:

npm install -g pm2
pm2 start server.js --name zs-iot
pm2 save
pm2 startup

Step 7: Verify

curl http://localhost:3000/api/ping

Should return a healthy status.

Next Steps