IpCamera: New IP Camera Binding

Can you tell us what version you have?

I don’t have this problem :slight_smile:

Noop, but the workaround is refresh the image every second (or every two seconds). Is what I do :slight_smile: and it works fine.

Best Regards,
Fernando Gomes

Ok, I think in onvif profile, username and password are ignored. Can you confirm? I change the login name, from admin to newlogin:

[ IPADDRESS=“192.168.1.54”, ONVIF_PORT=“8899”, USERNAME=“newlogin”, PASSWORD=“test123”, ONVIF_MEDIA_PROFILE=0, IMAGE_UPDATE_EVENTS=1]

and in the log still see:

2018-07-13 15:22:48.449 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - a non valid url was given to the binding http://192.168.1.54/webcapture.jpg?command=snap&channel=1&user=admin&password=yNErdtH0 - {}

If I put the SNAPSHOT_URL_OVERIDE with the

http://192.168.1.54/webcapture.jpg?command=snap&channel=1&user=newlogin&password=test123

It works. With this information, you can help?

Best Regards,
Fernando Gomes

Ok… I send this info to the camera:

I receive the info:

I will investigate more.

Regards,
Fernando Gomes

My guess is your camera creates a random password for when handing out the link via onvif. This is probably not an issue, what appears to be the cause of the error is a space in the URL at the end. This is why I print a dash in the logs to show where a string ends. Enter in a snapshot manually to over ride just be sure to test the link in a browser to make sure it works as the random password may expire.

When I question onvif port, I can do it without provide any user/password, then you don’t have to force the user and password that I put in the configuration?

Best Regards,

Sorry I am not sure I know what you are asking or if are having an issue?
Yes the binding should allow you to have no user/pass with onvif, however I do not test this very often and hence there could be bugs. If your camera does not have PTZ or you dont care about that feature you can deliberately put the ONVIF port to the wrong number and provide a snapshot over ride and the camera is then much faster to connect as it will skip the ONVIF.

Lastly in a few replies recently people have smart quotes showing, these are tiny 6 and 9 looking quotes and they cause issues with Openhab if you paste them into config files. Please use code fences as it saves new comers issues if they try to cut and paste things from the forum, here is how:

Just wanted to say thank you! and kudo’s to you on this binding!

I got it running quickly with this setup:

Synology DSM 6.x running OH2.3 querying against HIKVision Model DS-7208HUI-K2

Used PaperUI to setup the 8 camera’s:

Items:

//
// IP Camera
// IpCamera: New IP Camera Binding
// https://github.com/Skinah/IpCamera
// http://www.pcmus.com/openhab/IpCameraBinding/
//

Group IPCams

Image HIKFrontDoorImage “Snapshot” (IPCams) {channel=“ipcamera:HIKVISION:0aec0491:image”}
Image HIKBackDoorImage “Snapshot” (IPCams) {channel=“ipcamera:HIKVISION:a557659d:image”}
Image HIKDriveWayImage “Snapshot” (IPCams) {channel=“ipcamera:HIKVISION:0cd031fd:image”}
Image HIKBasementImage “Snapshot” (IPCams) {channel=“ipcamera:HIKVISION:6cf7c3eb:image”}
Image HIKGarageImage “Snapshot” (IPCams) {channel=“ipcamera:HIKVISION:ce2754fc:image”}

Using HabPanel to display the camera’s:

Thanks, Jay

When I start adding cameras, even just one, Openhabian starts freaking out. Everything grinds to a halt and the logs shows repeated java heap space errors. This is repeatable. And persisted even after totally re-imaging the SD card.

Suggestions?

Is there anything specific I have to do to get motion detect to work with foscam or amcrest cameras? According to logs binding connects to camera -

2018-07-14 19:02:38.764 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting that it supports PTZ control with Absolute movement via ONVIF
2018-07-14 19:02:50.672 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ with no errors, now fetching the Video URL for RTSP from the camera.

I also created 2 items - Motion detect on/off and Motion detect switch and linked them to channels. Openhab v 2.3

Here is debug log. Trying to enable/disable motion. If I copy/past url to browser and authenticate then it works.

2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:x.x.x.x, 	URL:/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Enable=true
2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1

@jwiseman
Thanks, I have put the model of your camera in the list that are confirmed to work. How do you find 8 cameras work regarding CPU load and what kind of server? I’m still punching down cables at the moment and building a house on top of many projects :slight_smile: Your habpanel looks great.

@Pedals2Paddles
See the first post of this thread. Follow how to create some TRACE log output and then PM it to me after doing a quick find/replace on your passwords. The log needs to be from BEFORE the oom error so I can see how your camera behaves in the binding, I use this to then step through the code to look for faults. Please also provide what camera you have and some more info on your system so we can start looking at any patterns from people that report this. Lastly it would also be a good idea to remove all bindings except this one and see if it works, then add them back 1 at a time if it does.

@r27

No, just check in the cameras setup if you have changed the port away from what the binding uses. Yes your camera connects to ONVIF which is good, but the API uses a different port number and that may not be matching. Your log output was a little short to see what happens when the first HTTP request is made of the camera. TRACE output gives more info in the logs to DEBUG and to fault find this I would need TRACE level as it includes the replies back from the camera which sometimes give clues.

I had the same problem, so gave up on this until it’s integrated Into the approved binding.
I have found a workaround for now, but it may not apply to you.
I use habpanel on an old Samsung tab, running fully kiosk browser.
I have a little code that sets the current page to my RTSP feed (full screen) whenever motion is detected in one of the zones where I’d like to be able to see what’s happening, or when a button is pressed on the panel, then reverts it after 15 seconds.

So if someone triggers the motion detector at the front door, the panel screen changes to the full screen web cam feed for 15 seconds then back to whatever it was before.

Regarding # Camera’s and CPU Load:

I’m running OH2.3 on a Synology DS716+ unit which has 2 GB of RAM. I have over 400 items and 5 camera’s connected via your IP Binding and another 2 remote camera’s connected via Synology’s Surveillance binding.

The Synology unit runs around 65% RAM and 20% CPU most of the time. I also use it for all my Plex content which is around 1.5 TB. I did order an 8 GB RAM chip for it yesterday for potential growth.

Best, Jay

I didn’t change any ports, everything is default. Here is detailed log

2018-07-14 20:33:27.869 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-07-14 20:33:27.870 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-07-14 20:33:27.875 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to lock
2018-07-14 20:33:27.876 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has lock
2018-07-14 20:33:27.876 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:0 	URL:/cgi-bin/snapshot.cgi?channel=0
2018-07-14 20:33:27.877 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to unlock
2018-07-14 20:33:27.878 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to lock
2018-07-14 20:33:27.881 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has unlocked
2018-07-14 20:33:27.882 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has lock
2018-07-14 20:33:27.882 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:1 	URL:/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect[0]
2018-07-14 20:33:27.882 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to unlock
2018-07-14 20:33:27.882 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has unlocked
2018-07-14 20:33:27.883 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect[0]
2018-07-14 20:33:27.883 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/snapshot.cgi?channel=0
2018-07-14 20:33:28.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:28.764 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:28.765 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 2 channels tracked (some of these may be closed).
2018-07-14 20:33:28.767 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.767 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to lock in main2
2018-07-14 20:33:28.767 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main2
2018-07-14 20:33:28.768 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked in main2
2018-07-14 20:33:28.768 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:2 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.769 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.769 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:28.769 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:28.771 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 3 channels tracked (some of these may be closed).
2018-07-14 20:33:28.775 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.776 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to lock in main2
2018-07-14 20:33:28.777 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main2
2018-07-14 20:33:28.777 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked in main2
2018-07-14 20:33:28.777 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have  opened  a  brand NEW channel:3 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.793 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.794 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Trying to lock
2018-07-14 20:33:28.794 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: locked
2018-07-14 20:33:28.795 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:2 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.795 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: unlocked
2018-07-14 20:33:28.801 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.802 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.803 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:28.803 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:28.806 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).
2018-07-14 20:33:28.810 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - !!!! Camera has closed the channel 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion Cause reported is: {}
io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@d4402a5(incomplete)
	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:395) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:159) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:246) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:137) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:30) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.sendHttpRequest(IpCameraHandler.java:403) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.processAuth(MyNettyAuthHandler.java:175) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:221) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at java.lang.Thread.run(Thread.java:748) [?:?]
2018-07-14 20:33:28.811 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-07-14 20:33:28.812 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to lock
2018-07-14 20:33:28.814 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.815 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Trying to lock
2018-07-14 20:33:28.815 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: locked
2018-07-14 20:33:28.815 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:3 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.816 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: unlocked
2018-07-14 20:33:28.816 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.817 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.817 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:28.817 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:28.822 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has lock
2018-07-14 20:33:28.823 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:2 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.824 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).
2018-07-14 20:33:28.832 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to unlock
2018-07-14 20:33:28.833 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has unlocked
2018-07-14 20:33:28.833 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:28.833 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - !!!! Camera has closed the channel 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation Cause reported is: {}
io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@44173651(incomplete)
	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:395) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:159) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:246) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:137) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:30) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.handler.IpCameraHandler.sendHttpRequest(IpCameraHandler.java:403) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.processAuth(MyNettyAuthHandler.java:175) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:221) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [248:org.openhab.binding.ipcamera:2.3.0.201807010032]
	at java.lang.Thread.run(Thread.java:748) [?:?]
2018-07-14 20:33:28.834 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
2018-07-14 20:33:28.835 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to lock
2018-07-14 20:33:28.835 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has lock
2018-07-14 20:33:28.835 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - commonCameraHandler closed channel:3 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:28.835 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover trying to unlock
2018-07-14 20:33:28.835 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - handlerremover has unlocked
2018-07-14 20:33:28.836 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Closing CommonCameraHandler. 		URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.764 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:33.764 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:33.770 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).
2018-07-14 20:33:33.779 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.780 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to lock in main2
2018-07-14 20:33:33.780 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main2
2018-07-14 20:33:33.780 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked in main2
2018-07-14 20:33:33.781 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:2 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.784 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.785 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:33.785 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:33.790 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - CommonCameraHandler created.... 4 channels tracked (some of these may be closed).
2018-07-14 20:33:33.802 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - MyNettyAuthHandler is now setup for 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.803 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to lock in main2
2018-07-14 20:33:33.803 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main2
2018-07-14 20:33:33.804 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked in main2
2018-07-14 20:33:33.804 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Have re-opened  the closed channel:3 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.825 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.827 [TRACE] [ipcamera.internal.MyNettyAuthHandler] - 401: Normal for DIGEST authorization. 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.827 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Trying to lock
2018-07-14 20:33:33.828 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: locked
2018-07-14 20:33:33.826 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Trying to lock
2018-07-14 20:33:33.831 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:3 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.831 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: unlocked
2018-07-14 20:33:33.831 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: locked
2018-07-14 20:33:33.832 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: Mark as closing, the  channel:2 	GET:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.832 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: unlocked
2018-07-14 20:33:33.832 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.834 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Resending using a fresh DIGEST 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.833 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:33.836 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AudioMutation
2018-07-14 20:33:33.837 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:33.837 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:33.838 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:33.839 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
2018-07-14 20:33:38.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:xxxxx, 	URL:/cgi-bin/eventManager.cgi?action=getEventIndexes&code=VideoMotion
2018-07-14 20:33:38.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:33:38.763 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1

But I gave up, and used custom script to get camera motion state.

I just try to play with this today. I got a Foscam FI8918W. But it´s given me some problems.

This is from the log:

2018-07-17 22:24:26.332 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:10.4.28.244:80

2018-07-17 22:24:26.422 [ERROR] [l.internal.messaging.saaj.client.p2p] - SAAJ0008: Bad Response; Not Found

2018-07-17 22:24:26.427 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - SOAP error when trying to connect with ONVIF. This may indicate your camera does not fully support ONVIF, check for an updated firmware for your camera. Will try and connect with HTTP. Camera at IP:10.4.28.244, fault was com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (404Not Found

2018-07-17 22:24:26.432 [ERROR] [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.

I have no idea why or even if this ipcam is suitable.

This is my things file:

Thing ipcamera:FOSCAM:001 [ IPADDRESS="10.4.28.244", PASSWORD="xxxxxx", USERNAME="admin", ONVIF_PORT=80, PORT=80]

It has the latest avilable firmware.

Remove the port info from your things file, the binding knows the default ports for fiscal unless u changed the port. Another way to check the onvif port is with a program called onvif device manager.

Hmm… If I remove the port info, I get another error:

2018-07-17 23:22:20.601 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'ipcamera.things'

2018-07-17 23:22:20.613 [WARN ] [ore.common.registry.AbstractRegistry] - Could not remove element: null

java.lang.NullPointerException: null

	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.preserveDynamicState(ThingRegistryImpl.java:177) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.onRemoveElement(ThingRegistryImpl.java:158) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.onRemoveElement(ThingRegistryImpl.java:1) ~[?:?]

	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.removed(AbstractRegistry.java:174) ~[?:?]

	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.removed(AbstractRegistry.java:1) ~[?:?]

	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:59) ~[?:?]

	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:74) ~[?:?]

	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutRemovedElement(AbstractProvider.java:82) ~[?:?]

	at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.lambda$20(GenericThingProvider.java:773) ~[?:?]

	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]

	at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:775) ~[?:?]

	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:301) ~[?:?]

	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:139) ~[?:?]

	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:227) ~[?:?]

	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:291) ~[?:?]

	at org.eclipse.smarthome.core.service.WatchQueueReader.lambda$3(WatchQueueReader.java:323) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

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

2018-07-17 23:22:20.677 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:10.4.28.244:888

2018-07-17 23:22:20.681 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can not connect with ONVIF to the camera at 10.4.28.244, check the ONVIF_PORT is correct. Fault was java.net.ConnectException: Host not available.

2018-07-17 23:22:20.683 [ERROR] [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.

==> /var/log/openhab2/events.log <==

2018-07-17 23:22:20.688 [me.event.ThingUpdatedEvent] - Thing 'ipcamera:FOSCAM:001' has been updated.

This is my things file:

Thing ipcamera:FOSCAM:001 [ IPADDRESS="10.4.28.244", PASSWORD="xxxxxxxx", USERNAME="admin" ]

I have not changed any ports.

onvif device manager doesn´t find anything either.
Note, this is an older Foscam, it´s NOT HD resolution.

If Onvif DM does not find it then either it is disabled in the cameras control panel, or the camera is not ONVIF.
The older non HD cameras have a different API which this binding does not have implemented. This means you will need to setup as a HTTPONLY device and provide a snapshot url and port after testing the URL first in a browser. Google helps to find a working snapshot url for your model.

There is nothing regarding onvif in the controle panel. I have search Google as well, and nothing. So I guess it´s not onvif. It is a pretty old Foscam. I just had it laying around, so I had to test it :slight_smile:

Guess I would have to google for this httponly device setup, or simply just skip this old cam and buy a new one. Thanks anyway.

New build 18-07-2018 has these changes:

  • Bug fixes for all cameras that were only in the 11-07-2018 build, plus some changes to hopefully make the binding faster.
  • HIKVISION now has a new channel for external alarm inputs which most of their models do not have this. @Kristo Let me know if it works.

@Pedals2Paddles
I was finally able to reproduce the OOM error. I dropped my camera to update every 1000ms and it occured, put it back to 2000ms and it went away with a reboot. This does not happen on my fast test setup, only on my Raspberry PI2 server. Post back if changing to a slower refresh fixes it for you and also what hardware your openhab is running on.