How To Install Shinobi

Moderator: Forum moderators

Post Reply
User avatar
rockedge
Site Admin
Posts: 5810
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2071 times
Been thanked: 2156 times
Contact:

How To Install Shinobi

Post by rockedge »

The recipe has been tested on Bionic64-v8 stock version with devx loaded.
once the system is up and running I believe one can unload the devx

Get the devx_bionicpup64_8.0.sfs and load it using Menu->Setup->SFS-Load-on-the-fly

Open a terminal ->

Code: Select all

 adduser mysql -d
finish the prompts.

https://nodejs.org/en/download/
download nodejs LTS (in my case node-v10.16.0-linux-x64)

open it with xarchive (click on it) extract to /root/my-applications

open /root/my-applications/node-v10.16.0-linux-x64/bin
sym-link the these files, open a termnal ->

Code: Select all

 ln -s /root/my-applications/node-v10.16.0-linux-x64/bin/node /root/my-applications/bin/node
 ln -s /root/my-applications/node-v10.16.0-linux-x64/bin/npm /root/my-applications/bin/npm
 ln -s /root/my-applications/node-v10.16.0-linux-x64/bin/npx /root/my-applications/bin/npx
open a terminal ->

Code: Select all

 node -v
you should see a response like :

Code: Select all

 v10.16.0
Open the PPM search for "mariadb" and select -> mariadb-server_10.1.40 (or newer)
Let PPM install it

open a terminal and type ->

Code: Select all

 mysql_install_db
mkdir /var/log/mysql
chown -R mysql /var/log/mysql
mysqld &
/usr/bin/mysql_secure_installation
reply Yes for all the prompts and fill in a password for the root user

close the terminal
mysql is running and the nodejs server is almost ready now.

open a terminal ->

Code: Select all

 ffmpeg
insure ffmpeg is present. if not install it.

From this page of the Shinobi docs -> https://shinobi.video/docs/start
Application Install

Download Shinobi with git (comes in the devx_bionicpup64_8.0.sfs)

Open Terminal in /root/my-applications

Code: Select all

 git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi
Set permissions on the shinobi directory. Where camera.js is located.

Code: Select all

 chmod -R 755 /root/my-applications/Shinobi
Open Shinobi directory.

Code: Select all

 cd /root/my-applications/Shinobi
Setup SQL. Go to sql and install the SQL files in your database.

Code: Select all

 cd sql
Access MariaDB SQL Database from Terminal. The password will have been set during the installation of MySQL.

Code: Select all

 mysql -u root -p
OPTIONAL : Create New SQL User with privileges. If you choose to use your own pre-defined credentials skip this step.

Code: Select all

 source ./user.sql
or create your own

Code: Select all

 CREATE USER 'majesticflame'@'127.0.0.1' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON * . * TO 'majesticflame'@'127.0.0.1';
FLUSH PRIVILEGES
;

while still in the SQL client. Install the Shinobi database. It will create a database called ccio.

Code: Select all

 source ./framework.sql
OPTIONAL : default_data.sql contains a demo user and a demo jpeg input monitor.

Code: Select all

 source ./default_data.sq
After importing the data. Exit the sql client.

Go up one directory to enter the main directory. Where camera.js is located.

Code: Select all

 cd ..
Copy conf.sample.json as another file named conf.json.

Code: Select all

 cp conf.sample.json conf.json
Edit conf.json to reflect your sql credentials. I don't reccommend using root.


Install Libraries

Run npm install while in the main directory. This will install the libraries Shinobi needs. PM2 is needed to use UPDATE.sh and to Daeomonize the process

Code: Select all

npm install&&npm install pm2 -g
Copy super.sample.json as another file named super.json.

Code: Select all

cp super.sample.json super.json
Launch Shinobi

then to start :

Code: Select all

 pm2 start camera.js
Run pm2 logs to see the console for any errors.

forever is another program to daemonize, but i've had more success with pm2.

To get your IP you can run the following command.

Code: Select all

 ifconfig -a
Open up http://YOUR_IP:8080 in your browser. The Default Login was originally set by adding default_data.sql.

Code: Select all

 Username : ccio@m03.ca
Password : password
REMEMBER:

all the passwords used are default and you can modify them as you wish.
once you have seen how it works one can place the components in any directories desired.
Post Reply

Return to “Network/Server”