2018-03-09 09:39:19.868 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.camera.handler.CameraHandler@1250720’: Java heap space
java.lang.OutOfMemoryError: Java heap space
==> /var/log/openhab2/events.log <==
2018-03-09 09:46:07.637 [ome.event.ItemCommandEvent] - Item ‘CamTuin_Image’ received command REFRESH
==> /var/log/openhab2/openhab.log <==
2018-03-09 09:46:13.040 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.camera.handler.CameraHandler@1250720’: Java heap space
Now, I’m trying to use the Camera binding to get an image feed on my sitemap. I probably do not understand yet what is supported and what is not supported but I’m unable to make it work.
I do understand that video URL is not supported yet, but only Snapshot URL. I tried to use the mjpeg feed into snapshot URL field but the Openhab Thing remain always OFFLINE.
What should I do to get the Thing Online? Thanks.
I tried something else without success, so I still need help. I installed Zoneminder. RTSP feed is easy to configure. Zoneminder use ffmpeg to generate a new feed who can be used in an embeded URL link. This link (http://xxx.xxx.x.xx/zm/cgi-bin/nph-zms?mode=jpeg&monitor=1&scale=50&maxfps=15) is working in any browser. I copied it into the binding Snapshot URL field but Thing still offline.
What is the current status of this binding? Is anyone actively coding as I am interested in making a binding with many more features but don’t wish to make huge changes if they are not going to get accepted.
look at the zoneminder binding from @mr_eskildsen - I implemented the zm jpeg/mjpeg feed there. One thing with mjpeg (or any other stream) is that the default settings of the proxy in openhab will kill the feed after 1 minute. You’ll need the patch in this bug report: https://github.com/eclipse/smarthome/issues/4873 to make it work longer than one minute. JPEG images work ok.
Thanks @captndelta and @mr_eskildsen! I didn’t know about your work Martin. Great binding! It will fit perfectly my need… if I succeed to make it work.
I do not want to use an hardware NVR so I’m doing test with zoneminder on an hold PC running Linux. I will buy better hardware later to build an home made NAS based on FreeNas. So, I hope my current problem is not related to the poor hardware performance. So, maybe one of you could help me to figure it out what is my problem:
I didn’t change a lot of thing in the basic zoneminder configuration.
add a new admin user
check both option OPT_USE_API and OPT_TRIGGER to allow binding to make connection.
On the binding itself:
entered IP address of my zoneminder server
credentials of the new admin user I created. (I’m using this user too to reach zoneminder console.)
From the zoneminder console, I see my camera feed. On Openhab side, Things are switching from online to offline to online etc. I have the following error in my log:
2018-04-05 16:05:33.737 [ERROR] [andler.ZoneMinderThingMonitorHandler] - [MONITOR-1]: context='fetchMonitorDaemonStatus' error in call to 'getMonitorData' Exception='name.eskildsen.zoneminder.exception.ZoneMinderAuthenticationException' Message='Unable to authenticate in ZoneMinder'
name.eskildsen.zoneminder.exception.ZoneMinderResponseException: - HttpStatus='401', HttpMessage='Unauthorized', Request='http://192.168.x.xx/zm/api/monitors/1.json', ExceptionMessage='Not Authenticated'
It looks like my credentials are not valid, but I’m using exactly the same to reach console. Same credential is used if I call manually the JPEG feed at this address:
That might be a little tricky to say so… The problem is that the process of determining that isn’t straight forward. So there might be a wrong conclusion in the code.
Since you are using the admin user, I guess that it shouldn’t be missing access rights.Since you can logon to ZoneMinder console it should be fine.
What happens if you logon to ZM console and the afterwards tries to access the api from the browser:
That should return a JSON with data for monitor 1.
If that doesn’t work, the problem would be something in your ZoneMinder setup. If it does work, you should try to disable authentication in ZoneMinder. If you use any special characters in your password, try to change it to a more simple password (off course you should be able to use special characters, but for test purposes).
Thanks @mr_eskildsen, you show me the right direction. Accessing the api from the browser is the fastest way to see if there is access error. You were right, currently I’m just able to make it work without authentication. I will make more test later on my zoneminder configuration.
So for the moment, just some more general questions. I probably miss something in the Openhab documentation but I don’t understand how to handle item related to video and image into sitemap.
2b) If I use a Webview, I get a static image, not a camera feed. However I’m sure the url is good because if I use it directly into a browser, I get the real time camera feed.
I’m not able to use Video in sitemap. Just by the way of hardcoding an URL. Am I right to think this is useless for a real time camera signal?
Finally, if I finish by getting something (static or real time feed) in BasicUi sitemap on my PC, should I get the same result from the IOS OpenHab app? If yes, should I get the same result if the IOS Openhab connection is remote (outside of my network)?
for (1.): I’ve only tried it in the ‘regular’ sitemap files, things were working for me there. You have to use the image item as the ‘item’ in the sitemaps ‘Image’ element (don’t use the url at the same time). There is a setting for images how often they are updated in the settings of the binding.
for (2.a): If you look at the “video” element in https://docs.openhab.org/configuration/sitemaps.html#element-type-video , it says that “item can refer to a String Item whose state is a URL to a video”. Don’t set the URL in that case. You still have to set the encoding (only mjpeg supported). I have not tried that in Webview, it’ll probably not work (unless the ‘item’ there has the same behavior, but can’t find anything documented to that effect)
for (3): see 2a
EDIT (forgot to answer 4.): As long as you can access your openhab site outside of your network, you should also see the video/image feed. Those are proxied thru your openhab server. (the internal URL’s are no longer used)
Strange, but if it doesn’t work from the browser, it won’t work in the binding
Default item=Cam_monitor1 should be fine. The Binding will update the image.
For the moment openHAB doesn’t support a video item type, this means that the binding has no way of returning the video stream. I am not using the video url myself, and it is also considered experimental. I think what you describe is just the way it is right now.
You should get the same stream both in your PC, IOS app internal as well as external. But that is all core openHAB. If things works on your PC, everything should be fine.
Thanks Martin for your time. I now have a better understanding of image/video related to camera.
For everyone, in conclusion, we have two good options to manage camera in sitemap: camera binding and zoneminder binding (from the marketplace). The choice is based following your needs to get NVR functionnalities and/or the feed type your camera provide.
did you have the latest version in a compiled (or so on) .jar file to easy install it with putting this in the addons folder?
Thanks, I’m a totally beginner and have done some things with OH2 on my QNAP and it works, but I want also integrate my cameras.
Thanks a lot and best regards
Look two posts above, there is a link to a newer binding that does a lot more than this one. I tried to contact Thomas with no luck appears he is no longer around, even his email did not work at getting a response.