Installation of motion detection



  • Hi,

    I'm trying to install the motion detection on Ubuntu 16.04.3 but it always fails while installing canvas.

    I'm inside the Shinobi directory and when installing it via

    sudo npm install canvas moment

    I get the following error.

    [email protected] install /home/ni-admin/Shinobi/node_modules/canvas
    node-gyp rebuild

    gyp ERR! configure error
    gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ni-admin/Shinobi/node_modules/canvas/build'
    gyp ERR! System Linux 4.10.0-28-generic
    gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/ni-admin/Shinobi/node_modules/canvas
    gyp ERR! node -v v8.9.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok
    npm WARN [email protected] license should be a valid SPDX license expression

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    Maybe someone has an idea?

    Thank you,

    Henry


  • administrators

    hey there! šŸ™‚

    sometimes this happens, not really sure what the issue is... because it occasionally happens as root also.

    the way i fix it is to do sudo npm install canvas. I will need to update the docs to reflect this. Thank you!



  • I have just had a very similar issue trying to start up from the docker-compose.yml file. In fact that's why I registered here. The fix in my case was to add some more dependencies into the Dockerfile:

    RUN apk add --update --no-cache ffmpeg python pkgconfig cairo-dev pango-dev pangomm-dev giflib-dev make g++ jpeg-dev
    

    I added pango-dev, pangomm-dev and giflib-dev. Not sure whether they're all needed but it starts up OK for me now.


  • administrators

    @faxesystem oh i missed that you already tried my suggestion. Thanks @evansj !


  • administrators

    CRITICAL!!

    you must do sudo npm install [email protected] until the plugin is updated and compatible with both versions. The fixes have been presented in PR already along with another method altogether. I will be adding it in as soon as i can! sorry for the hurdles!

    PR with updated motion plugin for canvas 2.0 https://github.com/ShinobiCCTV/Shinobi/pull/29/files



  • Hi @moeiscool ,

    also with forcing it to install canvas 1.6 I'm getting the following error on a fresh Shinobi Install

    sudo npm install [email protected] moment

    [email protected] install /home/ni-admin/Shinobi/node_modules/canvas
    node-gyp rebuild

    gyp ERR! configure error
    gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ni-admin/Shinobi/node_modules/canvas/build'
    gyp ERR! System Linux 4.10.0-28-generic
    gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/ni-admin/Shinobi/node_modules/canvas
    gyp ERR! node -v v8.9.1
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok
    npm WARN [email protected] license should be a valid SPDX license expression

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: node-gyp rebuild
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/ni-admin/.npm/_logs/2017-11-14T08_52_24_891Z-debug.log


  • administrators

    sorry for the late reply... hmmm i think there are 3 things to try

    • delete node_modules and try again.
    • become root then do the first suggestion again
    • chmod -R 777 /home/ni-admin/Shinobi/ and do the first suggestion again


  • This post is deleted!


  • @moeiscool said in Installation of motion detection:

    sorry for the late reply... hmmm i think there are 3 things to try

    • delete node_modules and try again.
    • become root then do the first suggestion again
    • chmod -R 777 /home/ni-admin/Shinobi/ and do the first suggestion again

    not helped šŸ˜ž


  • administrators

    i think the fix found was doing this npm --unsafe-perm install [email protected] if you can't get it to install easily.



  • I just had the same permission problem with [email protected] install

    Tried making the missing directory manually, and running chown and chmod, no success.

    I did sudo su to login as root, and then run:
    sudo npm install [email protected]

    It then installed with no errors.

    A poster on superuser had a similar permission issues with another npm install
    I told him to login as root with sudo su, and it did the trick for him aswell.
    Is npm the bad guy here? šŸ™‚



  • Sooo... is the plugin fixed to run with Cairo 2? Could someone tell me what commands I need to install motion detection on OS X via Brew? Looking at the motion detection docs page, and with what I know about Brew/OS X so far, i would assume the installation command appears to be:

    brew install cairo
    

    then

    sudo npm install [email protected] moment
    

    etc. But what's the different between sudo npm install [email protected] moment and sudo npm install [email protected] per @pamo above? Again, I'm running OS X and Brew, so some stuff may be different...



  • @faxesystem said in Installation of motion detection:

    Error

    Hi,
    Could I track or log anything to find what the problem is ?
    It was started, but goes to error.
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ Name ā”‚ mode ā”‚ status ā”‚ ā†ŗ ā”‚ cpu ā”‚ memory ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ camera ā”‚ fork ā”‚ online ā”‚ 0 ā”‚ 0% ā”‚ 55.4 MB ā”‚
    ā”‚ cron ā”‚ fork ā”‚ online ā”‚ 0 ā”‚ 0% ā”‚ 44.6 MB ā”‚
    ā”‚ shinobi-motion ā”‚ fork ā”‚ online ā”‚ 0 ā”‚ 0% ā”‚ 26.9 MB ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    Use pm2 show <id|name> to get more details about an app
    [email protected]:/usr/local/shinobi # pm2 list
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ Name ā”‚ mode ā”‚ status ā”‚ ā†ŗ ā”‚ cpu ā”‚ memory ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ camera ā”‚ fork ā”‚ online ā”‚ 0 ā”‚ 0% ā”‚ 55.2 MB ā”‚
    ā”‚ cron ā”‚ fork ā”‚ online ā”‚ 0 ā”‚ 0% ā”‚ 44.7 MB ā”‚
    ā”‚ shinobi-motion ā”‚ fork ā”‚ errored ā”‚ 15 ā”‚ 0% ā”‚ 0 B ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    It runs on FreeBSD jail. Everything are ok, except the motion.
    thanks
    Barna



  • what does this mean ?
    /root/.pm2/logs/shinobi-motion-out-2.log last 15 lines:
    /root/.pm2/logs/shinobi-motion-error-2.log last 15 lines:
    2|shinobi- | at Module._compile (module.js:660:30)
    2|shinobi- | at Object.Module._extensions..js (module.js:671:10)
    2|shinobi- | at Module.load (module.js:573:32)
    2|shinobi- | stackframes:
    2|shinobi- | [ { file_name: 'module.js', line_number: 689 },
    2|shinobi- | { file_name: 'module.js', line_number: 573 },
    2|shinobi- | { file_name: 'module.js', line_number: 513 },
    2|shinobi- | { file_name: 'module.js', line_number: 505 },
    2|shinobi- | { file_name: 'module.js', line_number: 604 },
    2|shinobi- | { file_name: 'internal/module.js', line_number: 11 },
    2|shinobi- | { file_name: '/usr/local/shinobi/node_modules/canvas/lib/bindings.js',
    2|shinobi- | line_number: 3 },
    2|shinobi- | { file_name: 'module.js', line_number: 660 },
    2|shinobi- | { file_name: 'module.js', line_number: 671 },
    2|shinobi- | { file_name: 'module.js', line_number: 573 } ] }


  • administrators

    @BarnaM7 please do pm2 flush && pm2 restart all && pm2 logs then paste the contents of the output please. it seems its only show the last 15 lines of the error.

    also sorry for the late response šŸ˜…



  • I have found the issue. I have tried to install it to freenas jail, but I have met a zlib error, which is version specific and there is not real solution for that at this moment.
    So I have installed it on a debian vm, everything was quick and perfect.
    But I'm fighting to set the sensitivity of motion detection which is not to easy.

    Am I correct ?
    Indifference: number of pixel changes
    Full Frame Detection: use the full picture or only the region for comparative
    Show Regions of Interest: ?
    Send Frames: yes, this is necessary for motion plugin
    Show Regions of Interest: ?
    Allow Next Trigger: ?
    Timeout Reset on Next Motion: ?
    Allow Next Trigger: ?

    thanks


  • administrators

    Indifference: number of pixel changes
    yes and no. It's a mash of different values. Honestly I don't know exactly what it's doing. It is a method developed by soundstep. I use it because it's really fast.

    Full Frame Detection: use the full picture or only the region for comparative
    yes. Recently though users have reported this not working for them.

    Show Regions of Interest: ?
    This is for the motion-pixel.js file. It is uses a different method to read pixel changes. When this option is on it will draw boxes around pixel changes.

    Send Frames: yes, this is necessary for motion plugin
    yes

    Allow Next Trigger: ?
    When to let the next trigger run on the main system. This is to prevent an overload from the data coming back.

    Timeout Reset on Next Motion: ?
    This is for HotSwap Recording method. There is a timer that has it switch back to watch-only. You can make it so that timer is extended every time a new trigger is accepted.


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.