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
49 stars 11 forks source link

IP cameras still not working #13

Closed smcgann99 closed 3 years ago

smcgann99 commented 3 years ago

Hi,

Just tried this with my HVR analog cams 1 to 3 work as expected but IP cams give me bad request, any ideas ?

Supergiovane commented 3 years ago

Hi Sorry, you need to be more specific. What type/model of NVR do you have? What hikvision node you're using? Have you tried to update the NVR firmware? Thanks.

smcgann99 commented 3 years ago

dvr is 8 channel hybrid Model: iDS-7208HUHI-K1/4S(B) Firmware: V4.26.010

raw alarm node works and shows for example

dynChannelID: "12" dateTime: "2021-04-06T10:42:4300:00" activePostCount: "2" eventType: "linedetection" eventState: "active" eventDescription: "linedetection alarm"

but picture node for ip camera(12) gives bad request message on node status, analog cameras do work as expected on channels 1 to 8

Also just checked text node and that DOES work with channel 12, maybe picture node cannot access the "dynamic" channels used by ip cameras ?

Supergiovane commented 3 years ago

Hi, hybrid NVR have been always problematic. Please, you should add "banana" after the NVR IP in the config window. This will activate the debug log in node-red. You should restart node-red and retry to get an image, then send me the log in some way (screenshot or text file). For example, if your NVR's IP is 192.168.1.22, you should write 192.168.1.22banana in the config window.

smcgann99 commented 3 years ago

"Hikvision-config: clientGenericRequest.fetch error Error response: Bad Request"

Supergiovane commented 3 years ago

Hmm.. the url is different but i’ve no documentation about the url of your nvr

smcgann99 commented 3 years ago

it is spamming the log with 2 messages - BANANA PROCESSING

Content-Type: application/xml; charset="UTF-8"

Content-Length: 467

192.168.1.81 80 HTTP ac:cb:51:e7:ed:ca 0 2021-04-06T17:56:0500:00 0 videoloss inactive videoloss alarm
smcgann99 commented 3 years ago
192.168.1.81 80 HTTP ac:cb:51:e7:ed:ca 0 2021-04-06T17:48:2800:00 0 videoloss inactive videoloss alarm

6 Apr 17:48:29 - [error] BANANA SBANANATO XML -> JSON {"EventNotificationAlert":{"$":{"version":"1.0","xmlns":"http://www.hikvision.com/ver20/XMLSchema"},"ipAddress":"192.168.1.81","portNo":"80","protocol":"HTTP","macAddress":"ac:cb:51:e7:ed:ca","channelID":"0","dateTime":"2021-04-06T17:48:2800:00","activePostCount":"0","eventType":"videoloss","eventState":"inactive","eventDescription":"videoloss alarm"}} 6 Apr 17:48:39 - [info] SPLITTATO RESULT COUNT: ####### 2 ###################### FINE SPLITTATO RESULT 6 Apr 17:48:39 - [info] SPLITTATO RESULT EMPTY: ####### ###################### FINE SPLITTATO RESULT 6 Apr 17:48:39 - [error] BANANA PROCESSING Content-Type: application/xml; charset="UTF-8" Content-Length: 467

192.168.1.81 80 HTTP ac:cb:51:e7:ed:ca 0 2021-04-06T17:48:3800:00 0 videoloss inactive videoloss alarm

6 Apr 17:48:39 - [error] BANANA SBANANATO XML -> JSON {"EventNotificationAlert":{"$":{"version":"1.0","xmlns":"http://www.hikvision.com/ver20/XMLSchema"},"ipAddress":"192.168.1.81","portNo":"80","protocol":"HTTP","macAddress":"ac:cb:51:e7:ed:ca","channelID":"0","dateTime":"2021-04-06T17:48:3800:00","activePostCount":"0","eventType":"videoloss","eventState":"inactive","eventDescription":"videoloss alarm"}}

Supergiovane commented 3 years ago

What version of node have you installed? Please issue a node -v on a command prompt

smcgann99 commented 3 years ago

v14.6.0

Supergiovane commented 3 years ago

The node version should be ok. You should leave the log running and request for an image. Then stop the log. I need to see the exact response from the nvr when you ask for an image.

smcgann99 commented 3 years ago

6 Apr 18:04:20 - [info] Hikvision-config: before Pipelining...

6 Apr 18:04:29 - [info] SPLITTATO RESULT COUNT: ####### 2 ###################### FINE SPLITTATO RESULT 6 Apr 18:04:29 - [info] SPLITTATO RESULT EMPTY: ####### ###################### FINE SPLITTATO RESULT 6 Apr 18:04:29 - [error] BANANA PROCESSING Content-Type: application/xml; charset="UTF-8" Content-Length: 467

6 Apr 18:04:29 - [info] Hikvision-config: DecodingBody Info only: Invalid Json Content-Type: application/xml; charset="UTF-8" Content-Length: 467

6 Apr 18:04:38 - [info] SPLITTATO RESULT COUNT: ####### 2 ###################### FINE SPLITTATO RESULT 6 Apr 18:04:38 - [error] BANANA PROCESSING

192.168.1.81 80 HTTP ac:cb:51:e7:ed:ca 0 2021-04-06T18:04:2800:00 0 videoloss inactive videoloss alarm

6 Apr 18:04:38 - [error] BANANA SBANANATO XML -> JSON {"EventNotificationAlert":{"$":{"version":"1.0","xmlns":"http://www.hikvision.com/ver20/XMLSchema"},"ipAddress":"192.168.1.81","portNo":"80","protocol":"HTTP","macAddress":"ac:cb:51:e7:ed:ca","channelID":"0","dateTime":"2021-04-06T18:04:2800:00","activePostCount":"0","eventType":"videoloss","eventState":"inactive","eventDescription":"videoloss alarm"}} 6 Apr 18:04:38 - [error] BANANA PROCESSING Content-Type: application/xml; charset="UTF-8" Content-Length: 467

192.168.1.81 80 HTTP ac:cb:51:e7:ed:ca 0 2021-04-06T18:04:3700:00 0 videoloss inactive videoloss alarm

6 Apr 18:04:38 - [error] BANANA SBANANATO XML -> JSON {"EventNotificationAlert":{"$":{"version":"1.0","xmlns":"http://www.hikvision.com/ver20/XMLSchema"},"ipAddress":"192.168.1.81","portNo":"80","protocol":"HTTP","macAddress":"ac:cb:51:e7:ed:ca","channelID":"0","dateTime":"2021-04-06T18:04:3700:00","activePostCount":"0","eventType":"videoloss","eventState":"inactive","eventDescription":"videoloss alarm"}} 6 Apr 18:04:42 - [error] Hikvision-config: clientGenericRequest.fetch error Error response: Bad Request 6 Apr 18:04:47 - [info] SPLITTATO RESULT COUNT: ####### 2 ###################### FINE SPLITTATO RESULT 6 Apr 18:04:47 - [info] SPLITTATO RESULT EMPTY: ####### ###################### FINE SPLITTATO RESULT 6 Apr 18:04:47 - [error] BANANA PROCESSING Content-Type: application/xml; charset="UTF-8" Content-Length: 467

smcgann99 commented 3 years ago

FYI

/ISAPI/ContentMgmt/StreamingProxy/channels/1201/picture = ip camera 12 /ISAPI/Streaming/channels/101/picture = analog camera 1 perhaps you can add an option in the node to select method ?

Supergiovane commented 3 years ago

Hmmm interesting... It makes sense, because your NVR serve as proxy for the cameras... But does it work? Have you tried to get the image from a web browser, passing the /ISAPI/ContentMgmt/StreamingProxy/channels/1201/picture string?

Supergiovane commented 3 years ago

V. 1.0.34 will be out today with the fix. Thank you for you help in finding the string. If it doesn't work, please reopen this issue. Cheers.

smcgann99 commented 3 years ago

I see the yellow status only for first trigger, but no picture is returned, after that another trigger doesn't produce any debug output or status message, also no picture. 8 Apr 00:19:07 - [info] BANANA IT DOES NOT WORK GETTING IMAGE WITH WITH 8 Apr 00:19:07 - [info] BANANA TRYING GETTING IMAGE WITH 8 Apr 00:19:10 - [info] SPLITTATO RESULT COUNT: ####### 2 ###################### FINE SPLITTATO RESULT 8 Apr 00:19:10 - [error] BANANA PROCESSING

192.168.1.81
Supergiovane commented 3 years ago

Hi Have you tried to get the image from a web browser, passing the /ISAPI/ContentMgmt/StreamingProxy/channels/1201/picture string?

Supergiovane commented 3 years ago

Also, please unzip this zip into your .node-red/node_modules/node-red-contrib-hikvision-ultimate/nodes folder and restart node red. Then try again.

hikvisionUltimatePicture.js.zip

Supergiovane commented 3 years ago

Hello scm can you give me a feedback about this issue?

smcgann99 commented 3 years ago

/ISAPI/ContentMgmt/StreamingProxy/channels/1201/picture I already use this path with standard http request node and it works OK.

tried your new code - ip cameras still not working. yellow node status message is not displaying anymore.

10 Apr 09:43:37 - [info] Hikvision-config: DecodingBody Info only: Invalid Json Content-Type: application/xml; charset="UTF-8" Content-Length: 467

10 Apr 09:47:03 - [error] Hikvision-config: clientGenericRequest.fetch error Error response: Service Unavailable

Supergiovane commented 3 years ago

Hmmm. So the querystring you proposed is invalid. Do you have other to test?

smcgann99 commented 3 years ago

no the string is correct I am already using it in node red

smcgann99 commented 3 years ago

I don't see your node status messages so I don't think that that code is working

Supergiovane commented 3 years ago

Hmm... maybe a syntax error.... Let me check.

Supergiovane commented 3 years ago

I copied the zip file yes

You are old. You should install the new version from the palette menu.

smcgann99 commented 3 years ago

admin:*****@192.168.1.81/ISAPI/ContentMgmt/StreamingProxy/channels/901/picture I have this in http request nodes at the moment to capture images.....

smcgann99 commented 3 years ago

I copied the zip file yes

Supergiovane commented 3 years ago

You're using basic authentication. Have you tried to set the basic authentication in node the config window ?

Supergiovane commented 3 years ago

The latest version is 1.0.37. Please install it.

smcgann99 commented 3 years ago

after deploy first time I click inject node I see yellow status on picture node but no output. Second click no status and no output

smcgann99 commented 3 years ago

dont think authentication is an issue as analog channels work with either option

Supergiovane commented 3 years ago

Are you on v. 1.0.37?

smcgann99 commented 3 years ago

yes

smcgann99 commented 3 years ago

rather than trying all paths perhaps you could have a drop down in picture node to select it ?

Supergiovane commented 3 years ago

Yes, but trying paths is more simple for end user. Can you please unzip this and try again? knxUltimate-config.js.zip

smcgann99 commented 3 years ago

think this is wrong file ?

Supergiovane commented 3 years ago

Hi this is the correct one, put it here .node-red/node_modules/node-red-contrib-hikvision-ultimate/nodes knxUltimate-config.js.zip It should work.

Supergiovane commented 3 years ago

Anyway, the error you received (service unavaiable) means that at the moment, the webserver of the camera is unable to fulfill the request. If you've many things connected to the camera, you may run out of connection limit.

smcgann99 commented 3 years ago

I have copied but that file didn't exist before ? restarted node red but still only see yellow warning on first click and nothing after that. It doesn't look like the code works after the first path fails, never see the red warning etc... Have to go now but if you find anything post it and I will try it later

Supergiovane commented 3 years ago

Yes it was existing. Maybe you're copying it to the wrong place?

Supergiovane commented 3 years ago

You should see all these files it the directory:

nodes
smcgann99 commented 3 years ago

knxUltimate-config.js was not in the directory and it is not in your screen shot above, hence I thought you sent the wrong file ?

Supergiovane commented 3 years ago

Holy crap!! Sorry! THIS is the right file!! SORRY!!!! Hikvision-config.js.zip

smcgann99 commented 3 years ago

as above - restarted node red but still only see yellow warning on first click and nothing after that. It doesn't look like the code works after the first path fails, as I never see the red warning etc... Have to go now but if you find anything post it and I will try it later

Supergiovane commented 3 years ago

Hi SMC wellcome back. There was a stupid syntax error during a URL check. Please unzip these files and retry. Now it should be OK

Archivio.zip

smcgann99 commented 3 years ago

For analog camera I got yellow warning followed by the picture, so it did use 2nd url OK. As a test I set analog to an unused channel, which did then show the red warning on node status. with IP cam I do not get a picture or any status message, there is no output from picture node on either output.

Supergiovane commented 3 years ago

Use two different nodes, one for each type of cam. After finding the right url, it is be retained by the node, so when you switch to a cam using the other url, it doesn’t work anymore. Or restart nodered to reset the retained url.

smcgann99 commented 3 years ago

yes, I have 2 nodes setup, also deleted and re-added them but do not get anything from ip cameras

smcgann99 commented 3 years ago

I just noticed that ALL the picture nodes status is showing “picture received” every time I get an alarm on my dvr, the output is just undefined.

Supergiovane commented 3 years ago

I just noticed that ALL the picture nodes status is showing “picture received” every time I get an alarm on my dvr, the output is just undefined.

Does this happens prior to these new changes in the nodes?

smcgann99 commented 3 years ago

not sure didn't notice