Supergiovane / node-red-contrib-hikvision-ultimate

A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.
https://www.facebook.com/supergiovaneDev
MIT License
51 stars 11 forks source link

Picture node #9

Closed mineus55 closed 3 years ago

mineus55 commented 3 years ago

First of all, this is a really great node. A big Thank you!

As for the picture node, I notice it is reading the substream. Is there a way to read from mainstream too?

Also, the picture node continuously generates null output on my setup even without any "true" input....is this the intended behavior? It can be easily filtered out but I was wondering perhaps this is a minor bug.

mineus55 commented 3 years ago

I am on NR 1.2.9

Supergiovane commented 3 years ago

Hi In the current hik api there is no way to select other streams, sorry. From where do you see null output? From PIN1 or PIN2?

Supergiovane commented 3 years ago

...and... can you please paste here the output of the "null" message? I'm testing it with NVR as well as with direct connection to a Camera, but the node is totally silent.

mineus55 commented 3 years ago

Pardon the delay... :(

The null output is from PIN1. Upon closer look today, the node doesn't output null continuously but somewhat randomly (more on this randomness below). I am still unsure why it was doing it continuously two days ago.

These are my observations so far, hope it helps with the debug:

This is a sample the null object output of the picture node.

object topic: "" payload: undefined forEmail: undefined base64: undefined _msgid: "153cf2b4.c69fcd"

mineus55 commented 3 years ago

Ahh...I think I figured out what triggers the null output...it happens every time any motion detection alarm on the DVR is triggered (I suspect any channels will have the same effect but I haven't checked them all yet) Null output stops when the DVR has no active motion detection alert.

Supergiovane commented 3 years ago

Hi Your device is a mixed dvr/nvr. unfortunately, i have no access to any hikvision ISAPI documentation about these machines, so i cannor really help you. What i can make, is to filter out the payload that are null. I’ll do that in the upcoming new version

Supergiovane commented 3 years ago

V. 1.0.32 will be out in about 1 hour. PS: if you're able to send me the node-red log (coming from the node-red log file), it should help me to better handling your DVR. You need to enable the logging by putting a banana behind the IP address of your DVR.

Cursor_e_Node-RED
mineus55 commented 3 years ago

Hi super

First I can confirm that connecting directly to IP cam does not result in this null. However, another DVR also result in the same behavior. The firmware version is V4.21.

Is this the log you are looking for? Is this much enough? bananalog.txt

I did analyze a little more, it seems at least Video Loss event is not producing the null. As for other events type I haven't been able to isolate and analyze yet. Video loss is all I can confirm for now. This is the log of the videoloss event should it help.

videoloss.txt

mineus55 commented 3 years ago

By the way, I do think the easy step of filtering out the null output on the picture node is good enough. Probably easier than trying to pin down the ISAPI behavior.

Supergiovane commented 3 years ago

Thank you. Hikvision ISAPI documentation is a mess. Anyway, the videoloss messages is used by the cams/nvr for the heartbeat. Some firmwares sends it every 300ms, other newer firmwares, every 10 seconds. Please try the new hikvision-ultimate node, it should fix this annoying thing. Thank you for the logs!!

Supergiovane commented 3 years ago

Mineus55, can i close the issue?

mineus55 commented 3 years ago

Right. It should be closed. Thanks super.