Look about six posts above for a newer build. The binding that is merged has an issue with recording GIF that is fixed in that build.
Instance is not a IpCamera class
To fix that reboot openhab, I think this is caused by the order things start when you use textual config. Recommend u move towards using auto discovery now the binding is merged.
I wrote that I use newest binding you have mentioned: 2.5.10.202011141152 . It is from post number: 2205:
$ unzip -t ipcamera-2020-11-15.zip
Archive: ipcamera-2020-11-15.zip
testing: netty-buffer-4.1.42.Final.jar OK
testing: netty-codec-4.1.42.Final.jar OK
testing: netty-codec-http-4.1.42.Final.jar OK
testing: netty-common-4.1.42.Final.jar OK
testing: netty-handler-4.1.42.Final.jar OK
testing: netty-resolver-4.1.42.Final.jar OK
testing: netty-transport-4.1.42.Final.jar OK
testing: org.openhab.binding.ipcamera-2.5.10-SNAPSHOT.jar OK
No errors detected in compressed data of ipcamera-2020-11-15.zip.
My config always was without quotes. I wrote, that I even try quotes, but get still the same error.
I do not want (and it is useless for me) to use autodiscovery, becasue I have several networks (VLANs) with router/firewall between them, so I have to use static configuration.
While I was writing this I restarted openhab. Yesterday I replace the ipcamera binding, without restarting openhab. Now, generating GIF works gine, but the ādecimal errorā persists.
==> /opt/openhab/userdata/logs/openhab.log <==
2020-12-10 10:21:50.595 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'updateImageWhen': Can not set java.lang.String field org.openhab.binding.ipcamera.internal.CameraConfig.updateImageWhen to java.math.BigDecimal
java.lang.IllegalArgumentException: Can not set java.lang.String field org.openhab.binding.ipcamera.internal.CameraConfig.updateImageWhen to java.math.BigDecimal
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_265]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_265]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) ~[?:1.8.0_265]
at java.lang.reflect.Field.set(Field.java:764) ~[?:1.8.0_265]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:523) ~[bundleFile:2.6]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:500) ~[bundleFile:2.6]
at org.apache.commons.lang.reflect.FieldUtils.writeField(FieldUtils.java:560) ~[bundleFile:2.6]
at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:101) [bundleFile:?]
at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:80) [bundleFile:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.getConfigAs(BaseThingHandler.java:232) [bundleFile:?]
at org.openhab.binding.ipcamera.internal.handler.IpCameraHandler.initialize(IpCameraHandler.java:1595) [bundleFile:?]
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
2020-12-10 10:21:50.677 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'updateImageWhen': Can not set java.lang.String field org.openhab.binding.ipcamera.internal.CameraConfig.updateImageWhen to java.math.BigDecimal
java.lang.IllegalArgumentException: Can not set java.lang.String field org.openhab.binding.ipcamera.internal.CameraConfig.updateImageWhen to java.math.BigDecimal
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[?:1.8.0_265]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[?:1.8.0_265]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) ~[?:1.8.0_265]
Previously (in April, using previous version of the binding), generating GIF I think was fasterā¦
Now it took for me, about 12-15 secondsā¦
2020-12-10 17:52:43.231 [vent.ItemStateChangedEvent] - CamFurtkaLineCrossingAlarm changed from OFF to ON
2020-12-10 17:52:43.232 [vent.ItemStateChangedEvent] - CamFurtkaLastMotionTime changed from 2020-12-10T17:47:38.073+0100 to 2020-12-10T17:52:43.229+0100
2020-12-10 17:52:43.245 [vent.ItemStateChangedEvent] - CamFurtkaRecordingGif changed from 0 to 3
2020-12-10 17:52:54.337 [vent.ItemStateChangedEvent] - CamFurtkaLineCrossingAlarm changed from ON to OFF
2020-12-10 17:52:57.229 [vent.ItemStateChangedEvent] - CamFurtkaRecordingGif changed from 3 to 0
Like I write I set:
gifPreroll=0,
gifPostroll=3,
and generate GIF using rule:
rule "FURTKA Line Crossing detected"
when
Item CamFurtkaLineCrossingAlarm changed to ON
then
if (CamFurtkaRecordingGif.state == 0 || CamFurtkaRecordingGif.state == NULL ) {
getActions("ipcamera", "ipcamera:hikvision:FURTKA").recordGIF("ipcamera",3)
}
end
Have you cleaned the cache and tmp folders?
It is the exact same code just triggered in a different way so the delay is weird and may be an indication you need to clean out the cache. Lastly you should stop using the image channel and use one of the methods the readme covers.
@majherek
I looked at the code and this is what I found:
updateImageWhen
I checked and this needs to be a string (sorry I was wrong earlier) and hence will need the correct quotes around it to work without the error your reporting.
gifPostroll=3,
This no longer exists in the binding, but it wont hurt if left there. Recording time is set by the action parameter.
Guys im struggling at step 1. How to install this binding??
I can see it in the add-ons list on openhab.org, but when using PaperUI i cannot see the binding listed to enable me to install?
Feeling a bit silly here as i must be missing something.
Colin
Hi, I am getting frustrated, since I am not able to integrate my Axis Cam ( P3225-LVE Mk II ) in Openhab.
The binding seems to work fine. The parameter I used:
You use the IP of the openhab server and not the cameras in the sitemap, also the server port is 2079 in the cameras setup and your using 3001 on the cameras IP which will not work for the two separate reasons.
Also look at the logs in debug and trace level if you need further help.
Thanks for your reply. No, my openhab server does have a different IP address. 192.168.178.79 is the address of the Axis camera.
You are right. Server Port I changed for testing purporses and its correct set to 2079 in the sitemap.
Could you let me know which logs you are referring to? Appreciate your support
Understood, this is why using the IP of 192.168.178.79 is wrong in your sitemap file and anywhere else you want the binding to provide the images from the camera. The binding creates a file server at your openhab IP address.
Iām using thebinding with the newly release OH3 - clean install and setting things up - I have a strong suspicion (mainly through trial and error/process of elimination) that changes made to the parameters of the binding arenāt being saved correctly once the initial binding is created - and that even that isnāt saving its initial parameters correctly - for example if I manually set the ImageURL/MPEG URL - to URLs that I know work - or on an alternate try deliberatly donāt work - they donāt seem to get set and the binding doesnāt use them.
Iāve not tried creating it using text as Iām just getting used to OH3ā¦
Iāve had it working then in the logs - suddenly I get this:
āCamera is reporting your username and/or password is wrong.ā
then the camera gets locked out due to bad username/pw combinations
Iāve never seen that, have you done a reboot after the install completed? If it happens after a reboot can you list the steps you are taking to create this and I will test.
Hi, this looks very promising. Do you know if I run openhab with docker, will I need to build my own docker file to include ffmpeg? Or do I specify the ffmpeg path on my host system?
Additionally, do I need to create the output path in my docker container and mounted to my host machine? Or do I specify the output path just as my system path?