agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
693 stars 236 forks source link

Events not working #173

Closed JustMe0815 closed 3 years ago

JustMe0815 commented 3 years ago

Hi there,

I am using iobroker.onvif which uses this onvif. The Camera is a Sannce I61BE.

It looks like that it's subscribing okay as I do not get any errors but the camera is not sending any events. When I however start Onvif Device Manage on a windows box it shows the events fine and after 1 or 2 seconds the events are also showing up on here as well, but as soon as I stop Onvif Device Manager, the events also stop on here.

Anything what can be done here?

JustMe0815 commented 3 years ago

HI there, i did some more digging with this, i hope this helps.

FROM IOBROKER.ONVIF:

£ª6¦÷íGEò§è@@AÀ¨dcÀ¨gX8Pê×\¢HOCåQñ
8ûmª`POST /event_service/1 HTTP/1.1
Content-Type: application/soap+xml
Content-Length: 1065
charset: utf-8
Host: 192.168.103.88
Connection: close

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><UsernameToken><Username>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">4tiU6RA/ZFFgvonAtdJzQ9tNDv4=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">f9GabWof1ve2SeVnXckB+Q==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2020-10-29T01:29:00.665Z</Created></UsernameToken></Security><a:To>http://192.168.103.88/event_service/1</a:To></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><PullMessages xmlns="http://www.onvif.org/ver10/events/wsdl"><Timeout>PT9S</Timeout><MessageLimit>10</MessageLimit></PullMessages></s:Body></s:Envelope>

and the Camera reply:

HTTP/1.1 200 OK
Server: hsoap/2.8
Content-Type: application/soap+xml
Content-Length: 1538
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:ter="http://www.onvif.org/ver10/error" ><s:Header><wsa:Action s:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2020-10-29T01:29:01Z</tev:CurrentTime><tev:TerminationTime>2020-10-29T01:30:01Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>

FROM ONVIF DEVICE MANAGER

POST /event_service/1 HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Host: 192.168.103.88
Content-Length: 748
Accept-Encoding: gzip, deflate
Connection: Close

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest</a:Action><a:MessageID>urn:uuid:24e3b8f6-a55d-44a4-bb99-8d7f827ba37c</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://192.168.103.88/event_service/1</a:To></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><PullMessages xmlns="http://www.onvif.org/ver10/events/wsdl"><Timeout>PT1M</Timeout><MessageLimit>1024</MessageLimit></PullMessages></s:Body></s:Envelope>

Camera reply:

HTTP/1.1 200 OK
Server: hsoap/2.8
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 1538
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:ter="http://www.onvif.org/ver10/error" ><s:Header><wsa:Action s:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2020-10-29T01:43:34Z</tev:CurrentTime><tev:TerminationTime>2020-10-29T01:44:34Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
JustMe0815 commented 3 years ago

I got this solved - i used today's git version of this branch and updated iobroker.onvif to use the ONVIF renew part. Works like a charm now.