Haba1234 / ioBroker.onvif

Subscribe to Camera and NVR Events
MIT License
8 stars 10 forks source link

Sannce onvif events #15

Closed JustMe0815 closed 3 years ago

JustMe0815 commented 3 years ago

Hi there,

i was able to add my camera Sannce IPC and it successfully subscribed, Objects are populating but it does not see any events and its not updating the values in the objects.

When using the ONVIF DEVICE MANAGER, i can see lots of events coming in.

Anything i am missing here?

JustMe0815 commented 3 years ago

It looks like that iobroker.onvif is only seeing event coming in when when i have onvif device manager running at the same time.

JustMe0815 commented 3 years ago

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>

UPDATE it must be something with the inital subscription, because as soon as i start ONVIF DEVICE MANAGER iobroker.onvif can see messages coming on.

JustMe0815 commented 3 years ago

added onvif renew and now it works.

agsh commented 3 years ago

@JustMe0815 Sorry for the late reply, maybe I should update the version in the npm? For example to 0.6.3 from the master? Will it fix the problems for iobroker.onvif?

JustMe0815 commented 3 years ago

@Haba1234 yup that would be nice!