A Node-RED application for the Seeed Studio reCamera that detects people within user-defined polygon zones and drives GPIO outputs for alarms and a system heartbeat. Zones are configured live in the browser on top of the camera preview. Intended for industrial presence-detection use cases (e.g. guarding a hazardous machine) where traditional motion/IR sensors create too many false triggers.
- Live polygon zone editor over the camera preview (Zone 1 + Zone 2, drag-to-move vertices).
- Real-time person-in-zone detection using the stock YOLO11n model.
- Two independent alarm outputs on GPIO 487 (Zone 1) and GPIO 488 (Zone 2).
- Heartbeat output on GPIO 490 (pulses while the detector loop is alive).
- Single-page dashboard with live video, zone activity indicators, and save/reload controls.
- Persistent zones stored in
/home/recamera/zones.json. - Robust at full-frame-rate — preview pipeline runs at 30 fps / 1280×720, detection path is rate-limited to 3 msg/s to protect CPU.
- Seeed Studio reCamera (SG200X SoC).
- reCamera PoE module (breaks out GPIO 487, 488, 490).
- Outputs are 3.3 V sysfs GPIOs — for relays/external buzzers use an appropriate driver or opto-isolator.
| GPIO | Purpose |
|---|---|
| 487 | Zone 1 alarm output |
| 488 | Zone 2 alarm output |
| 490 | Heartbeat (1 Hz) |
- reCamera on your network with default firmware (Node-RED + sscma-node + FlowFuse Dashboard preinstalled — these ship in stock).
- Your workstation has
ssh,scp, and either PowerShell (Windows) orbash(Linux/macOS). - You know the camera IP (e.g.
192.168.42.1) and therecamerauser's password (defaultrecamera; the user will prompt / you should change it).
# Windows -- one-time SSH key install (avoids password prompts on every deploy)
./scripts/setup-ssh-key.ps1 -CameraIp 192.168.42.1
# Deploy
./scripts/deploy.ps1 -CameraIp 192.168.42.1# Linux / macOS
./scripts/setup-ssh-key.sh 192.168.42.1
./scripts/deploy.sh 192.168.42.1What deploy does (in a single SSH session):
- SCPs the flow JSON and
recamera-setup.shto/tmp/on the camera. - Runs the setup script with
sudo— exports GPIO 487/488/490, sets direction, makes them writable byrecamera, creates/home/recamera/zones.jsonif missing. - Strips any pre-existing dashboard config nodes from the running flow (the factory image ships its own
ui-basewhich conflicts with ours), merges in our flow, and POSTs the result to the Node-RED admin API. - Verifies exactly one
ui-baseexists post-merge before deploying — aborts otherwise.
The dashboard then comes up at http://CAMERA_IP:1880/dashboard/ within a few seconds.
- Pick Edit Zone 1 (or Zone 2).
- Click in empty space on the preview to add polygon vertices (need 3+).
- Drag a vertex to move it.
- Click Finish to close the polygon.
- Click Save to write zones to disk and activate the detector.
- Click Reload to discard drafts and refetch the saved zones.
The red dot next to Zone 1 / Zone 2 lights while a person's bounding box intersects that zone; GPIO 487 / 488 tracks the dot state.
flow/person-zone-detection-flow.json # Node-RED flow (single tab, single UI page)
scripts/deploy.ps1 / deploy.sh # one-shot deploy from workstation
scripts/recamera-setup.sh # on-device GPIO init (run by deploy)
docs/architecture.md # how the flow is wired
docs/troubleshooting.md # known issues / gotchas
MIT — see LICENSE.