Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help configuring script #2

Closed
josh4trunks opened this issue Jul 20, 2016 · 15 comments
Closed

Help configuring script #2

josh4trunks opened this issue Jul 20, 2016 · 15 comments

Comments

@josh4trunks
Copy link

Hello, thank you for your work on this program! I am starting this script fine, but it seems to not be receiving PIR events from my Hikvision 2432 camera. I know the camera is triggering its own events as verified by the "Audible Warning", but I'm not sure if the camera is proving the needed XML.
When I curl -s -S -N -u zmuser:zmpass http://192.168.1.45/ISAPI/Event/notification/alertStream I get the following which keeps updating.

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

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.1.45</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>28:58:be:6e:53:0c</macAddress>
<channelID>1</channelID>
<dateTime>2016-07-19T19:24:46--8:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 480

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.1.45</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>28:58:be:6e:53:0c</macAddress>
<channelID>1</channelID>
<dateTime>2016-07-19T19:24:46--8:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
</EventNotificationAlert>

Here are my camera settings.
screenshot from 2016-07-19 19-26-44

Any suggestions?

@josh4trunks
Copy link
Author

Ohh, and just to make sure you get a direct ping @waynieack

@waynieack
Copy link
Owner

The video loss message is the normal message you will get when nothing has
been triggerd on the camera, but when you make movement in front of the
camera for PIR, you should see that change to PIR in the eventtype field of
the xml message. You will see the message change for a short period so you
will need the computer near the camera or a second person.

As for the settings on the camera, all I have on my cameras is the enable
PIR checked and the schedule enabled like you do below. The other settings
didnt matter if they were enabled or disabled.

Are you not seeing the event type message change in the xml stream when the
PIR is triggered?

On Jul 19, 2016 9:27 PM, "Joshua Ruehlig" notifications@github.com wrote:

Hello, thank you for your work on this program! I am starting this script
fine, but it seems to not be receiving PIR events from my Hikvision 2432
camera. I know the camera is triggering its own events as verified by the
"Audible Warning", but I'm not sure if the camera is proving the needed XML.
When I curl -s -S -N -u zmuser:zmpass
http://192.168.1.45/ISAPI/Event/notification/alertStream I get the
following which keeps updating.

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

192.168.1.45 80 HTTP 28:58:be:6e:53:0c 1 2016-07-19T19:24:46--8:00 0 videoloss inactive videoloss alarm --boundary Content-Type: application/xml; charset="UTF-8" Content-Length: 480 192.168.1.45 80 HTTP 28:58:be:6e:53:0c 1 2016-07-19T19:24:46--8:00 0 videoloss inactive videoloss alarm

Here are my camera settings.
[image: screenshot from 2016-07-19 19-26-44]
https://cloud.githubusercontent.com/assets/1018807/16973207/c315ec64-4de6-11e6-8140-2c421c4aba9d.png

Any suggestions?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#2, or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eVIjWGKvIMcwYve_TjJc5Gin6F2vks5qXYeVgaJpZM4JQXLZ
.

@josh4trunks
Copy link
Author

josh4trunks commented Jul 21, 2016

I don't even see the PIR eventType in my xml message. Above is exactly what I see when I use curl to fetch the URL, but repeatedly until I stop the curl command.

Do you think my output is getting cut off in curl and your script at the "--boundary". Gonna experiment with some other programs that pull from hikvision camera's alertStream to verify if they have the same issue.

@waynieack
Copy link
Owner

Yeah, the stream continuously sends the video loss XML until another event
is triggered. My script connects to that exact stream that you are seeing
and waits for a message other than the video loss message. If you aren't
seeing it then the script will not either. Have you tried some of the other
alarm types like motion detection?

It sounds like a bug with the camera, try unchecking all the
Linkage Methods just to see if it helps and/or rebooting the camera.

Maybe try changing the schedule and chaining it back, the schedule is the
only thing (other than the enable check) that I've seen stop the messages
on my cameras.

I have these 2 cameras and they send the events ok, if i do a curl on the
stream i see the XML change when I move in front of the camera.

Model DS-2CD2432F-IW
Firmware Version V5.3.0 build 151016

Model DS-2CD2332-I
Firmware Version V5.2.5 build 141201

On Thu, Jul 21, 2016 at 6:27 PM, Joshua Ruehlig notifications@github.com
wrote:

I don't even see the PIR eventtype in my xml message. Above is exactly
what I see when I use curl to fetch the URL, but repeatedly until I stop
the curl command.

Do you think the output getting cut off. Any reason your script isn't
getting the PIR either from my camera's output?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eQNPkgB4aScE4-0VXo1jZhDIKPTrks5qYABFgaJpZM4JQXLZ
.

@josh4trunks
Copy link
Author

ok, sounds good. I'll try motion detection / and adjusting schedules / rebooting.
I have the 2432 with the 5.2.5 firmware, so I guess I could try updating the firmware to 5.3.0 if none of he above work.
Thanks!

@josh4trunks
Copy link
Author

well the motion and the line detection do show on the stream. But the PIR still does not.
Gonna try 5.3.0, but I can't download it from Hikvision's site yet since I need to register there and their activation email isn't instant.

Know anyplace else I can get the latest firmware?

@josh4trunks
Copy link
Author

Well in the process of trying to upgrade my unit 2432 to v5.3.0 it got bricked.
I should have realized something was fishy, the sticker on the device says 5.3.0 while the web-interface said 5.2.5, so I suspect it was hacked english firmware.

Now gotta get it working again =/

@josh4trunks
Copy link
Author

josh4trunks commented Jul 22, 2016

well got my unit unbricked using this post! now back to the issue at hand.
https://www.ipcamtalk.com/showthread.php/3408-HIKVISION-mtd-Brick-Recovery-Guide?p=113233&viewfull=1#post113233

my unit does not seem to output anything related to PIR to the alertStreaming stream. do you mind posting the output you get when your PIR triggers an event. I'm able to query it at a different URL, but don't get anything from the stream.

@josh4trunks
Copy link
Author

specifically, I was able to connect to the URL listed here..
https://community.openhab.org/t/hikvision-event/8736/3

@waynieack
Copy link
Owner

This is how I have mine configured.

[image: Inline image 1]

On the http stream, I see this when the PIR is triggered.


192.168.195.56
80
HTTP
bc:ad:28:38:92:1f
1
2016-07-22T08:11:44-6:00
5
PIR
active
PIR alarm

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

As for the /IO/outputs/1/status, its not an http stream so it would not
work in the way that I am pulling the events. I make a connection and it
stays open watching for new events, the /IO/outputs/1/status URL would have
to be polled constantly which would be resource intensive to open and close
connections like that.

I tried linking my PIR event to the alarm output, but I don't see the
output pushing events to the HTTP stream when motion is detected. Also I
noticed that when I check the trigger alarm output check box, it no longer
sends the PIR events to the HTTP stream, so apparently some of the linkages
break the HTTP push notifications.

_Wayne

On Fri, Jul 22, 2016 at 3:51 AM, Joshua Ruehlig notifications@github.com
wrote:

specifically, I was able to connect to the URL listed here..
https://community.openhab.org/t/hikvision-event/8736/3


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eaRSb-Hd9oWAmvFmZLkTjfCpkdvVks5qYISlgaJpZM4JQXLZ
.

@josh4trunks
Copy link
Author

josh4trunks commented Jul 22, 2016

Yeah, I realize the IO URL isn't the same. No idea why my thing isn't working =[
For some reason I don't see the image you posted. Also what's the curl command you are using?

I'll check on the ipcamtalk forum, maybe I do need to get to V5.3.0 without bricking it.

@waynieack
Copy link
Owner

curl http://user:password@192.168.1.1/ISAPI/Event/notification/alertStream

If you see the stream, then your curl command is fine. The problem is for
sure with the camera.

On Fri, Jul 22, 2016 at 10:24 AM, Joshua Ruehlig notifications@github.com
wrote:

For some reason I don't see the image you posted. Also what's the curl
command you are using?

I'll check on the ipcamtalk forum, maybe I do need to get to V5.3.0
without bricking it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eVrGavy6egHZJ9LZxUYZdyfaUgvsks5qYODHgaJpZM4JQXLZ
.

@josh4trunks
Copy link
Author

Alright it was an issue with the firmware that was hacked on their. Hacked the camera partitions and put back the 5.3.0 chinese firmware and PIR events are now working. Excited to try out your script

@josh4trunks
Copy link
Author

josh4trunks commented Sep 5, 2016

By the way, the script works great on my FreeBSD system, connected to my Hikvision 2432 with the original Chinese firmware using the PIR sensor =]

This will be even more awesome once Zoneminder has video support, so my server won't need to use CPU converting the video stream to JPEGs or analysing it!

@waynieack
Copy link
Owner

Glad to hear it!

_Wayne

On Mon, Sep 5, 2016 at 12:36 PM, Joshua Ruehlig notifications@github.com
wrote:

By the way, the script works great on my FreeBSD system, connected to my
Hikvision 2432 with the original Chinese firmware using the PIR sensor! =]


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eTP8dJgc1A91Xq-p0jBsuiZId6X8ks5qnFMjgaJpZM4JQXLZ
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants