Adding Reolink API to the IpCamera binding, beta testers needed

Related to beta testing bindings with dependencies I use the method outlined below and in the documentation Bundle Management | openHAB to update from a file. Basic steps are:

  1. Place jar in openhab-sys folder (using SAMBA share) (one “above” addons) really /usr/share/openhab
    file location for update
    1A) Optional: find the installed jar (/var/lib/openhab/tmp/kar/openhab-addons-4.0.0.M2/org/openhab/addons/bundles/org.openhab.binding.ipcamera/4.0.0.M2) and copy it to the same directory (so you can quickly revert back if needed)
  2. Go into the openhab-cli console, find the ipcamera bundle (bundle:list) “259 in my case”
  3. Use bundle:update 259 file:///usr/share/openhab/org.openhab.binding.ipcamera-4.0.0-SNAPSHOT-reolink.jar (for example)

Since it is an update, all the dependencies remain from the originally installed binding
(read documentation for specific concerns, etc)

Of course this will not be needed once the PR is merged into the addons.

Edit: If you have a link to an online jar file, you can save time and steps with the other method in the bundle update documentation. For instance, using the location of the current ipcamera jar (#1056 -contains the multicamera fix, but not the reolink enhancements)
bundle:update 259 https://ci.openhab.org/job/openHAB-Addons/org.openhab.addons.bundles%24org.openhab.binding.ipcamera/ws/target/org.openhab.binding.ipcamera-4.0.0-SNAPSHOT.jar

I didn’t have as much time as I hoped last night. But I couldn’t find the camera via scan.

Matt,

I have a Reolink RLC 410W. I have it up and running with Reolink app and web based app.

OH 3.4.2 IP Camera binding will not find it via scan. And that’s about as far as I got last night do to other distractions.

Will this new binding install/run in 3.4.2?
Just found part of my answer. There are separate 3.4 and 4.0 versions. Are there more than the initial “release” without looking through 93 responses here?

“Uninstall the merged binding”. Which merged binding?
Do I have to restart Karaf after dropping in the JAR and installing the tellstick binding?

Matt - you mention a couple days ago about no merge. If this is, more or less, copy the JAR, install the tellstick binding, I’ll go for it.

You could also try the manual ONVIF option since you now know the IP

I did that. But it said it couldn’t read the default picture location or something snd manually enter it. And didn’t have a clue!

Matt is probably the one to ask because it has been a long time, but I believe it is looking for the snapshot url. That is probably buried somewhere in the device manual. It looks like this;
http://192.168.0.126/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=youruserid&password=yourpswd. Put in your IP, user (admin is default) and pswd. IIRC the wuuPhkmUCeI9WG7C is just random 16 numbers and letters (ok to reuse). The test is that should work in your browser.

EDIT: Read this post IP Camera: No Stream, no motion detection, but warnings in logfile - Add-ons / Bindings - openHAB Community

YES!

That was the message! I’ll give it a try.

Bob,
Thanks. That indeed got it to recognize the “Thing”. Still involved in non-hobby ( grrrr ) stuff so didn’t get MUCH further other than making a mess with items and location links.

I will have another go tonight. And… it APPEARS that there is a 3.4 version of the JAR for the Reolink stuff. Since (I think) I can simply mass copy my 3.4 directory as a backup, I may install the jar and the other binding and see what happens there too. I suspect that some of the API stuff will be a bit better behaved. Then again, Beta…

Matt - after sticking in the JAR and Tellstick, do I need to restart karaf? IF I get a chance I am going to try this tonight.

Is there anybody else who try to use this from files not openhab UI?
I installed this from openhab-cli console but I cannot see reolink when I check UI https://localhost:8443/settings/things/add/ipcamera
And I get error if I try to set it in a things file:
No ThingHandlerFactory found for thing ipcamera:reolink:c1pro

What did I do wrong?

The jfrog link does not include the PR contents, I opened a bug report to get it looked at, you will need to use the jar on my personal server or wait till it is merged I to OH4 which may take a while.

WIndows 10 OH 3.4.2
Reolink 410 and Duo Wifi.

Installed tellstick and downloaded the December JAR for 3.4.2

Reolink shows up as an option now in the Camera binding.

Scan does not find anything

Manually adding a Reolink Camera, putting in the camera IP and USERID/PASSWORD I get Handler_Missing_error Handler Factory not found

Same from the UI with OH 3.4.2, tellstick, and the December 3.4.2 JAR.

Try restarting openhab, if that does not work then I do not know why and you may need to move to openhab 4 if something was changed in the 3.4.2 openhab that broke older jar files.

I restarted (restarted Karaf…)

I can sandbox 3.4.2 and 4.x side-by-side if I want, can’t I? (not at the same time). My only interest right now is proving the concepts (And testing your binding!). Nothing is in production yet.

The last JAR for 3.4.2 I found was December. If there is a newer one, point me to it and I’ll try it. And, if the intent is that this supports 3.x and 4.x, I can grab any logs you want.

Always great to have people willing to test and help out. Do not bother testing and supplying any results for 3.x openHAB, nothing more will happen as all development has moved to 4.x openHAB. You probably can run both with docker and flick between them quickly and easily, but that is not something I know a lot about. The milestone 3 of 4.0 is due out next week and it is probably a good time to start looking at testing and moving to the newer 4.x version of openHAB. Just need to know that it requires a newer Java version so this may cause hurdles when you jump back and forth between them that normally does not exist when changing versions.

How do I “upgrade” to 4.0 keeping as much of my 3.4.2 setup as possible?

That should be pretty easy but best to be placed in its own thread after first reading how others have done it. The process is update Java to the newer version required, then install V4.x. However there are some breaking changes noted that you should read about first and do not attempt it unless you have some spare time to fix issues that arise. By this I mean don’t do it 1 hour before you plan to go to sleep :slight_smile: I would wait the extra week and perhaps 1 more for others to discover/test the next Milestone before taking it on.

I apologize for being late to report as I got sidetracked and now the details might be a little murky. My 4 Reolink cameras are on Rpi4 2GB running OH4M2. I had them running as ONVIF no problem. After the merge of the little fix for multiple streaming I copied your waiting PR for Reolink locally and switched my cameras over to Reolink things. (Should have only done one first :frowning_face:) Anyway streaming snapshots no longer worked. I could stream video, but it was straining Rpi4 cpu. Because it was my main system, I switched things back to ONVIF and all is fine again. Unfortunately 1) I also did not get a trace log and 2) I noticed you posted an updated Reolink later, but did not test that one, so the problem may be fixed. 3) I’m not using any animal detection channel (You will see why I added this observation). What log file I have is this (many times over)

2023-04-27 17:09:23.593 [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.
java.lang.NullPointerException: Cannot read field "dog_cat" because "aiResponse[0].value" is null
	at org.openhab.binding.ipcamera.internal.ReolinkHandler.channelRead(ReolinkHandler.java:123) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[?:?]
	at org.openhab.binding.ipcamera.internal.handler.IpCameraHandler$CommonCameraHandler.channelRead(IpCameraHandler.java:297) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]
	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[?:?]
	at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:182) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]
	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) ~[?:?]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) ~[?:?]
	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[?:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[?:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

There is a fix for that already in the code, you must not have been using the latest code/version.

1 Like