Thanks @matt1. Just tried the doorbell as a HIKVISION Thing. I am not sure how the binding works regarding authorization, but it looks like authorization fails the first time, but then the binding successfully connects to a ONVIF service. However, then there are a series of 404 errors . Maybe it does not use the HIKVISION API. I believe the events that are available are transmitted via OVNF. You are correct that an rtsp feed is available at the usual location for Hikvision devices, IPADDRESS:554/Streams/Channels/101.
You are correct - for some reason the doorbell press is not sent as an event. However, I know that the PIR events are sent. Someone has put out a Docker container that does ONVIF to MQTT translation. I could run that and then set up MQTT in OH, but that means running another server that can stall/fail.
There seems to be an onvif API library available that does authenticate with the doorbell successfully.
As I understand it, @matt1, you are using an external ONVIF library. Maybe this is the same issue as issue Skinha/IpCamera/#53 that is currently open in your GitHub repo? I completely understand not wanting to put in 160 hours to recreate something that already exists in a library you can download. If I get time, I will raise the issue over at GitHub RootSoft/ONVIF-Java.
Here is the Thing file:
Thing ipcamera:HIKVISION:back1
[
IPADDRESS="192.168.18.30",
USERNAME="admin",
PASSWORD="JEGRAK",
POLL_CAMERA_MS=200000,
SERVER_PORT=54030,
FFMPEG_OUTPUT="/tmpfs/doorbell/"
]
Here is the log.
2020-05-19 12:48:49.190 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'ipcamera.things'
2020-05-19 12:48:50.432 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.18.30:80
2020-05-19 12:48:50.446 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'ipcamera.things'
2020-05-19 12:48:50.531 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.18.30/ISAPI/Streaming/channels/101/picture
2020-05-19 12:48:50.594 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - We sucessfully connected to a ONVIF SERVICE:/onvif/device_service
2020-05-19 12:48:50.629 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - ONVIF error 400:<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tnsn="http://www.eventextension.com/2011/event/topics"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value>
<env:Subcode><env:Value>ter:NotAuthorized</env:Value>
</env:Subcode>
</env:Code>
<env:Reason><env:Text xml:lang="en">The action requested requires authorization and the sender is not authorized</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>
2020-05-19 12:48:50.635 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Possible NIC/IP match found:xxx.xxx.xxx
2020-05-19 12:48:50.635 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Possible NIC/IP match found:xxx.xxx.xxx
2020-05-19 12:48:50.643 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - File server for camera at 192.168.18.30 has started on port 54030 for all NIC's.
2020-05-19 12:48:50.654 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 404 Not Found
Date: Tue, 19 May 2020 17:48:50 GMT
Server: webs/
X-Frame-Options: SAMEORIGIN
Content-Length: 212
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=60, max=99
2020-05-19 12:48:50.658 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 212, cap: 212/212, unwrapped: PooledUnsafeDirectByteBuf(ridx: 421, widx: 421, cap: 1024)), decoderResult: success)
2020-05-19 12:48:50.658 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<!DOCTYPE html>
<html><head><title>Document Error: Not Found</title></head>
<body><h2>Access Error: 404 -- Not Found</h2>
<p>Can't locate document: /ISAPI/Streaming/channels/101/picture</p>
</body>
</html>
:
2020-05-19 12:48:54.646 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.18.30/ISAPI/Streaming/channels/101/picture
2020-05-19 12:48:54.663 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - The alarm stream was not running for camera 192.168.18.30, re-starting it now
2020-05-19 12:48:54.664 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://192.168.18.30/ISAPI/Event/notification/alertStream
2020-05-19 12:48:54.690 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 404 Not Found
Date: Tue, 19 May 2020 17:48:54 GMT
Server: webs/
X-Frame-Options: SAMEORIGIN
Content-Length: 212
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=60, max=99
2020-05-19 12:48:54.691 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 212, cap: 212/212, unwrapped: PooledUnsafeDirectByteBuf(ridx: 421, widx: 421, cap: 1024)), decoderResult: success)
2020-05-19 12:48:54.691 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<!DOCTYPE html>
<html><head><title>Document Error: Not Found</title></head>
<body><h2>Access Error: 404 -- Not Found</h2>
<p>Can't locate document: /ISAPI/Streaming/channels/101/picture</p>
</body>
</html>
:
2020-05-19 12:48:54.692 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 404 Not Found
Date: Tue, 19 May 2020 17:48:54 GMT
Server: webs/
X-Frame-Options: SAMEORIGIN
Content-Length: 212
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=60, max=99
2020-05-19 12:48:54.693 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 212, cap: 212/212, unwrapped: PooledUnsafeDirectByteBuf(ridx: 421, widx: 421, cap: 1024)), decoderResult: success)
2020-05-19 12:48:54.694 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<!DOCTYPE html>
<html><head><title>Document Error: Not Found</title></head>
<body><h2>Access Error: 404 -- Not Found</h2>
<p>Can't locate document: /ISAPI/Event/notification/alertStream</p>
</body>
</html>
:
2020-05-19 12:49:08.665 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ! Channel was found idle for more than 15 seconds so closing it down. !