IpCamera: New IP Camera Binding

I just bought an Axis A8105 for my front door . Would it be possible to use this binding for it in OH?

Yes you can set it up as ONVIF thing type.

1 Like

Hey Matt,

Great work with this binding, especially now with native RTSP streams!
Since it has been a few days since you released this and it seems like the reviews are quite good from the community, at least based on this thread, I’m just wondering when are you planning to release an official (not beta) release of the binding?
I am considering implementing this, but want to move forward with this once it has some run rate and not just a beta version.

Thanks again for your work on this!!!

Every programmer has their own opinion on what BETA means, mine is that I have found as many issues as I can find and now need help from others finding any more. If something is not stable I don’t like to build and let people use it. So far I have not heard any feedback on the HLS streaming features which is usually either none one uses it, or a good sign that no one has an issue with it, hard to know which one just yet. Until I get feedback and fine tune the HLS features to work most of the time on multiple cameras I wont remove the beta tag. I have been using the build for over two weeks without issues on my own live server as a baby monitor where it needs to be reliable and can report it all looks good :slight_smile: However there are many brands of cameras, many different servers and platforms to test on and I can not do this without people helping to test…

As for when it will be pushed to the Openhab project, first the new bundle format needs to be finalised and a test environment created for Eclipse, and I have no control or idea when this will be.

@matt1: it appears my system has some issues after enabling all my camera’s. I saw some crashes and get the following output: java.lang.OutOfMemoryError: Java heap space

When i disable ipcamera things everyting runs smooth again. Currently i only use image every 10 seconds and some motion detection, nothing fancy…

Do you use the android app and leave it open showing the camera? Have you tried increasing the java heap space? Search this thread for more info.

No to both answers. After openhab reboot i get, after half an hour:

2019-05-10 15:49:46.807 [ERROR] [me.core.internal.events.EventHandler] - Creation of ESH-Event failed, because one of the registered event factories has thrown an exception: Error invoking #valueOf(String) on class ‘org.eclipse.smarthome.core.library.types.RawType’ with value 'data:image/jpeg;base64,

java.lang.IllegalStateException: Error invoking #valueOf(String) on class ‘org.eclipse.smarthome.core.library.types.RawType’ with value 'data:image/jpeg;base64,

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:190) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseType(ItemEventFactory.java:158) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.getState(ItemEventFactory.java:136) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.createStateChangedEvent(ItemEventFactory.java:131) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.createEventByType(ItemEventFactory.java:84) ~[?:?]

at org.eclipse.smarthome.core.events.AbstractEventFactory.createEvent(AbstractEventFactory.java:51) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.createESHEvent(EventHandler.java:121) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:95) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:72) ~[?:?]

at org.eclipse.smarthome.core.internal.events.ThreadedEventHandler.lambda$0(ThreadedEventHandler.java:67) ~[?:?]

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

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]

... 10 more

Caused by: java.lang.IllegalArgumentException: Illegal base64 character 5

at java.util.Base64$Decoder.decode0(Base64.java:714) ~[?:?]

at java.util.Base64$Decoder.decode(Base64.java:526) ~[?:?]

at java.util.Base64$Decoder.decode(Base64.java:549) ~[?:?]

at org.eclipse.smarthome.core.library.types.RawType.valueOf(RawType.java:74) ~[?:?]

at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]

I will post more when it happens again (heap space)

See this post on how to increase heap space.

Tnx, was 360mb, i extended to 512mb.

Lets see…

@matt1 i still get some random errors like this:

019-05-11 16:33:38.970 [ERROR] [me.core.internal.events.EventHandler] - Creation of ESH-Event failed, because one of the registered event factories has thrown an exception: Error invoking #valueOf(String) on class ‘org.eclipse.smarthome.core.library.types.RawType’ with value 'data:image/jpeg;base64,/9j

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:190) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseType(ItemEventFactory.java:158) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.getState(ItemEventFactory.java:136) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.createStateChangedEvent(ItemEventFactory.java:131) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.createEventByType(ItemEventFactory.java:84) ~[?:?]

at org.eclipse.smarthome.core.events.AbstractEventFactory.createEvent(AbstractEventFactory.java:51) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.createESHEvent(EventHandler.java:121) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:95) ~[?:?]

at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:72) ~[?:?]

at org.eclipse.smarthome.core.internal.events.ThreadedEventHandler.lambda$0(ThreadedEventHandler.java:67) ~[?:?]

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

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]

... 10 more

Caused by: java.lang.IllegalArgumentException: Illegal base64 character 29

at java.util.Base64$Decoder.decode0(Base64.java:714) ~[?:?]

at java.util.Base64$Decoder.decode(Base64.java:526) ~[?:?]

at java.util.Base64$Decoder.decode(Base64.java:549) ~[?:?]

at org.eclipse.smarthome.core.library.types.RawType.valueOf(RawType.java:74) ~[?:?]

at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]

... 10 more

I also outputs the raw image content i think, i removed this for reading purposes.

How often does it occur? Do things keep working after it happens? This is not something I have ever seen and I am guessing it is the snapshots are the cause which the code has not changed in ages and has been flawless for me. Perhaps there is a size limit for images, have you tried changing the resolution and compression/quality settings to see if it stops with a different setting? Is it only a particular brand of camera doing it? Any help narrowing it down would be great.

It happens once in a while, as far as i can see a couple of times a day. If it would be possible to just skip the image binary dump part from this exception that would be a solution for me; currently the log’s grow huge because of these dumps

Thanks for reporting it.

Have you tried cleaning the tmp and cache folders and rebooting? There has to be a reason why I have never seen this before nor had it reported by anyone else. It may be a camera doing something non standard… Try disabling some cameras to narrow down the cause as it may be a bottleneck of some kind, the root of a problem should always be looked at and not worked around. You can filter the error from the logs by using the method described in the readme file. It is not something I can change in the binding as the binding is not the code that is creating the error and it is indicating an earlier fault/warning/error has occurred.

As it is happening once or twice a day now i don’t thinks it’s related to cache or tmp folders. I have rebooted a couple of times the past days. I copied the complete error in a separate file for you to download so you see what is actually dumped: dump

Hello, first of all, thanks for your work on this binding.

Any chance to get Dahua IVS (Tripwire / CrossLine) alarm support added to the binding?

Here is a link to latest Dahua HTTP API I was able to find: http://pasty.sk/ohab/dahua_http_api_for_ipc_v1.56.pdf

Thanks!

It should already be working, does it not work for you? If not put the logs into TRACE (how to do this is in the readme) and supply what the camera is sending the binding when the alarm is triggered. Since I am trying to keep/reuse channels so the naming is consistent it is probably called line crossing not tripwire. Take a look at the available channels in PaperUI and you will see a lot of features that have been added for Dahua cameras.

I have seen weird things happen if you don’t clean the cache and tmp folders out with Openhab and it is one of the top 2 things that annoys me about Openhab. Whenever you change something this should be the first thing you try.

Ok and howto clean the cache?

In Linux the following should work, for other platforms search this forum…

sudo service openhab2 stop && sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo reboot

Hi @matt1,

thank you very much for the great binding you created!
It took me while to get it going, since it also requires to get the matching settings going on the camera side. But nevertheless, I am learning a lot and it is fun.
Here are a few questions:

  • Is there any way to get the current pan/tilt/zoom information from the camera?
  • My camera can be programmed with several PTZ positions; How can I select those using your binding?

Cheers…

Ok cache cleared and rebooted. Let’s see what it brings…