IpCamera: New IP Camera Binding

Sorry to bother Matt, but I’m a little bit confused
Does the presence of the HIK configuration enabler means I can address my camera with HIKVISION thing type?

Does it also means camera support api access?

For now despite the moving items aka PTZ, gif, fps and mjepeg options seems to be allright with ONVIF thing type

Here my config (also for other SV3C camera owners):
Thing ipcamera:ONVIF:001 “Batu Camera”
[
IPADDRESS=“192.168.1.xx”,
USERNAME=“admin”,
PASSWORD=“xxxxxx”,
ONVIF_PORT=80,
PORT=80,
NVR_CHANNEL=1,
GIF_PREROLL=1,
GIF_POSTROLL=6,
SERVER_PORT=54324,
FFMPEG_OUTPUT=“/etc/openhab2/html/sv3ccamera/”,
FFMPEG_INPUT=“rtsp://192.168.1.xx:554/ISAPI/Streaming/channels/401”,
IP_WHITELIST=“DISABLE”
]

@matt1 Do you know of a way to get hls streams working remotely (ie iOS app and myopenhab.org dashboard),
Seems it doesn’t loop back for the local urls for hls streams

I think you’d need to use a VPN to do that.

Just amazing - every time I think I know enough to say I know a bit about openhab - I learn something new - thanks for the info Im off to implement this now.

Mattew, installed specific SV3C sw and discovered this, that 8091 control port stand for PTZ
Is it perheaps helpfull for managing control movement by the bind?

As @higgers wrote a VPN is probably the best way due to how many http requests are generated. Probably looking at 2 requests per second that can not be delayed or the stream will buffer all the time.
I don’t have much experience but I would recommend setting up “WireGaurd” as that was designed to allow Netflix to be streamed remotely and I believe Netflix is using HLS or DASH and wiregaurd is getting good feedback over OpenVPN due to its improved speed. If you set it up then please let me know what you find. It is free to use as it is not the same as a paid VPN.

I really have no idea. It may be a camera that is made in the Hik factory, but that does not mean the firmware is the same or it even has the API functions in it. You will have to try and see. If you can move the camera with ONVIF device manager software, the binding should move it as well if the onvif is setup correctly.

Yeah it’s not very ‘wife’ friendly, hence trying to move everything to the iOS app. It works over vpn (I’ve got point to point and a paid service setup) but it’s another 4 clicks before she can go in and use the app.

I’m wondering if it will work if I set up a local instance of openhabcloud as I’m assuming it’s the main server not keeping up

Hey,

i have a Reolink RLK4-211WB. Is it possible to get Support for Reolink Cameras? I can get a Picture or a RTSP Stream via URL

@fanavity
Update to the latest firmware first and then supply some TRACE log output. Readme has how to do this.

@delid4ve

Then post in a new thread asking how others do it as I don’t. I believe webview will not work via the myopenhab and I am guessing that if you host your own it still will not which is why reverse proxy and VPN is used by some.

New build 2020-03-01 has these changes:

  • new version of netty library, be sure to clear cache and reboot a few times.
  • Bug fixes
  • hls group view should support different segment sizes.
  • logging changes

Hi @matt1

I’m struggeling a little with the PTZ Pan & Tilt command in your binding. (I’m using the latest binding from 1-3-2020, but this problem has been present in the other versions?

I Have 3 Hikvision PTZ camera all different models (They all support Absolute & Continious move)
I have enabled Onvif and CGI, enabled Basic auth and created a user.

When I try to Pan or Tilt I see this in my log:

Is this a bug in the binding or me doing something wrong:

<env:Reason><env:Text xml:lang="en">A space is referenced in an argument which is not supported by the PTZ Node.</env:Text>

15:10:08.674 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Trying to move with new PTZ Absolute move.
15:10:08.689 [WARN ] [okhttp3.OkHttpClient                 ] - previous digest authentication with same nonce failed, returning null
15:10:08.712 [DEBUG] [hab.binding.ipcamera.onvif.PTZRequest] - We got a ONVIF PTZ ERROR 500:<?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: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:tnshik="http://www.hikvision.com/2011/event/topics" xmlns:hikwsd="http://www.onvifext.com/onvif/ext/ver10/wsdl" xmlns:hikxsd="http://www.onvifext.com/onvif/ext/ver10/schema" xmlns:tas="http://www.onvif.org/ver10/advancedsecurity/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value>
<env:Subcode><env:Value>ter:InvalidArgVal</env:Value>
<env:Subcode><env:Value>ter:SpaceNotSupported</env:Value>
</env:Subcode>
</env:Subcode>
</env:Code>
<env:Reason><env:Text xml:lang="en">A space is referenced in an argument which is not supported by the PTZ Node.</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>

I have searched for this and found this:

Hope you can help here?

I would call it missing support. I wrote the newer ptz functions and asked for people to test it and got no responses. Works great for my camera as is, but yes there are a few areas that still need writing for it to work in all edge cases. Since I don’t own 20 cameras for testing this is going to happen from time to time. Disconnect all your cameras except one of them and reboot, then send me the debug or trace mode log that shows a number of the ONVIF replies (probably 5 replies similar to the 1 you posted) as the camera is connecting, I should be able to use that to determine what is wrong and what to change. PM the log to keep thread cleaner.

If that thread you linked to is accurate it would appear that Hikvision use two spaces, 1 for pan and tilt and another for the zoom and that would not work till more coding is done. My cameras use a single space for all three P T and Z.

I recently upgraded my PTZ cameras to HIK DS-2DF8425IX-AEL, and thought it was about time to test your binding with all it’s features.

It’s obvious that you can’t cover all cameras, I will collect a LOG trace later today :slight_smile:

Best Nanna

Nice camera, I’m jealous :slight_smile:
Took a look and it has dual zoom.
25× optical zoom, 16× digital zoom
That is probably the reason for the error and it poses an issue as to how to present two types of zoom or if the binding should just use the optical, as I don’t see you needing both with 25 times optical that is probably more than enough?

Yes the camera is absolut perfect :slight_smile:

Yes 25x optical is more than enough, I never use the digital zoom.

I have PM you the log.

Hi,
I am interesting for an ipcam but with batteries?What about these models? They will work with this binding?
https://www.yitechnology.com/kami-wirefree
https://reolink.com/de/product/argus-2/

Thanks

The issue with any battery powered camera is it will be cloud based as the cameras can’t run a web server for local control and get any kind of decent life so they upload to a cloud when a PIR detects motion.

If you don’t want to pay for an electrician to install a power point then consider POE based cameras as you can run the cat5 yourself and they supply the data and power down the same cable. Then you can have full local control without needing a cloud.

Choosing a camera look for:

Api and onvif first choice. The company has gone to extra lengths to make the camera work for local control.
Onvif without an api next choice.
RTSP and snapshot URL second last choice
RTSP only cameras last choice

Cloud only cameras I recommend you stay away from them. The cloud can be turned off then your camera is bricked aka dead. Companies get sold and go under.

Hi Mattew, I got this from frontail
Don’t know how relevant it is
Can you take a look at this?

Everything seems to work within my sitemap as I obtain all of the pictures and streams method
Only HLS doesn’t display but I’m still playing with this

2020-03-09 18:12:58.234 [hingStatusInfoChangedEvent] - ‘ipcamera:ONVIF:001’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection Timeout: Check your IP and PORT are correct and the camera can be reached.

2020-03-09 18:07:49.551 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! Camera possibly closed the channel on the binding, cause reported is: {}

java.io.IOException: Connection reset by peer

at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:1.8.0_222]

at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:1.8.0_222]

at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_222]

at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_222]

at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[?:1.8.0_222]

at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[bundleFile:4.1.46.Final]

at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1133) ~[bundleFile:4.1.46.Final]

at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[bundleFile:4.1.46.Final]

at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) [bundleFile:4.1.46.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) [bundleFile:4.1.46.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650) [bundleFile:4.1.46.Final]

at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576) [bundleFile:4.1.46.Final]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [bundleFile:4.1.46.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [bundleFile:4.1.46.Final]

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.46.Final]

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.46.Final]

at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

2020-03-09 18:15:11.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 13 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:12.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 13 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:14.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 13 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:15.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 14 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:16.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 15 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:17.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 16 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:18.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 16 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:19.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 17 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:20.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 18 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:21.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:22.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:23.329 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:24.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:25.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:26.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:27.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:28.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:29.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:29.329 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-03-09 18:15:29.333 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can’t find ch when removing handler URL:http://192.168.1.46:80/cgi-bin/snapshot.cgi?stream=0

2020-03-09 18:15:30.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:31.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:32.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:32.330 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.

2020-03-09 18:15:32.333 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can’t find ch when removing handler URL:http://192.168.1.46:80/cgi-bin/snapshot.cgi?stream=0

2020-03-09 18:15:33.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

2020-03-09 18:15:34.326 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - There are 19 channels being tracked, cleaning out old channels now to try and reduce this to 12 or below.

Yup you have a problem. You should follow the advice in the readme for when u have troubles.

1 Like

Sorry, you’re right
Does this help?

2020-03-10 09:42:15.969 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.1.46:80

2020-03-10 09:42:15.981 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.

2020-03-10 09:42:17.565 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - We sucessfully connected to a ONVIF SERVICE:be.teletask.onvif.models.OnvifServices@2354b

2020-03-10 09:42:17.568 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profiles this camera supports.

2020-03-10 09:42:17.899 [WARN ] [okhttp3.OkHttpClient ] - previous digest authentication with same nonce failed, returning null

2020-03-10 09:42:18.240 [WARN ] [okhttp3.OkHttpClient ] - previous digest authentication with same nonce failed, returning null

2020-03-10 09:42:18.245 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - We got an ONVIF error401:<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://www.w3.org/2003/05/soap-envelope” xmlns:SOAP-ENC=“http://www.w3.org/2003/05/soap-encoding” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:wsa=“http://schemas.xmlsoap.org/ws/2004/08/addressing” xmlns:wsdd=“http://schemas.xmlsoap.org/ws/2005/04/discovery” xmlns:chan=“http://schemas.microsoft.com/ws/2005/02/duplex” xmlns:wsa5=“http://www.w3.org/2005/08/addressing” xmlns:xmime=“http://www.w3.org/2005/05/xmlmime” xmlns:xop=“http://www.w3.org/2004/08/xop/include” xmlns:wsrfbf=“http://docs.oasis-open.org/wsrf/bf-2” xmlns:tt=“http://www.onvif.org/ver10/schema” xmlns:wstop=“http://docs.oasis-open.org/wsn/t-1” xmlns:wsrfr=“http://docs.oasis-open.org/wsrf/r-2” xmlns:tan=“http://www.onvif.org/ver20/analytics/wsdl” xmlns:tdn=“http://www.onvif.org/ver10/network/wsdl” xmlns:tds=“http://www.onvif.org/ver10/device/wsdl” xmlns:tev=“http://www.onvif.org/ver10/events/wsdl” xmlns:wsnt=“http://docs.oasis-open.org/wsn/b-2” xmlns:c14n=“http://www.w3.org/2001/10/xml-exc-c14n#” xmlns:wsu=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd” xmlns:xenc=“http://www.w3.org/2001/04/xmlenc#” xmlns:wsc=“http://schemas.xmlsoap.org/ws/2005/02/sc” xmlns:ds=“http://www.w3.org/2000/09/xmldsig#” xmlns:wsse=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd” xmlns:timg=“http://www.onvif.org/ver20/imaging/wsdl” xmlns:tmd=“http://www.onvif.org/ver10/deviceIO/wsdl” xmlns:tptz=“http://www.onvif.org/ver20/ptz/wsdl” xmlns:trt=“http://www.onvif.org/ver10/media/wsdl” xmlns:ter=“http://www.onvif.org/ver10/error” xmlns:tns1=“http://www.onvif.org/ver10/topics” xmlns:trt2=“http://www.onvif.org/ver20/media/wsdl” xmlns:tr2=“http://www.onvif.org/ver20/media/wsdl” xmlns:ewsd=“http://www.onvifext.com/onvif/ext/ver10/wsdl” xmlns:exsd=“http://www.onvifext.com/onvif/ext/ver10/schema” xmlns:hikwsd=“http://www.onvifext.com/onvif/ext/ver10/wsdl” xmlns:hikxsd=“http://www.onvifext.com/onvif/ext/ver10/schema” xmlns:tnshik=“http://www.hikvision.com/2011/event/topics”>SOAP-ENV:BodySOAP-ENV:FaultSOAP-ENV:CodeSOAP-ENV:ValueSOAP-ENV:Sender</SOAP-ENV:Value>SOAP-ENV:SubcodeSOAP-ENV:Subcode</SOAP-ENV:Subcode></SOAP-ENV:Subcode></SOAP-ENV:Code>SOAP-ENV:Reason<SOAP-ENV:Text xml:lang=“en”>Error 401: HTTP 401 Unauthorized</SOAP-ENV:Text></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>