IpCamera: New IP Camera Binding

Youre right… Its the same as the binding docs… I wonder how come this isn´t listed in the official openhab doc for sitemaps:

Good day matt, can I add the option to disable channel polling?
I will explain why this is necessary - if you connect the link to the hikvision NVR, it will start reading the input and output channels for each connected camera to the nvr.
This, firstly, creates an additional load on the server, and secondly, NVR inputs and outputs are not always used.

Are you talking about polling the snapshot? If so IMAGE_UPDATE_EVENTS=0 will do that. Otherwise give more information or extract of the logs showing what traffic you are talking about? What URL is being polled?

I am referring to the survey of alarm entrances.

I connected the intercom camera to the nvr and these errors started appearing. because the intercom simply does not have such entrances.

The binding should auto stop polling that if the camera replies the camera does not support alarm IO. Can you tell me what the camera replies when you manually enter that URL into a browser? The log probably has it in there if you have more of it…

There are two other issues that I see from your logs that are marked as warnings. It appears the binding is opening many channels to request the same URL. Does that happen when you don’t have the intercom connected?

Lastly I have heard the hikvision nvr’s have a mode where each camera can be exposed separately on different ports. Does yours have that ability?

Yes, this mode is available, but it is useless for the intercom because it does not have its own web interface. This request does not pass directly to the intercom - apparently ISAPI is not supported by it :frowning:

image

As soon as I disconnect the connection with the intercom camera, everything becomes clear in the logs - that’s the only problem :frowning:

@matt1
Hi,
in my log I have so many TRACE like this:

2020-04-16 12:03:56.484 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 1024, cap: 1024/1024, unwrapped: PooledUnsafeDirectByteBuf(ridx: 1024, widx: 1024, cap: 1024)), decoderResult: success)

2020-04-16 12:03:56.487 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 14904, cap: 16384)), decoderResult: success)

2020-04-16 12:03:56.491 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 6712, cap: 6712/6712, unwrapped: PooledUnsafeDirectByteBuf(ridx: 14904, widx: 14904, cap: 16384)), decoderResult: success)

2020-04-16 12:03:56.497 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 16384, cap: 16384)), decoderResult: success)

2020-04-16 12:03:56.501 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 16384, widx: 16384, cap: 16384)), decoderResult: success)

2020-04-16 12:03:56.505 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 15472, cap: 65536)), decoderResult: success)

2020-04-16 12:03:56.509 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 7280, cap: 7280/7280, unwrapped: PooledUnsafeDirectByteBuf(ridx: 15472, widx: 15472, cap: 65536)), decoderResult: success)

2020-04-16 12:03:56.514 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 27512, cap: 65536)), decoderResult: success)

Is this normal?
every 4-5 ms?

Jad

@Jademic
Yes that is normal and it is the packets of data from a snapshot.

@toroid
I don’t have a NVR nor will I go out and buy one, so your replies need to be helpful to move forward to someone who can not do the tests. I need more information that is based on testing with real results presented in a way that is clear.
What is the result of calling the URL when the intercom is not connected? What does it return when it is connected? What mode is the NVR in? Why cant you use separate ports? remember I do not have one and I am a volunteer that does not get paid to give support and I don’t work for your camera brand so I really know very little about your setup. Does it take longer than 1 second for the reply to come back from the camera when the intercom is connected as it seems weird that the binding has 10 open connections to ask the status of the alarm IO’s.

@matt1
Start over. I have a configured bundle of DS-KV8102 call panel and DS-KH8501-A internal intercom.
This bundle works with each other on the closed hikvision protocol.
The web interface and onvif are not available on them.
At the same time, if the call panel is connected to nvr, I can get video from it.
If I connect your binding to display video from the call panel directly to the panel, then it does not work - there is no connection.
And if I use nvr as a pad between the call bar and the binding, then I start getting video from the call bar camera in openhab.
But at the same time, the binding also begins to poll the IO NVR.

If we poll the nvr URL, then we get in any case what is in the screenshot.
This is polled by the IO of the nvr itself.
image
If we try to make the same request for the call panel , we get a connection error.

The individual ports in the nvr settings are only used to allow you to throw the camera’s from a private nvr subnet.
My call panel and intercom are not connected to a private nvr network and this option is not available for them.

I assume that a large number of connections are due to the fact that my binding connects to 2 cameras and a call panel connected to the nvr. Accordingly, it is three times more likely to poll IO NVR.

I found out that nvr works with the call panel camera only via the rstp protocol.
In my case, it turns out that the nvr receives the stream via rtsp and gives it to the binding via ISAPI.

i try to connect my Relink RLC-410 with this Binding “ONVIF” but i got this error

15:06:29.877 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.1.77:80
15:06:29.890 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.
15:06:29.898 [WARN ] [ding.ipcamera.handler.IpCameraHandler] - We got an ONVIF error404:<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

Reolink uses port 8000 for onvif not 80. If that does not work test and find the port with onvif device manager.

thank you. the Onvif port is 8000.

now i got this warning:

15:17:45.772 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - We sucessfully connected to a ONVIF SERVICE:/onvif/device_service
15:17:45.815 [WARN ] [ding.ipcamera.handler.IpCameraHandler] - We got an ONVIF error400:<?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:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="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:ns1="http://www.onvif.org/ver10/actionengine/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:ns10="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:ns11="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:ns12="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:ns13="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding" xmlns:ns14="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:ns3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding" xmlns:ns4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:ns5="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:ns6="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:ns7="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:ns8="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:ns9="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tls="http://www.onvif.org/ver10/display/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" 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"><SOAP-ENV:Body><SOAP-ENV:Fault SOAP-ENV:encodingStyle="http://www.w3.org/2003/05/soap-encoding"><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value><SOAP-ENV:Subcode><SOAP-ENV:Value>ter:NotAuthorized</SOAP-ENV:Value></SOAP-ENV:Subcode></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en">Sender not Authorized</SOAP-ENV:Text></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

I have a reolink 410 as well. It has not been possible to to connect it to the binding with ONVIF…
Use HTTP insted.

thank you.

what is the different to the Onvif Binding?
which Channels do you use?
i don’t get any image.
do you also change anything in your

“HTTPONLY” Generic IP camera with only HTTP support

Binding?

@matt1
I solved the problem with IO errors.
I just use HTTP ONLY for this nvr channel and specified SNAPSHOT_URL_OVERRIDE.
Now my logs are clear :slight_smile:

Here is only sometimes happens here is such a mistake:

is there any way to eliminate it?

image

None according to the docs… You should read it.

Here is my setup:

Thing ipcamera:HTTPONLY:Reolink "Frontdoor Camera" @ "Cameras"
[
    IPADDRESS="10.4.28.202",
    USERNAME="username",
    PASSWORD="password",
    PORT=80,
    POLL_CAMERA_MS=2000,
    SERVER_PORT=54321,
    IMAGE_UPDATE_EVENTS=1,
    UPDATE_IMAGE=false,
    GIF_PREROLL=1,
    GIF_POSTROLL=5,
    IP_WHITELIST="DISABLE",
//    SNAPSHOT_URL_OVERRIDE="http://10.4.28.202/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=user&password=password",
    FFMPEG_INPUT="rtsp://username:password@10.4.28.202:554//h264Preview_01_main",
    FFMPEG_OUTPUT="/etc/openhab2/html/camera1/",
    FFMPEG_HLS_OUT_ARGUMENTS="-strict -2 -acodec copy -vcodec copy -hls_flags delete_segments -segment_list_flags live -flags -global_header -hls_time 1 -hls_allow_cache 0 -hls_list_size 3"
]

Notice, I could not get the snaptshot_url_override to work. But it doesnt matter for me.

thank you.

can you also change the motion sensitivity, motion alarm, create gif…?

Havnt tried… It has to be done through ffmpeg.
Gif´s are working just fine.

if i switch the button “create an animated gif” ON it switch back to OFF after 2 sec.

do you know why?

I believe this is its purpose…
But I just tried on my Rpi4 with raspbian 2.5.3 running… I cant seem to get it to work now… I know for 100% certain is has worked fine.
(My Rpi4 is my test setup, only running when I test suff).