Giter Site home page Giter Site logo

node-red-contrib-onvif's Introduction

node-red-contrib-onvif

A Node-RED node that interacts with ip cameras using the ONVIF protocol.

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-onvif

Flows usage

Input

msg.payload = {
    url: "", // IP camera URL
    username: "", // IP camera username
    password: "", // IP camera password
    resize: {
        width: 800 // resize by width or height
    }
}

Output

msg.payload = {
    image: {
        "base64": "", // Base64 encoded image
        "binary": "", // Binary image
    }
}

Dashboard Usage

ONVIF Snapshot returns msg.payload in the form of a base64 encoded image to use with a Node-RED Dashboard template

<img src="{{ msg.payload.image.base64 }}">

node-red-contrib-onvif's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-red-contrib-onvif's Issues

Installation via pallet failed

Installation via pallet failed.
Below is the web log file:
-----------------------------------------------------------
2021-12-27T09:11:06.840Z Установить : node-red-contrib-onvif 1.0.3

2021-12-27T09:11:06.930Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production [email protected]
2021-12-27T09:11:22.977Z [err] npm
2021-12-27T09:11:22.979Z [err]  
2021-12-27T09:11:22.979Z [err] ERR!
2021-12-27T09:11:22.980Z [err]  code
2021-12-27T09:11:22.980Z [err]  EAI_AGAIN
2021-12-27T09:11:22.981Z [err] npm
2021-12-27T09:11:22.981Z [err]  ERR!
2021-12-27T09:11:22.982Z [err]  
2021-12-27T09:11:22.982Z [err] errno EAI_AGAIN
2021-12-27T09:11:22.993Z [err] npm
2021-12-27T09:11:22.993Z [err]  ERR!
2021-12-27T09:11:22.993Z [err]  request to https://registry.npmjs.org/node-red-contrib-onvif failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
2021-12-27T09:11:23.047Z [err] 
2021-12-27T09:11:23.048Z [err] npm
2021-12-27T09:11:23.048Z [err]  ERR!
2021-12-27T09:11:23.049Z [err]  A complete log of this run can be found in:
2021-12-27T09:11:23.049Z [err] npm 
2021-12-27T09:11:23.049Z [err] ERR!     /root/snap/node-red/675/.npm/_logs/2021-12-27T09_11_22_997Z-debug.log
2021-12-27T09:11:23.068Z rc=1
--------------------------------------------------------------------------
full log  /root/snap/node-red/675/.npm/_logs/2021-12-27T09_11_22_997Z-debug.log :
--------------------------------------------------------------------------
0 info it worked if it ends with ok
1 verbose cli [ '/snap/node-red/675/bin/node',
1 verbose cli   '/snap/node-red/675/bin/npm',
1 verbose cli   'install',
1 verbose cli   '--no-audit',
1 verbose cli   '--no-update-notifier',
1 verbose cli   '--no-fund',
1 verbose cli   '--save',
1 verbose cli   '--save-prefix=~',
1 verbose cli   '--production',
1 verbose cli   '[email protected]' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /root/snap/node-red/675/.npmrc. (matches userconfig)
5 verbose npm-session 843d05e85e8c26e1
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData error for [email protected] request to https://registry.npmjs.org/node-red-contrib-onvif failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
9 timing stage:rollbackFailedOptional Completed in 6ms
10 timing stage:runTopLevelLifecycles Completed in 13360ms
11 verbose type system
12 verbose stack FetchError: request to https://registry.npmjs.org/node-red-contrib-onvif failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
12 verbose stack     at ClientRequest.req.on.err (/snap/node-red/675/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
12 verbose stack     at ClientRequest.emit (events.js:198:13)
12 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:401:9)
12 verbose stack     at TLSSocket.emit (events.js:198:13)
12 verbose stack     at emitErrorNT (internal/streams/destroy.js:91:8)
12 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
12 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
13 verbose cwd /root/snap/node-red/675
14 verbose Linux 5.4.0-91-generic
15 verbose argv "/snap/node-red/675/bin/node" "/snap/node-red/675/bin/npm" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "[email protected]"
16 verbose node v10.23.3
17 verbose npm  v6.14.11
18 error code EAI_AGAIN
19 error errno EAI_AGAIN
20 error request to https://registry.npmjs.org/node-red-contrib-onvif failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
21 verbose exit [ 1, true ]

Installation failed

When I trying to install node-red-contrib-onvif in Node-Red:

-----------------------------------------------------------
2020-11-24T19:57:50.231Z Install : node-red-contrib-onvif 1.0.1

2020-11-24T19:57:50.312Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production [email protected]
2020-11-24T19:58:10.085Z [out] 
2020-11-24T19:58:10.085Z [out] > [email protected] install /config/node-red/node_modules/sharp
2020-11-24T19:58:10.085Z [out] > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
2020-11-24T19:58:10.085Z [out] 
2020-11-24T19:58:11.330Z [err] info
2020-11-24T19:58:11.333Z [err]  
2020-11-24T19:58:11.333Z [err] sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linuxmusl-armv7.tar.br
2020-11-24T19:58:12.121Z [err] ERR!
2020-11-24T19:58:12.121Z [err]  sharp
2020-11-24T19:58:12.121Z [err]  Prebuilt libvips 8.10.0 binaries are not yet available for linuxmusl-armv7
2020-11-24T19:58:12.121Z [err] info
2020-11-24T19:58:12.122Z [err]  
2020-11-24T19:58:12.122Z [err] sharp Attempting to build from source via node-gyp but this may fail due to the above error
2020-11-24T19:58:12.122Z [err] info
2020-11-24T19:58:12.122Z [err]  sharp
2020-11-24T19:58:12.123Z [err]  Please see https://sharp.pixelplumbing.com/install for required dependencies
2020-11-24T19:58:18.878Z [err] gyp
2020-11-24T19:58:18.880Z [err]  
2020-11-24T19:58:18.881Z [err] ERR!
2020-11-24T19:58:18.881Z [err]  
2020-11-24T19:58:18.882Z [err] build error
2020-11-24T19:58:18.882Z [err]  
2020-11-24T19:58:18.885Z [err] gyp
2020-11-24T19:58:18.885Z [err]  
2020-11-24T19:58:18.886Z [err] ERR!
2020-11-24T19:58:18.887Z [err]  
2020-11-24T19:58:18.887Z [err] stack
2020-11-24T19:58:18.888Z [err]  Error: not found: make
2020-11-24T19:58:18.888Z [err] gyp
2020-11-24T19:58:18.888Z [err]  
2020-11-24T19:58:18.889Z [err] ERR!
2020-11-24T19:58:18.889Z [err]  
2020-11-24T19:58:18.889Z [err] stack
2020-11-24T19:58:18.890Z [err]      at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
2020-11-24T19:58:18.890Z [err] gyp
2020-11-24T19:58:18.890Z [err]  
2020-11-24T19:58:18.891Z [err] ERR!
2020-11-24T19:58:18.891Z [err]  stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
2020-11-24T19:58:18.891Z [err] gyp 
2020-11-24T19:58:18.891Z [err] ERR! 
2020-11-24T19:58:18.891Z [err] stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
2020-11-24T19:58:18.892Z [err] gyp ERR! 
2020-11-24T19:58:18.892Z [err] stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
2020-11-24T19:58:18.892Z [err] gyp ERR!
2020-11-24T19:58:18.892Z [err]  stack
2020-11-24T19:58:18.892Z [err]      at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2020-11-24T19:58:18.892Z [err] gyp
2020-11-24T19:58:18.892Z [err]  ERR! 
2020-11-24T19:58:18.893Z [err] stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2020-11-24T19:58:18.893Z [err] gyp ERR!
2020-11-24T19:58:18.893Z [err]  stack     at FSReqCallback.oncomplete (fs.js:168:21)
2020-11-24T19:58:18.894Z [err] gyp
2020-11-24T19:58:18.894Z [err]  ERR! System Linux 4.19.127-v7
2020-11-24T19:58:18.895Z [err] gyp
2020-11-24T19:58:18.895Z [err]  ERR! 
2020-11-24T19:58:18.895Z [err] command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-11-24T19:58:18.895Z [err] gyp ERR!
2020-11-24T19:58:18.895Z [err]  cwd /config/node-red/node_modules/sharp
2020-11-24T19:58:18.895Z [err] gyp 
2020-11-24T19:58:18.895Z [err] ERR! node -v
2020-11-24T19:58:18.896Z [err]  v12.18.4
2020-11-24T19:58:18.896Z [err] gyp ERR!
2020-11-24T19:58:18.896Z [err]  node-gyp -v v5.1.0
2020-11-24T19:58:18.896Z [err] gyp 
2020-11-24T19:58:18.896Z [err] ERR! not ok
2020-11-24T19:58:18.896Z [err]  
2020-11-24T19:58:20.225Z [err] npm
2020-11-24T19:58:20.225Z [err]  
2020-11-24T19:58:20.226Z [err] ERR!
2020-11-24T19:58:20.226Z [err]  
2020-11-24T19:58:20.226Z [err] code
2020-11-24T19:58:20.227Z [err]  ELIFECYCLE
2020-11-24T19:58:20.227Z [err] npm
2020-11-24T19:58:20.227Z [err]  
2020-11-24T19:58:20.228Z [err] ERR!
2020-11-24T19:58:20.228Z [err]  
2020-11-24T19:58:20.228Z [err] errno
2020-11-24T19:58:20.229Z [err]  1
2020-11-24T19:58:20.251Z [err] npm
2020-11-24T19:58:20.251Z [err]  
2020-11-24T19:58:20.252Z [err] ERR!
2020-11-24T19:58:20.252Z [err]  [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
2020-11-24T19:58:20.252Z [err] npm
2020-11-24T19:58:20.252Z [err]  
2020-11-24T19:58:20.253Z [err] ERR!
2020-11-24T19:58:20.253Z [err]  Exit status 1
2020-11-24T19:58:20.253Z [err] npm
2020-11-24T19:58:20.254Z [err]  
2020-11-24T19:58:20.254Z [err] ERR!
2020-11-24T19:58:20.254Z [err]  
2020-11-24T19:58:20.255Z [err] npm
2020-11-24T19:58:20.255Z [err]  
2020-11-24T19:58:20.255Z [err] ERR!
2020-11-24T19:58:20.255Z [err]  Failed at the [email protected] install script.
2020-11-24T19:58:20.256Z [err] npm
2020-11-24T19:58:20.256Z [err]  
2020-11-24T19:58:20.257Z [err] ERR!
2020-11-24T19:58:20.257Z [err]  This is probably not a problem with npm. There is likely additional logging output above.
2020-11-24T19:58:20.332Z [err] 
2020-11-24T19:58:20.333Z [err] npm
2020-11-24T19:58:20.333Z [err]  
2020-11-24T19:58:20.334Z [err] ERR!
2020-11-24T19:58:20.334Z [err]  A complete log of this run can be found in:
2020-11-24T19:58:20.334Z [err] npm
2020-11-24T19:58:20.335Z [err]  
2020-11-24T19:58:20.335Z [err] ERR!
2020-11-24T19:58:20.335Z [err]      /root/.npm/_logs/2020-11-24T19_58_20_303Z-debug.log
2020-11-24T19:58:20.369Z rc=1

add an input

I think it would be interesting to add an entry to this node so that it can be triggered with any event.

PTZ Function for light on/off

i use your node to get some Snapshots of IP ONVIF Cameras (exp.Pond camera AP-W28316)

one of them have IR Led and Light to switch on and off over the webinterface. They used the PTZ function

The two arrow keys UP / DOWN serve to switch the white
light or the IR light on / off and to control the light intensity in
several stages. The LEFT arrow key switches the camera to
infrared (IR) mode and between the three operating modes:

  1. IR-LED manual / 2. IR-LED time-controlled / 3. IR-LED
    automatic *. The RIGHT arrow key switches the camera to
    white light mode and between the three operating modes: 1.
    White light manual / 2. White light time-controlled / 3. White
    light automatic *
    All other buttons have no control function!

my question: is this possible with your node? and if yes how?
oder is there any plan to implement this function? #
#

error Failed at the [email protected] install script

Hi, I'm getting the following error messages during the installation of node-red-contrib-onvif:

3-20T17:22:11.056Z [out] > [email protected] install /data/node_modules/sharp
2022-03-20T17:22:11.056Z [out] > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2022-03-20T17:22:11.056Z [out]
2022-03-20T17:22:11.531Z [out] sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.6/libvips-8.10.6-linuxmusl-armv7.tar.br
2022-03-20T17:22:11.791Z [err] sharp: Installation error: Prebuilt libvips 8.10.6 binaries are not yet available for linuxmusl-armv7
2022-03-20T17:22:11.792Z [out] sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies

1129 verbose stack Error: [email protected] install: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
1129 verbose stack Exit status 1
1129 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
1129 verbose stack at EventEmitter.emit (events.js:400:28)
1129 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1129 verbose stack at ChildProcess.emit (events.js:400:28)
1129 verbose stack at maybeClose (internal/child_process.js:1058:16)
1129 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
1130 verbose pkgid [email protected]
1131 verbose cwd /data
1132 verbose Linux 5.10.103-v7l+
1133 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "sharp"
1134 verbose node v14.18.2
1135 verbose npm v6.14.15
1136 error code ELIFECYCLE
1137 error errno 1
1138 error [email protected] install: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
1138 error Exit status 1
1139 error Failed at the [email protected] install script.

Unable to install node - via terminal or pallet

I get this error... but am not clear on the reasoning. I already have libvips installed, as I used this method - https://snapcraft.io/install/libvips/raspbian#install

pi@raspberrypi3:~ $ npm install node-red-contrib-onvif

> [email protected] install /home/pi/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Installation error: Use with glibc 2.24 requires manual installation of libvips >= 8.10.6
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm WARN [email protected] requires a peer of socket.io@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-red-dashboard@^2.26.1 but none is installed. You must install peer dependencies yourself.
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
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/pi/.npm/_logs/2021-07-28T03_38_48_073Z-debug.log
pi@raspberrypi3:~ $

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.