[ANNOUNCE] node-red-contrib-onvif-nodes (beta 7 : event streaming)

Hi folks,

Due to a lack of time the release of the previous beta version of node-red-contrib-onvif-nodes is already 13 months ago :roll_eyes: . But now I finally managed to publish a new beta 7 version on NPM, which can be installed like this:

npm install node-red-contrib-onvif-nodes@0.0.1-beta.7

This version contains a number of bug fixes, and the Event-node has been implemented :champagne: :partying_face: This node allows you to listen for an infinite stream of events pushed by your Onvif camera:

image

You can now listen to motion detection events, embedded PIR detector alarms, monitor the CPU, ... (depending on the different kind of events that your device offers).

But I'm afraid I got good news and bad news:

  • The good news is that the onvif library (which I use behind the scenes) is being maintained again. Remark: I use their master branch from Github as a dependency because their NPM version doesn't support events well yet:
     "dependencies": {
        "onvif": "git://github.com/agsh/onvif.git"
     },
    
  • The bad new is that recently president Trump seems to have banned Hikvision and Dahua as members of the Onvif industry forum, because they "violate human rights"... Which means that both companies are not allowed to use Onvif anymore in their new devices. Here is more background information for those who have time. But the problem is now that in the majority of the camera's won't support Onvif anymore, so the future of Onvif has become uncertain. Seems the Onvif open standard isn't really open anymore :rage:

P.S. the guys from the onvif library have only tested the event streams on Axis and Hikvision cameras, so it might not work for other brands...

QUESTION:

  • Via the following flow:

    image

    You can determine which events are being supported by your camera:

    image

  • When you start listening to the events, for example the ProcessorUsage event is currently send in the output message like this:

    image

    Not sure whether this is a good msg structure? Should I send perhaps a nested field like this:
    msg.monitoring.processorUsage. Not sure ...

Hope it works fine in your case!
Bart

4 Likes

Hopefully they will keep their cameras compliant even though they will not be able to officially claim compliance, in the hope that they will get back in at some point.

1 Like

It seems to be working for me, though I don't think events are something I need, at least at the moment.
Does the node allow changing the image properties such as Brightness? I can get the current settings with the Imaging node but I can't see how to change the settings.

@colin,
I have recently bought a Hikvision camera, which is stuffed with lots of nice electronics: microphone, speaker, PIR sensor, IR leds, external input and output, ... So this camera can push an event to your Node-RED flow e.g. when the embedded PIR sensor detects motion, which means you have a complete alarm system in a small device ...

I have replaced the picture (see also my first post above) on my readme page by this one, to explain all these features a bit better:

image

I have now added functionality in the Imaging node to allow you to set the brightness/sharpness/contrast/colorSaturation. And an "Imaging node" section has been added to my readme page with some explanation and example flows. So please install this new version ...

Here is a demo that shows switching between the minimum and maximum brightness:

onvif_demo_brightness

P.S. You are watching a bunch of ethernet cables at my switch :wink:

1 Like

I didn't in any way mean that the events feature is not useful, just that it isn't useful to me at the moment.
On the brightness setting I didn't see the set image settings option in the dropdown in the imaging node so I assumed that was not yet available, so it was with great anticipation that I tried your sample flow. Unfortunately it doesn't seem to work for me. When I try to change the brightness it does nothing, the node sends no message and no errors show in the debug pane. However in the node red log I see
Action setImagingSettings is not supported
which I guess may mean that my camera does not support it, which is a real shame as if I could do that it would mean I could dispense completely with the manufacturers horrible ActiveX interface that needs to be run in IE. :frowning:

Well it wasn't available. Added that functionality today on your request ...

Damn. My fault. This is the only of my nodes that uses beta versions on NPM, so I forgot to publish beta 8 on NPM. Have done it now. Sorry for the confusion!
So we still have a chance to get rid of your horrible ActiveX control :wink:

1 Like

Yes!! Begone foul ActiveX Control, never to appear on my screen again.
@BartButenaers You are my hero.

I was a bit confused by your previous post, I wasn't sure whether it meant that you had released another new version or not, and as you say it did not appear on npm.

Even better it means I can now control the brightness from within node-red. I have it watching a Dipper's nest under a bridge and the auto exposure is confused by the bright light at the far end of the bridge and the result is that it is too dark. However at night it is illuminated with the infra red so if I set the brightness for daytime then it is too bright at night. Now I can adjust it based on the time of day, or even possibly based on whether the infra red is on, if I can work out how to tell that. Perhaps there is an event for it, research required. For some reason the stupid bird has decided to build it's nest on top of the box this year rather than inside it.

By the way, if you install using
npm install node-red-contrib-onvif-nodes@beta
that will always install the latest version from the beta channel.

2 Likes

Nice! I'm happy it isn't your basement :smiley:
But maybe the flooding you had earlier in some parts of UK is since long gone. Maybe it did not hit you anyway?

The house is well above the stream and we are at an altitude of 200m well up the valley so no danger of flooding of anything important. The stream was up to only a foot or so below the box though, and was what can only be described as a raging torrent. I didn't have the camera in situ then though, I didn't want to risk it getting washed away.

I'm glad it finally works, and that I was able to help you (after you helped solving about a million questions on this forum ...)!

Good tip !!!

A bit of an issue with the brightness setting. If I set a value in msg.brightness but msg.contrast and msg.colorSaturation don't exist then it sets the contrast and color to 0. Similarly if I set the contrast but not the brightness then the brightness is set to zero. If I provide a value for all three then it is ok. Is that an issue with the node or the camera?

Hi Colin,
In the Onvif imaging specification you will see that all the parameters are optional:

image

And indeed my Hikvision camera behaves like that.
So I assume you have bought your camera in poundshop.com or a similar shop :wink:
I have published a beta 9 version:

  • In the Imaging section of the readme page, I have added a flow at the end that hopefully can workaround your problem.
  • A series of extra imaging settings are now supported (depending on the brand).
  • Caution: to be able to simply your workaround flow, I now use the payload as input!!! So instead of msg.brightness you now need to set msg.payload.brightness!

Hopefully this can be of any help to you ...
Bart

The camera is an XVision X2C4000BMP. I can't complain that it doesn't implement ONVIF correctly because it doesn't even mention ONVIF in the spec. I was surprised to find that it does support a fair amount of the protocol, but that is why I always suggest that it may be the camera that is at fault. I guess that when this camera was produced they were working towards ONVIF but were not fully there yet.
I have worked around it just by always passing all the parameters, but I thought I should report it in case it was a problem with the node.
In your example flow in the wiki it seems to suggest that full brightness is 100, but on mine it goes from 0 to 255, but again that may well be an error in the camera.
Thanks again.

I see this in the spec:

image
Which is quite dynamic ...
Have tried to set a value of 255, but then I get "invalid brightness value". So not sure ...

Perhaps 'Valid range of Brightness' means that it is up to the camera to decide what range to use.

Hi Bart,
could you please let me know the type/name/product ID of the Camera. I like to buy one as well.
thanks in advance
Johannes

Hi Bart, i want to update my Beta 6 to Beta 9 by downloading the zip :
image
BUT when i open the package.json it's still the beta 7 :
image

Hi Johannes (@juntiedt),
Ii is a Hikvision DS-2CD2442FWD-IW, which I bought last year on aliexpress for 88 Euro. But then customs intercepted it and added an extra 45 euro. But it seems that prices have gone upwards since then. Perhaps there is a successor for this device already. Don't know....

Hi Chris (@SuperNinja),
Cannot explain that. When I use the "Clone or download" button, then the content of the package.json file inside the zip looks fine:

image

Having downloaded it what did you do with it?