Update README with multi-instance deployment instructions
This commit is contained in:
@@ -2,13 +2,48 @@
|
|||||||
|
|
||||||
Camera snapshot server with motion detection for Raspberry Pi.
|
Camera snapshot server with motion detection for Raspberry Pi.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start (Single Camera)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
cp env.example .env
|
||||||
|
nano .env # Configure settings
|
||||||
./setup.sh
|
./setup.sh
|
||||||
sudo systemctl start vixy-vision
|
sudo systemctl start vixy-vision-<your-camera-id>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Multi-Camera Deployment (Same Pi)
|
||||||
|
|
||||||
|
For running multiple cameras on one Pi, clone the repo into separate directories:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Camera 1: desk
|
||||||
|
git clone http://gateway.local:3001/vixy/vixy-vision.git ~/vixy-vision-desk
|
||||||
|
cd ~/vixy-vision-desk/server
|
||||||
|
cp env.example .env
|
||||||
|
# Edit .env:
|
||||||
|
# SERVICE_NAME=vixy-vision-desk
|
||||||
|
# CAMERA_ID=desk
|
||||||
|
# CAMERA_INDEX=0
|
||||||
|
# PORT=8443
|
||||||
|
./setup.sh
|
||||||
|
|
||||||
|
# Camera 2: basement
|
||||||
|
git clone http://gateway.local:3001/vixy/vixy-vision.git ~/vixy-vision-basement
|
||||||
|
cd ~/vixy-vision-basement/server
|
||||||
|
cp env.example .env
|
||||||
|
# Edit .env:
|
||||||
|
# SERVICE_NAME=vixy-vision-basement
|
||||||
|
# CAMERA_ID=basement
|
||||||
|
# CAMERA_INDEX=2
|
||||||
|
# PORT=8444
|
||||||
|
./setup.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Each instance gets its own:
|
||||||
|
- Install directory: `~/vixy-vision-<service-name>/`
|
||||||
|
- Systemd service: `vixy-vision-<service-name>.service`
|
||||||
|
- Port: as configured in `.env`
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 📷 USB camera snapshots via HTTPS API
|
- 📷 USB camera snapshots via HTTPS API
|
||||||
@@ -16,23 +51,20 @@ sudo systemctl start vixy-vision
|
|||||||
- 🔍 Motion detection with frame differencing
|
- 🔍 Motion detection with frame differencing
|
||||||
- 📤 Event reporting to central collector
|
- 📤 Event reporting to central collector
|
||||||
- 🔄 Auto-reconnect on camera failure
|
- 🔄 Auto-reconnect on camera failure
|
||||||
|
- 🔢 Multi-instance support via SERVICE_NAME and PORT
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Copy `env.example` to `.env` and customize:
|
Copy `env.example` to `.env` and customize:
|
||||||
|
|
||||||
```bash
|
|
||||||
cp env.example .env
|
|
||||||
nano .env
|
|
||||||
```
|
|
||||||
|
|
||||||
Key settings:
|
|
||||||
|
|
||||||
| Variable | Description | Default |
|
| Variable | Description | Default |
|
||||||
|----------|-------------|---------|
|
|----------|-------------|---------|
|
||||||
| `API_KEY` | Auth key for API | (required) |
|
| `API_KEY` | Auth key for API | (generated) |
|
||||||
|
| `SERVICE_NAME` | Systemd service name | vixy-vision |
|
||||||
|
| `PORT` | HTTPS port | 8443 |
|
||||||
| `CAMERA_ID` | Identifier for this camera | camera |
|
| `CAMERA_ID` | Identifier for this camera | camera |
|
||||||
| `MOTION_ENABLED` | Enable motion detection | false |
|
| `CAMERA_INDEX` | /dev/videoN index | 0 |
|
||||||
|
| `MOTION_ENABLED` | Enable motion detection | true |
|
||||||
| `MOTION_THRESHOLD` | Sensitivity (lower = more) | 25 |
|
| `MOTION_THRESHOLD` | Sensitivity (lower = more) | 25 |
|
||||||
| `MOTION_COOLDOWN` | Seconds between events | 5.0 |
|
| `MOTION_COOLDOWN` | Seconds between events | 5.0 |
|
||||||
| `COLLECTOR_URL` | Where to POST events | (optional) |
|
| `COLLECTOR_URL` | Where to POST events | (optional) |
|
||||||
@@ -64,3 +96,12 @@ When motion is detected, the server POSTs to `COLLECTOR_URL`:
|
|||||||
"snapshot": "<base64 JPEG>"
|
"snapshot": "<base64 JPEG>"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Service Management
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl start vixy-vision-<id>
|
||||||
|
sudo systemctl stop vixy-vision-<id>
|
||||||
|
sudo systemctl status vixy-vision-<id>
|
||||||
|
sudo journalctl -u vixy-vision-<id> -f
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user