node-red-contrib-hikvision-ultimate
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,2 +5,6 @@ # node-red-contrib-hikvision-ultimate | ||
<p> | ||
<b>Version 1.0.5</b> December 2020<br/> | ||
- NEW: Picture node. This node get a picture from camera, ready to be shown in the dashboard UI. The image can be rotated and resized.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.4</b> December 2020<br/> | ||
@@ -7,0 +11,0 @@ - Getting rid of old debug logs. Thanks @oliveres for advice.<br/> |
@@ -1,4 +0,2 @@ | ||
const { resolve } = require('path'); | ||
module.exports = (RED) => { | ||
@@ -237,10 +235,16 @@ | ||
var body = ""; | ||
body = await response.text(); | ||
_callerNode.sendPayload({ topic: _callerNode.topic || "", payload: true }); | ||
// Based on URL, will return the appropriate encoded body | ||
if (_URL.toLowerCase().includes("/ptzctrl/")) { | ||
_callerNode.sendPayload({ topic: _callerNode.topic || "", payload: true }); | ||
}else if (_URL.toLowerCase().includes("/streaming/")) { | ||
body = await response.buffer(); // "data:image/png;base64," + | ||
//_callerNode.sendPayload({ topic: _callerNode.topic || "", payload: body.toString("base64")}); | ||
_callerNode.sendPayload({ topic: _callerNode.topic || "", payload: body}); | ||
} | ||
} | ||
} catch (err) { | ||
console.log("ORRORE " + err.message); | ||
//console.log("ORRORE " + err.message); | ||
// Main Error | ||
_callerNode.setNodeStatus({ fill: "grey", shape: "ring", text: "Error: " + err.message }); | ||
_callerNode.setNodeStatus({ fill: "grey", shape: "ring", text: "Horror: " + err.message }); | ||
_callerNode.sendPayload({ topic: _callerNode.topic || "", errorDescription: err.message, payload: true }); | ||
@@ -247,0 +251,0 @@ // Abort request |
@@ -28,3 +28,2 @@ module.exports = function (RED) { | ||
} catch (error) { } | ||
} | ||
@@ -34,3 +33,2 @@ } | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "PTZ Pteset recalled." }); | ||
return; // Find first occurrence, exit. | ||
} | ||
@@ -37,0 +35,0 @@ |
{ | ||
"name": "node-red-contrib-hikvision-ultimate", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A native set of node for Hikvision Cameras, Alarms, Radars etc.", | ||
@@ -11,3 +11,4 @@ "author": "Supergiovane (https://github.com/Supergiovane)", | ||
"abort-controller": ">=3.0.0", | ||
"util": ">=0.12.3" | ||
"util": ">=0.12.3", | ||
"sharp": "0.26.3" | ||
}, | ||
@@ -25,3 +26,3 @@ "keywords": [ | ||
"node": ">=10.0.0" | ||
}, | ||
}, | ||
"license": "MIT", | ||
@@ -40,7 +41,6 @@ "repository": { | ||
"hikvisionUltimateANPR": "nodes/hikvisionUltimateANPR.js", | ||
"hikvisionUltimatePTZ": "nodes/hikvisionUltimatePTZ.js" | ||
"hikvisionUltimatePTZ": "nodes/hikvisionUltimatePTZ.js", | ||
"hikvisionUltimatePicture": "nodes/hikvisionUltimatePicture.js" | ||
} | ||
} | ||
} | ||
} |
@@ -21,3 +21,2 @@ # node-red-contrib-hikvision-ultimate | ||
## CHANGELOG | ||
@@ -46,3 +45,3 @@ * See <a href="https://github.com/Supergiovane/node-red-contrib-hikvision-ultimate/blob/master/CHANGELOG.md">here the changelog</a> | ||
**Output message** | ||
**Flow Messages** | ||
@@ -83,3 +82,3 @@ The node outputs a payload on **PIN 1**, true if alarm starts, false when alarm ended. Some alarm type doesn't support the alarm end event, so the node sends only a true payload when alarm occurs.</br> | ||
**Output message** | ||
**Flow Messages** | ||
@@ -125,7 +124,6 @@ The payload contains the license plate number and the property "plate" contains other useful informations.</br> | ||
**Output message** | ||
**Flow Messages** | ||
The node outputs ***true*** on PIN 1 if the command is executed, otherwise an error on PIN 2.</br> | ||
**Input** | ||
@@ -159,2 +157,52 @@ ```javascript | ||
## PICTURE NODE | ||
This node gets a picture from camera, ready to be shown in the dashboard UI.<br/> | ||
The image can be rotated and resized as well.<br/> | ||
Pass **true** as payload to obtain the image.<br/> | ||
You can, for example, link the ***Alarm node*** to the ***Picture node*** to get an image whenever an alarm occurs.<br/> | ||
<img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/picture.png' width="80%"> | ||
The ***Template*** node in this example, contains this code: | ||
```javascript | ||
<img src="{{payload}}"/> | ||
``` | ||
The ***Dashboard*** node in this example, contains this code: | ||
```javascript | ||
<div ng-bind-html="msg.payload"></div> | ||
``` | ||
**Flow Messages** | ||
The node outputs the image in base64 string format, ready for the UI Dashboard, on PIN 1, otherwise an error on PIN 2.</br> | ||
**Input** | ||
```javascript | ||
msg.payload = true; // To get the image | ||
``` | ||
**Output PIN 1** | ||
```javascript | ||
msg.payload = { | ||
{ | ||
"payload": image in base64 format, // Ready for the Dashboard UI | ||
"_msgid": "b07e50f6.86a72" | ||
} | ||
``` | ||
**Output PIN 2 (connection error)** | ||
```javascript | ||
msg = { | ||
"topic": "", | ||
"errorDescription": "", // This will contain the error rescription, in case of errors. | ||
"payload": false, // Or TRUE if error | ||
"_msgid": "dd5b3622.884a78" | ||
} | ||
``` | ||
<br/> | ||
<br/> | ||
--- | ||
## RADAR ALARM NODE | ||
@@ -165,3 +213,3 @@ This node works with Hikvision Radars.<br/> | ||
**Output message** | ||
**Flow Messages** | ||
@@ -232,3 +280,3 @@ The node outputs a message whenever an alarm starts or ends. It uses CID codes to identify the alarm type.</br> | ||
**Output message** | ||
**Flow Messages** | ||
@@ -235,0 +283,0 @@ The node outputs a payload on **PIN 1** that can vary, depending on the alarm type sent by the connected device.</br> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
496762
36
931
336
6
+ Addedsharp@0.26.3
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedarray-flatten@3.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddecompress-response@4.2.16.0.0(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexpand-template@2.0.3(transitive)
+ Addedfs-constants@1.0.0(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgithub-from-package@0.0.0(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedini@1.3.8(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedmimic-response@2.1.03.1.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp-classic@0.5.3(transitive)
+ Addednapi-build-utils@1.0.2(transitive)
+ Addednode-abi@2.30.1(transitive)
+ Addednode-addon-api@3.2.1(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedprebuild-install@6.1.4(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedreadable-stream@2.3.83.6.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsemver@5.7.27.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsharp@0.26.3(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@3.1.14.0.1(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtar-fs@2.1.1(transitive)
+ Addedtar-stream@2.2.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)