Shinobi IP Camera Monitoring

From SME Server
Revision as of 06:42, 18 April 2021 by Unnilennium (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Shinobi

Shinobi is a node/javascript based web cam monitoring system

http://shinobi.video http://shinobi.video/docs/start

If you use the 'easy' install then it installs the Pro paid for version and a licence is required.

Manual install from git is the 'Demo' version

https://github.com/ShinobiCCTV/Shinobi

Installation

There are installation scripts but not for CentOS 6

Get static ffmpeg

https://s3.amazonaws.com/cloudcamio/ffmpeg-release-64bit-static.tar.xz

Uncompress and copy to /usr/bin

Add the node repo

/sbin/e-smith/db yum_repositories set nodejs \
repository Name 'Node JS 7' \
BaseURL https://rpm.nodesource.com/pub_7.x/el/6/x86_64 \
EnableGroups no GPGCheck no Visible yes status disabled
 signal-event yum-modify
 yum --enablerepo nodejs install nodejs
 npm cache clean -f
 npm install -g n
 n stable

May not be required:

 ln -s /usr/bin/nodejs /usr/bin/node

Make a git directory

 mkdir -p /opt/git
 cd /opt/git
 git clone https://github.com/ShinobiCCTV/Shinobi

Edit the following and modify any instances of utf8mb4 to utf8

 mysql -u root -e "source sql/user.sql"
 mysql -u root -e "source sql/framework.sql"

Edit sql/default_data.sql

Modify the user. Leave the password which will default:

Default Password : password

Unless required remove the INSERT INTO `Monitors` line

 mysql -u root -e "source sql/default_data.sql


NPM installation:

 npm install
 npm install pm2 -g

Setup the conf file:

cp conf.sample.json conf.json

Now edit conf.json

Modify port as required Modify mail as required (not sure of the correct syntax here)

Starting

Everything is run and monitored by PM2:

   pm2 start camera.js
   pm2 start cron.js

View current jobs:

   pm2 list


You can start and stop with

   pm2 restart camera.js 

or

   pm2 stop camera.js

To remove pm2

   pm2 stop all
   pm2 kill

Use

Go to:

http://your.server.ip:8080

Super User

cp super.sample.json super.json

Modify superuser as required

Default Password : admin

http://your.shinobi.video/super

Motion Detection

If required - Modify plugin keys with new password and mirror that to the files

Motion capture will additional libraries installed - see the READE.md file in the directory

These are the required RPMs - not sure if they are available/repos. On my test server it seemed to allow me to install them, but I have several extras repos. YMMV

yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel
yum install liberation-sans-fonts.noarch
cp plugins/opencv/conf.sample.json plugins/opencv/conf.json
cp plugins/motion/conf.sample.json plugins/motion/conf.json

Remote Access

Direct remote access is probably not the best of ideas.

It should be fairly easy to accomplish with a reverse proxy similar to the RocketChat contrib.

Auto start on boot

Not tried this

http://pm2.keymetrics.io/docs/usage/startup/

pm2 save
pm2 resurrect
pm2 startup systemv (for CentOS 6?)
pm2 unstartup

Updates

To update

cd Shinobi
git pull
pm2 restart camera.js
pm2 restart cron.js

Hardware

It supports lots of hardware out of the box. Please check the documentation.

For a cheap IP camera find an old Android smartphone and try something like BL IP-Camera