Hi,
Can anyone that has the NVR “DS-7616NI-K2” help me understand how to configure the things for the different cameras/channels. I currently have two HIK vision and one HiLook camera connected to the NVR.
I can add things for the HIK vision cameras directly connected to the cameras, everything works fine.
However, I would prefer to access the cameras via the NVR instead.
If I add three things, all pointing to the NVR and set the option “NVR input channel” to the (camera speficic) numbers per the NVR, I can only access/view each camera “one at a time”. That is, the Item “Snapshot from Camera” will show the stream for the one camera with the Item “Update the Image” set to ON.
(I do not know if what I am trying to describe makes any sense, but somehow I cannot have three concurrent streams (one for each camera) streaming to the Things “Update the Image” item. I get the same stream on all three Things.)
Any feedback on how I should do a correct configuration when adding the cameras via the NVR would be highly appreciated.
I’m trying to get my Dahua camera online without succes.
It says the thing is online but, i can’t get any image.
Where should i begin?
If i check in the camera webinterface i can see that opehanb is connected.
I installes the newest version [ipcamera2019-08-03.zip] with openhab 2.4. My ip camera is turned off when the 3d printer is off, so most times it is offline.
It seems that this is the reason for the logging messaging coming up all the time:
What I think about would it make sense to allow the binding to not to poll the update status of a camera because of cpu activity?
I mean - if the log entry disappears it will still go on polling the status in the background. Right?
From memory it trys after 10 seconds to reconnect and if it fails it then trys once per minute to see if the camera is back online. That’s why u get the message once per minute. Its low on cpu.
Just as a follow up. I found the mistake I made that caused the odd behaviour streaming from the NVR.
The config field “SNAPSHOT_URL_OVERRIDE” had a reference. When deleting that, i.e. leaving the field blank - it works as expected.
I can confirm the binding has this as an import, never complained to me so my guess is 2.4 stable uses this and has it already imported and a newer (you don’t post which clean version you have) build may not use it anymore. You can most likely fix it by dropping the jar file directly into the addons folder. Try version 4.0.0 first and if that works move to 4.4 which is the latest…
Yes if you over ride the url, you need to give it the url that works, be sure to test any urls in a browser of your choice before giving it to the binding. The NVR channel field is used to build up a hard coded url which is not used if you over ride it. Thanks for posting to say it is fixed and it may help someone else.
If I list my bundles I can see that the jars are loaded but the IpCamera bundle is not working:
239 | Installed | 80 | 2.5.0.201908030247 | openHAB Add-ons :: Bundles :: IpCamera Binding
240 | Active | 80 | 4.1.34.Final | Netty/Buffer
241 | Active | 80 | 4.1.34.Final | Netty/Handler
242 | Active | 80 | 4.1.34.Final | Netty/Codec
243 | Active | 80 | 1.4.0 | javax.xml.soap API
244 | Active | 80 | 4.1.34.Final | Netty/Common
245 | Active | 80 | 4.1.34.Final | Netty/Resolver
246 | Active | 80 | 4.1.34.Final | Netty/Transport
247 | Active | 80 | 4.1.34.Final | Netty/Codec/HTTP
249 | Active | 80 | 4.0.0 | Apache Commons Collections
The following message is found in openhab.log:
2019-12-16 14:50:14.168 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.ipcamera-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.ipcamera [239]
Unresolved requirement: Import-Package: org.apache.commons.collections.buffer; version="[3.2.0,4.0.0)"
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]
Thanks for your support, looking forward hearing from you.
Update: I don’t know why but after uninstalling another binding suddenly the ip camera binding got loaded and I have a connection to the camera. I see another jar that got loaded now:
Commons Collections 3.2.1
I am installing 2.5 Stable now to do some testing so I should have a newer version after it passes minimal tests here. My guess is one of the other bindings you installed also uses it and has installed a now outdated version which the ipcamera binding is using. It is possible if I fix this it may conflict with the other binding as the newer bnd system seems to not handle multiple versions of jars like the old system did, but I really know very little on this topic… Should know more shortly and I will try to remove the need for the lib if possible due to mentioned possible issue…
New build just uploaded 2019-12-17 has these changes:
Removed the need for org.apache.commons.collections.buffer to fix the issue people were having on 2.5 Stable.
Updated to use newer Netty 4.1.42 to match the version used by the IO addons mqttembeddedbroker
Removed log output when camera is trying to check if camera that is offline is reachable.
I have not tested it much and the main change was to how snapshots were stored for creating a animated Gif, so check for bugs with this feature as that was the area I rewrote to remove the needed lib.
I have 90% of my server on a clean 2.5 Stable install of Openhab, so once I am fully up and I then look at making some more changes to this binding. So if you don’t need to upgrade, perhaps wait until I make another release.
To upgrade:
Remove all the old netty jar files and drop the new ones to the addons folder. Then clean your tmp and cache and restart to rid the system of the older files that may conflict.
@matt1 The new drop works great for me. My cameras (Instar IN-9008 and IN-8015) are working fine with this software version. Thanks a lot for updating the code.
2019-12-18 09:35:20.850 [WARN ] [io.netty.channel.nio.NioEventLoop ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@b307b62.
I´m still on 2.5 snapsot and the old ipcam-binding-version. Will update to a newer version during the holidays.
And a strange thing: I can view the mjpeg stream provided by the binding inside my sitemap, but after some time (a few minutes) it stops playing (i can see this because the time code in the corner is paused). When i do a browser refresh the video starts again.
But when i open the mjpeg stream from the binding inside VLC, the stream works for hours without any error…
2019-12-18 16:21:55.773 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IpCamera file server for camera 192.168.192.82 has started on port 50002
2019-12-18 16:21:55.799 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - IP Camera at 192.168.192.82 is now online.
2019-12-18 16:22:02.724 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - The alarm stream was not running for camera 192.168.192.82, re-starting it now
2019-12-18 16:23:15.940 [WARN ] [pcamera.internal.StreamServerHandler] - Exception caught from stream server:{}
java.lang.NullPointerException: null
at org.openhab.binding.ipcamera.handler.IpCameraHandler.setupFfmpegFormat(IpCameraHandler.java:1005) ~[?:?]
at org.openhab.binding.ipcamera.internal.StreamServerHandler.channelRead(StreamServerHandler.java:79) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [bundleFile:4.1.42.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [bundleFile:4.1.42.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302) [bundleFile:4.1.42.Final]
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [bundleFile:4.1.42.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [bundleFile:4.1.42.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) [bundleFile:4.1.42.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231]