/asecuritywebcam

Kerberos Agent as an app for Balena Cloud

Primary LanguageShellMIT LicenseMIT

Video-surveillance by Balena Hub CircleCI

If you're looking for a seamless, easy and innovative video surveillance system for your property, than this is the project you've been waiting for. We've created an app, that helps you deploying a video surveillance system on the hardware you prefer, with all the benefits you expect from a modern IoT system nowadays. The project is relying on the popular Kerberos Agent, added with some additional RTSP proxy.

The idea of this project is to build and advance a video surveillance system with multiple Balena blocks and/or third-party containers, that make up the defacto video surveillance system anyone can use. The existing application is using following blocks:

  • Kerberos Agent is the foundation of the video-surveillance application.
  • Hostname will allow the video-surveillance project to be reachable on your network by a DNS name.

Getting Started

You can one-click-deploy this application using the button below:

deploy with balena

Application Environment Variables

Application environment variables apply to all services within the application, and can be applied fleet-wide to apply to multiple devices.

Name Description
SET_HOSTNAME Set a custom hostname on application start. Default is videosurveillance.
MTX_WEBRTCADDITIONALHOSTS Specify the hostname network IP address to publish the stream to

RSTP server

Currently only H264 RTSP streams are supported from mediamtx sidecar container

Usage

Node Package Manager

This project depends on npmjs balena-cloud-apps. Please call npm link balena-cloud-apps && npm update whenever the system complains about balena_deploy not found. After npm install succeeded, HuewizPi can be dbuilt and optionally deployed to the device

Update BALENA_ARCH dependent files

When you make changes to docker*.template files and environment *.env files, you can apply changes that the CPU architecture depends on. To do so, run deployment scripts balena_deploy --nobuild before to push packages:

./deploy.sh 1 --local [CTRL+C]
./deploy.sh 2 --local [CTRL+C]
./deploy.sh 3 --local [CTRL+C]

Updating Docker service image (Dockerfile.template)

A new service image can be build

  • Check values in ${BALENA_ARCH}.env
Node Machine BALENA_MACHINE_NAME BALENA_ARCH
Raspberry Pi 3 raspberrypi3 armhf
Raspberry Pi 4 raspberrypi3-64 aarch64
Mini PC intel-nuc x86_64
  • Run ./deploy.sh [BALENA_ARCH] --nobuild You can select 1:armhf, 2:aarch64 or 3:x86_64 as the target machine CPU
  • You choose to build FROM a balenalib base image as set in Dockerfile.template, then type 0 or CTRL-C to exit the script
  • All template data filters copy to Dockerfile.aarch64, Dockerfile.armhf and Dockerfile.x86_64

Deploy to balena

Update balena apps after committing changes git commit -a && git push . deploy.sh

Initial setup

Once your device joins the fleet you'll need to allow some time for it to download the application.

  1. Connect to http://YOUR-DEVICE-IP or depending on the hostname http://videosurveillance.local in your browser
  2. Sign-in with the default username rootand password root or change using the environment variables.
  3. Go to the configuration page and fill-in the RTSP url of your IPCamera.
  4. Press save, and the Kerberos Agent will connect to your camera, and show a live view on the dashboard page.

Available soon: set MTX_PATH=rpicamera environment to set the source as the Pi Camera

Documentation for the Kerberos Agent and other services can be found at https://doc.kerberos.io/