Continuing the discussion from IpCamera: New IP Camera Binding:
Almost there, i enabled Hikvision-CGI and ONVIF on the camere (NOT on the NVR) and set authentications to digest/basic. Still some issues (TRACE log):
2019-05-01 17:10:35.915 [hingStatusInfoChangedEvent] - 'ipcamera:HIKVISION:ServerrroomFront' changed from UNINITIALIZED to INITIALIZING
==> /var/log/openhab2/openhab.log <==
2019-05-01 17:10:36.915 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.41:65001
2019-05-01 17:10:37.698 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profiles this camera supports.
2019-05-01 17:10:38.356 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Checking the selected Media Profile is a valid number.
2019-05-01 17:10:38.357 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching a Token for the selected Media Profile.
2019-05-01 17:10:38.357 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to fetch some information about the Media Profiles from the camera
2019-05-01 17:10:38.357 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - *********** Media Profile 0 details reported by camera at IP:192.168.0.41 ***********
2019-05-01 17:10:38.358 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the bindings settings.
2019-05-01 17:10:38.358 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Following NPE occured when trying to connect to the camera with ONVIF.java.lang.NullPointerException
2019-05-01 17:10:38.358 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Since an NPE occured when asking the camera about PTZ, the PTZ controls will not work. If the camera does not come online, give the camera the wrong ONVIF port number so it can bypass using ONVIF and still come online.
2019-05-01 17:10:38.358 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.0.41:65001/Streaming/channels/101/picture
2019-05-01 17:10:38.367 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for GET:/Streaming/channels/101/picture
2019-05-01 17:10:38.367 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:0 GET:/Streaming/channels/101/picture
2019-05-01 17:10:38.367 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - request to camera is :DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 0, cap: 0))
GET /Streaming/channels/101/picture HTTP/1.1
host: 192.168.0.41
connection: keep-alive
2019-05-01 17:10:38.370 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.0.41:65001 is now online.
==> /var/log/openhab2/events.log <==
2019-05-01 17:10:38.370 [hingStatusInfoChangedEvent] - 'ipcamera:HIKVISION:ServerrroomFront' changed from INITIALIZING to ONLINE
==> /var/log/openhab2/openhab.log <==
2019-05-01 17:10:38.371 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark to re-use, the channel:0 GET:/Streaming/channels/101/picture
2019-05-01 17:10:38.372 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Setting up the camera to use Basic Auth and resending last request with correct auth.
2019-05-01 17:10:38.373 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Stream Server is serving on IP:192.168.0.40
2019-05-01 17:10:38.373 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Setting up the BASIC auth now, this should only happen once.
2019-05-01 17:10:38.374 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.0.41:65001/Streaming/channels/101/picture
2019-05-01 17:10:38.375 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Using the already open channel:0 GET:/Streaming/channels/101/picture
2019-05-01 17:10:38.375 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for GET:/Streaming/channels/101/picture
2019-05-01 17:10:38.376 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
Date: Wed, 01 May 2019 17:09:23 GMT
Server: App-webs/
Content-Length: 277
Content-Type: text/html
Connection: keep-alive
Keep-Alive: timeout=10, max=99
WWW-Authenticate: Digest qop="auth", realm="IP Camera(C1121)", nonce="4d54426d596a59314d544d364e7a51315a6a526b4d6a633d", stale="FALSE"
WWW-Authenticate: Basic realm="IP Camera(C1121)"
2019-05-01 17:10:38.377 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 277, cap: 277/277, unwrapped: PooledUnsafeDirectByteBuf(ridx: 650, widx: 650, cap: 1024)), decoderResult: success)
2019-05-01 17:10:38.378 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera GET: http://192.168.0.41:65001/ISAPI/System/Video/inputs/channels/101/motionDetection
2019-05-01 17:10:38.378 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error: Your client does not have permission to get URL /Streaming/channels/101/picture from this server.</p>
</body>
</html>
:
2019-05-01 17:10:38.398 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for GET:/ISAPI/System/Video/inputs/channels/101/motionDetection
2019-05-01 17:10:38.399 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 GET:/ISAPI/System/Video/inputs/channels/101/motionDetection
2019-05-01 17:10:38.399 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - request to camera is :DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 0, cap: 0))
GET /ISAPI/System/Video/inputs/channels/101/motionDetection HTTP/1.1
host: 192.168.0.41
connection: keep-alive
authorization: Basic YWRtaW46MDFZTzA3REEwNWh2
2019-05-01 17:10:38.399 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera stream server has started on port:65001.
2019-05-01 17:10:38.404 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Date: Wed, 01 May 2019 17:09:23 GMT
Server: App-webs/
Content-Length: 804
Connection: keep-alive
Keep-Alive: timeout=10, max=99
Content-Type: application/xml
2019-05-01 17:10:38.405 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 804, cap: 804/804, unwrapped: PooledUnsafeDirectByteBuf(ridx: 987, widx: 987, cap: 1024)), decoderResult: success)
2019-05-01 17:10:38.405 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<enabled>true</enabled>
<enableHighlight>true</enableHighlight>
<samplingInterval>2</samplingInterval>
<startTriggerTime>500</startTriggerTime>
<endTriggerTime>500</endTriggerTime>
<regionType>grid</regionType>
<Grid>
<rowGranularity>18</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionLayout version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<sensitivityLevel>0</sensitivityLevel>
<layout>
<gridMap>ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</gridMap>
</layout>
</MotionDetectionLayout>
<enableWithMoving>false</enableWithMoving>
</MotionDetection>
:
2019-05-01 17:10:38.406 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Storing new Motion reply <?xml version="1.0" encoding="UTF-8"?>
<MotionDetection version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<enabled>true</enabled>
<enableHighlight>true</enableHighlight>
<samplingInterval>2</samplingInterval>
<startTriggerTime>500</startTriggerTime>
<endTriggerTime>500</endTriggerTime>
<regionType>grid</regionType>
<Grid>
<rowGranularity>18</rowGranularity>
<columnGranularity>22</columnGranularity>
</Grid>
<MotionDetectionLayout version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<sensitivityLevel>0</sensitivityLevel>
<layout>
<gridMap>ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</gridMap>
</layout>
</MotionDetectionLayout>
<enableWithMoving>false</enableWithMoving>
</MotionDetection>
2019-05-01 17:10:38.883 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: image/jpeg; charset="UTF-8"
Connection: close
Content-Length: 291714
2019-05-01 17:10:38.883 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 920, cap: 920/920, unwrapped: PooledUnsafeDirectByteBuf(ridx: 1024, widx: 1024, cap: 1024)), decoderResult: success)
Hope someone can help getting this to work. I can see an image though.,