IpCamera: New IP Camera Binding

Thanks , Im not using an NVR. Just direct into the switch and into Blue Iris. We will get working on your binding in the coming weeks and report back our findings. good work!

Sure @matt1, ill try it and will let you know
thanks :slight_smile:

Build 09-06-2018 has these changes:

  • HIKVISION has new alarm channels.
  • AMCREST more support for NVRs added.
  • Better formatting in the logs for easier reading.

Build 08-06-2018 had following changes:

  • Build is only marked as untested as I have not run the new backend changes for a few days on my server.
  • HIKVISION, DAHUA and AMCREST now should fetch snapshots from behind a NVR. Other features may not work, need feedback on what does and does not work behind a NVR to update the feature set.
  • Fixed a bug that stopped generic ONVIF cameras working.

The picture works when connecting to the cameras via the NVR Hik 76xx :+1:
Event does not work when triggered
NVR does not send to stream /ISAPI/Event/notification/alertStream trigger events :frowning:

stream It works !!!

It is necessary in the notification settings to put a tick next to “Notify Surveillance Center” and then alerts will appear in the stream. :+1:

in stream:

<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>172.18.2.15</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>4c:bd:8f:a8:60:7a</macAddress>
<dynChannelID>3</dynChannelID>
<dateTime>2018-06-10T15:03:48+03:00</dateTime>
<activePostCount>5</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
</EventNotificationAlert>
--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 462
<dynChannelID>3</dynChannelID> is a channel number NVR

New Build 11-06-2018 has these changes:

  • HIKVISION: Many improvements to the alertStream. “Fixed” version now moves alarms independently to allow multiple line crossings to be seen.
  • All brands: Improvements to the backend and better logging format, removed all raw messages from being displayed in the log unless you enable trace level.

@toroid
Fixes for your NVR are in this build.

Getting this errors on this build Device FOSCAM C2

2018-06-11 15:18:49.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:18:59.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:09.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:19.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:29.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:39.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:49.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:19:59.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:20:09.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:20:19.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:20:29.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.
2018-06-11 15:20:39.943 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!!! There are now more than 10 channels being tracked, Cleaning out closed channels now.

Thanks for reporting. Does the camera still function or does the picture stop, any other symptoms?

I need a more detailed log output to take a look at fixing this.

To change the log level:
1.Start the Karaf console https://docs.openhab.org/administration/console.html
2.Enter in

log:set TRACE org.openhab.binding.ipcamera 

I will need the log from when the camera connects up to the 2 or 3 time the warning occurs. Then do a find and replace to remove your password. Lastly PM this to me in case it has any info in it that is best kept out of public.

Then once done you can put the log back to INFO level to reduce the output.

@matt1 Thanks for the improvement.

Now, through NVR motion alarm works. :+1:

New build 12-06-2018 has these changes:

  • Bug fixes for cameras that do not specify “Connection : close” in the headers. @Melkor this should fix your issues, if not I need a longer capture of the logs. I found some issues thanks to the log output you sent, thanks.

@toroid Great news it is working behind NVR as I do not have one to try. I will start looking at enable/disable the motion alarm soon as this is probably the last thing to do to tidy up HIKVISION.

camera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:01.618 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:01.636 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:01.679 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:01.690 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:01.766 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90546

Date: Tue, 12 Jun 2018 15:31:59 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:01.770 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:01.776 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:01.852 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:02.039 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:02.052 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:02.055 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:02.085 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:31:59 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:02.091 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:02.095 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:02.129 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:02.166 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:02.169 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:28:11.588 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:11.600 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.620 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.639 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.652 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.690 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.708 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.745 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90458

Date: Tue, 12 Jun 2018 15:32:09 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:11.750 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.889 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:11.905 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.908 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:11.948 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:09 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:11.952 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.956 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:11.967 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:11.985 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:11.988 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:21.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:28:21.588 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:21.595 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:21.616 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:21.641 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:21.646 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:21.680 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:21.708 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:21.716 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90731

Date: Tue, 12 Jun 2018 15:32:19 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:21.730 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:21.881 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:21.894 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:21.901 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:22.063 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:19 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:22.067 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:22.094 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:22.108 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:22.273 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:22.373 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:31.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:28:31.588 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:31.594 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:31.613 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:31.654 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:31.661 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:31.687 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:31.710 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:31.756 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90727

Date: Tue, 12 Jun 2018 15:32:29 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:31.766 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:31.976 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:29 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:31.980 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:31.989 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:31.996 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:32.033 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:32.036 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:32.050 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:32.090 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:32.094 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:41.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:28:41.587 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:41.594 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:41.615 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:41.645 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:41.663 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:41.690 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:41.726 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:41.962 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90527

Date: Tue, 12 Jun 2018 15:32:39 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:41.971 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:42.107 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:42.122 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:42.128 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:42.147 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:40 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:42.150 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:42.154 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:42.165 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:42.176 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:42.183 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:28:51.587 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:28:51.592 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.607 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.620 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.625 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.659 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.681 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.714 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90651

Date: Tue, 12 Jun 2018 15:32:49 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:51.717 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.867 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:51.898 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.899 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:49 GMT

Server: lighttpd/1.4.48

2018-06-12 17:28:51.911 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:28:51.913 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.919 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:28:51.948 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:28:51.960 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:28:51.965 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.583 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:29:01.588 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:29:01.593 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:01.608 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:01.622 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:01.652 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.670 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.692 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90630

Date: Tue, 12 Jun 2018 15:32:59 GMT

Server: lighttpd/1.4.48

2018-06-12 17:29:01.704 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.778 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:01.897 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:32:59 GMT

Server: lighttpd/1.4.48

2018-06-12 17:29:01.909 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.913 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:29:01.932 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:29:01.956 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:01.959 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:02.028 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:29:02.068 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:02.074 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.593 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:29:11.596 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:29:11.599 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.611 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.625 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.628 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:11.647 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:11.663 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand NEW channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:11.717 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-type: image/jpeg

Content-Length: 90655

Date: Tue, 12 Jun 2018 15:33:09 GMT

Server: lighttpd/1.4.48

2018-06-12 17:29:11.724 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.858 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:29:11.870 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.874 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 29 more left. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:11.889 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

HTTP/1.1 200 OK

Content-Type: text/plain

Transfer-Encoding: chunked

Date: Tue, 12 Jun 2018 15:33:09 GMT

Server: lighttpd/1.4.48

2018-06-12 17:29:11.896 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel marked as closing, channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:11.902 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>

0

0

1

1

0

0

0k

0k

0

0

0

1

Morry_House2G

0

1

</CGI_Result>

:

2018-06-12 17:29:11.922 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Binding will now close the channel as keep-alive was not found in the headers.

2018-06-12 17:29:11.936 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:11.940 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ---- Closing Handler, 28 more left. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:21.584 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! There are 28 Handlers open, that are using 2 channels, cleaning out channels now to try and reduce this to below 10.

2018-06-12 17:29:21.586 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Channel 0 is for URL:closed

2018-06-12 17:29:21.589 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:21.606 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 29 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:21.619 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have opened a brand new channel:0 URL:/cgi-bin/CGIProxy.fcgi?usr=XXX&pwd=XXX&cmd=snapPicture2

2018-06-12 17:29:21.625 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:192.168.1.51 the URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

2018-06-12 17:29:21.647 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ++++ Handler 30 created. 1 channels. URL:/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXX&pwd=XXX

@matt1 ĐĄan for cameras that do not support absolute PTZ do go to preset?
Why the binding on my camera as he supports absolute PTZ. :frowning:

New Build 13-06-2018:

  • Bug fixes

@toroid
No I doubt they support “go to preset” if they don’t support PTZ absolute move. They would use the same code and extend it so if one is missing the other will be too. You can always test with “onvif device manager” software.

@matt1 In onvif device manager I have PTZ camera control, I also have an image via onvif.
And in binding writes that ONVIF failed, PTZ may not work.
In logs which I sent you for some reason too writes that " Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF"

@Melkor

What symptoms do you see? what does not work, or does everything work and it is just the log? as this may give me clues where to look.

I took a look at your logs and it appears everything is working fine as the Handler number is not increasing over the time frame your logs show. My guess is the fault occurred when the camera was connecting, can you provide some TRACE level log output when you see the handler number grow from 1 and is increasing please? The foscam cameras only support 4 connections and this may result from the binding having more than this when openhab calls the REFRESH on all the channels when the camera comes online. Try with the latest build and reboot your server and camera to reset things. Your camera was showing strange output where the <> characters were missing around the XML output. If this continues I may need to implement some kind of connection limiter to keep it under 4 at all times with foscam, the output you show has only 2 connections/channels in use.

@toroid
If you can send debug output when you move a PTZ control I can take a look. If you don’t move a control and capture what happens I can not do much as all my tests are showing it works even when a camera replies with null.

@matt1 Yes, camera binding is working well, it’s only in the logs. But I am in a period of time i am trying to reduce the logging as much as possible for the sd related wear out. This logging starts a while after i restart the server. ANd once in a while the number increase by one. I looked at the incrasing moment and channel one was not closed. The strange log was my fault as I tried to apply fences twice. I will try to catch the moment in which the channel number are increasing. If it is somehow usefull the last build without this logging was the one of 8 june

Today I checked the work of PTZ on NVR in onvif device manager.
PTZ works. The screen shot below.

When you change pan, tilt and zoom in things in the logs do not see any action on the part of binding on these commands.

Detailed log sent to e-mail

@Melkor Yes the date is useful as that is around the same time I stopped having issues with mine doing the opposite going into negative values :slight_smile: I suspect this is simply due to two threads trying to increment or decrease the same variable at the same time. It can not cause issues as the channels are now tracked and cleaned up, on top of that I also added an idle detector that catches any idle or forgotten channels and cleans them up. Also the foscam would not be working if >4 channels were open at the same time so its proof there is no issues. Next build should not complain or track it anymore.

@toroid
Your camera only supports CONTINUOUS MOVE and the binding only does ABSOLUTE MOVE. The binding is working fine and it tells you in the log that your camera does not support absolute move so there is no bug. I will change the text that causes confusion


There are 3 types of movement and my Amcrest does all three types. See a picture of what my settings in the bottom right looks like. A user of the binding earlier mentioned they may look at adding support for the continuous move.

Can you test if the presets work for you? Presets would be easier to implement and solves many issues that stem from slow/bad/lag network connections. There is another way to implement continuous in a sudo relative move way that could also work but it may not be as useful as just presets.

AbsoluteMove

@matt1 by the way since this morning there were no more logs with the latest build. Thanks!

@matt1 You are right, the NVR camera does not support absolute movement.
If you connect directly to the camera, the item with absolute movement appears.
Now I’ll set up binding to connect to the camera directly and check the PTZ.

The preset list is available only when you connect the camera directly. If through NVR it too is not present.