IpCamera: New IP Camera Binding

camera
ip-cam
onvif
Tags: #<Tag:0x00007f014ba70500> #<Tag:0x00007f014ba702a8> #<Tag:0x00007f014ba70168>

(Skinah) #563

See this… https://github.com/Skinah/IpCamera/issues/22

I use cameras made by both companies and will continue to use them as they have great value for money. Every non camera device I own is calling home regardless of where it was made, that does not mean the traffic is bad. today devices have to check for security patches and also poke holes in your firewall to make apps work seamlessly for normal everyday users.


(Peter) #564

I have just installed the binding, and set it up with a Hikvision camera, API and ONVIF has been enabled in the cam.

I am NOT using the image stream from the binding, but referencing the imageurl and showing that.

Every few seconds I get the following error, does anyone know how to get rid of that?

2018-12-04 11:19:10.757 [WARN ] [netty.channel.DefaultChannelPipeline] - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@1ea4e5f(incomplete)
	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:395) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:159) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:246) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:137) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:30) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.sendHttpRequest(IpCameraHandler.java:398) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.sendHttpGET(IpCameraHandler.java:275) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.motionDetected(IpCameraHandler.java:1193) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.access$40(IpCameraHandler.java:1187) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler$HikvisionHandler.channelRead(IpCameraHandler.java:909) ~[190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler$CommonCameraHandler.channelRead(IpCameraHandler.java:579) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:225) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [190:org.openhab.binding.ipcamera:2.4.0.201811270958]
	at java.lang.Thread.run(Thread.java:748) [?:?]

(Jozef Samijn) #565

Hey @matt1,

I have updated the binding to use the fielddetection alarm. The CHANNEL_ENABLE_FIELD_DETECTION_ALARM is working to turn the detection on and off. The CHANNEL_FIELD_DETECTION_ALARM turns on when there is intrussion detected, but it does not turn off.
Is it possible the the alarm doesn’t pick up when there is no intrussion?
Cheers and thanks for implementing this.
BTW: I am using the binding with Hikvision DS-2CD2142FWD-IWS and DS-2CD2042WD-I
Jef


(Skinah) #566

Do other alarms types function correctly?
Watch what happens in any browser with this address open adjusted for your IP of course:

http://192.167.3.1/ISAPI/Event/notification/alertStream

What happens when no alarms are going off?
Check for a newer firmware for the camera. I’ll take a look after I hear about the above…

@petero

The warning is sometimes not helpful as knowing what the binding was doing just before the first error occurred. Enable trace logging and watch the log after a server restart. It could be from the camera locking you out from using the wrong password too many times?


(Rene Sterz) #567

Thank you for this great binding. I am using it with two Instar cameras (9008 and 8015). After installing the second camera I started to run into the issue that the update of the regular snapshots stop working sometimes. The camera is still available (live stream works and I can call the snapshot URL of the camera) but the snapshot is not updated anymore. Do you have any idea how to fix that issue or analyze it further?


(Skinah) #568

You need to work out if it is my binding or the openhab framework/app at fault. Look at the event.log and you should see the binding updating the image, if this is happening yet it stops displaying then it wont be my binding but possibly a bug in the app or framework. I find the IOS app does not work at all, but the Andriod app does work as does using basic UI in a browser when using my iphone.


(Rene Sterz) #569

Thanks for your hints. I use the Android app and myopenhab.org to access my smart home. I switched off all regular events (running on Raspberry Pi) to reduce data writes to the SD card. I re-activated the event log. Now I am waiting for the snapshot update to fail again. Since yesterday it is working reliably.


(furax54) #570

Hi, With my cam (IPC-HDBW4431R-AS) , Every 20s, I have this warning :slight_smile:
Event detection works fine anyway …
[WARN ] [ding.ipcamera.handler.IpCameraHandler] - The alarm checking stream was not running. Cleaning channels and then going to re-start it now.


(Rene Sterz) #571

I was able to reproduce the error with my Instar IP camera regarding the snapshot updates. I assume that my camera didn’t have a WiFi connection for several minutes resulting in the behavior the I described. In my openhab.log I can find the following lines:
2018-12-10 12:26:43.630 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Can not connect with HTTP to the camera at 192.168.178.13:80 check your network for issues.

These messages appear for about 5 minutes. Thereafter OpenHAB doesn’t try to update the snapshot anymore. The last photo is from 12:25:33.

Is there a maximum retry counter or something similar that I can configure?


(Dave Gurr) #572

Has anyone had any success with the Xiaomi Yi Ants cameras - they’re currently on offer at Amazon down from £50 to £17.99!

Either with native firmware or the “Yi-hack” (https://github.com/fritz-smh/yi-hack)?


(Skinah) #573

No there is no maximum, it should try and reconnect forever and until it successfully re-connects the snapshot will not update. When I have some time in a weeks time I will run some tests as I have not checked this function in a while. In the mean time perhaps check if the camera has a lock out if the password is entered whilst it is still booting up. Also try cleaning out the tmp and cache folders of openhab and reboot the server.

Yes that is currently normal and nothing wrong, I’ll take a look at changing this next time I have the IDE open. I may just move it to DEBUG output.