IpCamera: New IP Camera Binding

You need to provide the RTSP URL to the binding or if your camera does not have one you can set the gifPreroll to be higher then 0 and it will source from snapshots instead of the livestream.

okay, got it!
in full example/items thereā€™s still channel ā€œstreamUrlā€, this should be ā€œmjpegUrlā€, shouldnā€™t it?

Thanks for the feedback, have fixed this in the readme. If you notice anything else that would be great.

1 Like

Thanks, I added the rtsp stream and saw some good messages:

2020-09-15 13:08:05.894 [vent.ItemStateChangedEvent] - CamMjpegUrl changed from NULL to http://192.168.0.143:54320/ipcamera.mjpeg
2020-09-15 13:08:05.898 [vent.ItemStateChangedEvent] - CamHlsUrl changed from NULL to http://192.168.0.143:54320/ipcamera.m3u8
2020-09-15 13:08:05.901 [vent.ItemStateChangedEvent] - CamImageUrl changed from NULL to http://192.168.0.143:54320/ipcamera.jpg
2020-09-15 13:08:09.951 [hingStatusInfoChangedEvent] - ā€˜ipcamera:hikvision:frontdoorā€™ changed from INITIALIZING to ONLINE

Iā€™ve set ffmpegOutput to "/etc/openhab2/html/cameras/hikvision-frontdoor/", but no gif appears in this folder. No errors in log.

You need to be in debug or trace log level to see any message back from FFmpeg. Readme states this in the first section

Woops, sorry, it was a permission issue.

1 Like

Strange thing:

When i set ā€œgifPreroll=0ā€ i get the following error-message and no gif is sent by email:

2020-09-17 09:15:42.970 [WARN ] [.binding.mail.action.SendMailActions] - Could not send mail: Invalid URL set:file:/tmpfs/camera1/ipcamera.gif

When i set it back to ā€œ1ā€ it works without any problem.

Any idea?


You said, i donĀ“t need ffmpegInput for my dahua cam, because it is seen automatically by the binding.

With the old binding version i had ā€œffmpegInput=ā€œrtsp://192.168.102.46:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvifā€ā€

This worked with gifpreroll=0 also.

Iā€™m trying the latest binding out with a Reolink RLC-423. The cameraā€™s ONVIF is working with ODM software. So pretty sure that the camera & network settings are correct.

At first sight, the camera is nicely been picked up as ONVIF camera. After configuring the default settings (login, password, port 8000 and -1 server port), the camera comes online.

When I check the TRACE logs, the presets are also rolling in:

2020-09-17 11:13:31.476 [TRACE] [amera.internal.onvif.OnvifConnection] - ...
<tptz:Preset token="000"><tt:Name>Patio</tt:Name></tptz:Preset>
<tptz:Preset token="001"><tt:Name>Dierenrijk</tt:Name></tptz:Preset>
<tptz:Preset token="002"><tt:Name>Vijver</tt:Name></tptz:Preset>

Iā€™ve create following items:

Dimmer   FrouFrou_OnvifPan     "Pan"     {channel="ipcamera:onvif:5571019d:pan" }
Dimmer   FrouFrou_OnvifTilt    "Tilt"    {channel="ipcamera:onvif:5571019d:tilt" }
Number   FrouFrou_OnvifPreset  "Preset"  {channel="ipcamera:onvif:5571019d:gotoPreset" }

And in my sitemap:

Switch item=FrouFrou_OnvifPreset mappings=[1=1test]
Switch item=FrouFrou_OnvifPreset mappings=[5=5test]
Slider item=FrouFrou_OnvifPan
Slider item=FrouFrou_OnvifTilt

When I now use my silders or presets:

2020-09-17 11:14:42.395 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifPreset2' received command 5
2020-09-17 11:14:42.398 [nt.ItemStatePredictedEvent] - FrouFrou_OnvifPreset2 predicted to become 5
2020-09-17 11:14:46.077 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifPreset2' received command 1
2020-09-17 11:14:46.081 [nt.ItemStatePredictedEvent] - FrouFrou_OnvifPreset2 predicted to become 1
2020-09-17 11:14:46.084 [vent.ItemStateChangedEvent] - FrouFrou_OnvifPreset2 changed from 5 to 1
2020-09-17 11:14:48.519 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifPreset2' received command 1
2020-09-17 11:27:14.785 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifPan' received command 53
2020-09-17 11:27:14.794 [nt.ItemStatePredictedEvent] - FrouFrou_OnvifPan predicted to become 53
2020-09-17 11:27:14.827 [vent.ItemStateChangedEvent] - FrouFrou_OnvifPan changed from 27 to 53
2020-09-17 11:27:21.007 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifTilt' received command 65
2020-09-17 11:27:21.034 [nt.ItemStatePredictedEvent] - FrouFrou_OnvifTilt predicted to become 65
2020-09-17 11:27:21.052 [vent.ItemStateChangedEvent] - FrouFrou_OnvifTilt changed from 80 to 65
2020-09-17 11:27:21.207 [ome.event.ItemCommandEvent] - Item 'FrouFrou_OnvifTilt' received command 48
2020-09-17 11:27:21.215 [nt.ItemStatePredictedEvent] - FrouFrou_OnvifTilt predicted to become 48
2020-09-17 11:27:21.222 [vent.ItemStateChangedEvent] - FrouFrou_OnvifTilt changed from 65 to 48

It seems that the command are not getting out? Iā€™m not getting extra log (trace) for the onvif communication? Or shouldnā€™t I see this?
Any idea what I can try next?

Sorry this was a breaking change and I had not updated the readme. Updated nowā€¦

Change this to be a String

String FrouFrou_OnvifPreset "Preset" {channel="ipcamera:onvif:5571019d:gotoPreset" }

Also do the channels in PaperUI have dots inside the circle to show they are linked to an item? Reason I ask is if you auto added the camera it should have used the IP as the ID and not 5571019d. That may be correct, it is just worth asking as if the items are not correct, they wont be sending the commands to the camera if the 5571019d is wrong.

The other thing it could be is if the ONVIF handshake did not go 100% smoothly it may be ignoring the commands if it thinks the camera does not have PTZ features. I would need the TRACE logs when the camera is connecting where you see a heap of XML looking entries. You already showed when it was finding the presets so I just need that full part to look to see what may have gone wrong.

Change the ā€˜stringā€™ didnā€™t help, result is the same.

The items are nicely link in the paperUI:
Schermafdruk van 2020-09-17 12.24.39

That it is a id instead of IP is maybe the fact that I added it manually this time? My first run was a discovery with a test machine. Now itā€™s on another server, in another VLAN, so auto discovery isnā€™t working in openHAB then. :blush:

This is the trace log after restarting the binding. Hope this contains the info youā€™re looking for? Else, let me know! The IP of the camera is 192.168.111.92

tracelog.txt (119.0 KB)

[EDIT] Iā€™ve move the camera for the moment to the same network as the OH server. Just to avoid any TCP/UDP issues. But at first sight, this donā€™t help.

Your log actually had a WARN that gave you the reason why it was not working. I will upload a newer version of the binding shortly with a fix in it for you. Short reason is your camera does not report its x y and z locations to the binding and the binding was turning all PTZ features off, which it should not have done this as its pretty common for a camera to not have that implemented. So thanks for taking the time to send in the log.

FYI for your Reolink cameraā€¦

port = 80
onvifPort = 8000
http://192.168.111.92/cgi-bin/api.cgi?cmd=onvifSnapPic&channel=0
rtsp://192.168.111.92:554/h264Preview_01_main

Yes if you have isolated the camera it wont get auto discovered and manual adding is the way to go, in fact it allows you to change the ID to a useful name if you do manual method.

@brononius
Build is uploaded now. Can you let me know if the camera works fully as some have posted issues with Reolink in the past. To use all features you will need to set a serverPort to a value thatā€™s not -1. The log should help guide you so be sure to look at it :wink:

1 Like

I saw there is new version of ipcamera binding and decided to give it a try, as previous attempts always failed for one reason or another (most likely human error:)). But I want those .gifā€™s with pre-roll images upon external pir sensor detecting motion ā€¦

So I downloaded the latest version (09-16-Testing), stopped my openhab (2.5.9-SNAPSHOT), copied over all the .jars from zip to addons and restarted.
Re-checked .things file and changed to lowercase as needed.
Camera Thing showing up in the PaperUI in green status - must be good.

Whenever I try to open /ipcamera.jpg - I get this error

2020-09-17 17:11:41.642 [WARN ] [pcamera.internal.StreamServerHandler] - ipcamera.jpg was requested but there is no jpg in ram to send.```
Judging by these lines - camera is sending it's events, so connection is ok (but I'm first timer with onvif and ipcamera binding, don't judge me too harsh)
```2020-09-17 17:11:35.902 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-17 17:11:35.907 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-17 17:11:36.347 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-17 17:11:37.112 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-17 17:11:37.973 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-17 17:11:37.991 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false

The worst thing is that I actually could not get too far playing around with it as at some point I started getting a lot of ā€œSelector.select() returned prematurelyā€ errors, eventually Openhab hanging and ending with OurOfMemory. I must be doing smtg wrong:(

2020-09-17 17:22:09.111 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@a38c74.
2020-09-17 17:22:09.133 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@8429bb.
2020-09-17 17:22:13.333 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1416373.
2020-09-17 17:22:13.333 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@6e519a.
2020-09-17 17:22:13.400 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@17dfeb9.
2020-09-17 17:22:38.276 [ERROR] [.smarthome.model.script.actions.HTTP] - Fatal transport error: java.util.concurrent.TimeoutException: Total timeout 1000 ms elapsed
2020-09-17 17:22:41.989 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@116af5.
2020-09-17 17:22:41.983 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@19d4b35.
2020-09-17 17:22:44.289 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1b8f444.
2020-09-17 17:22:44.284 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@f6e760.
2020-09-17 17:22:44.340 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@20d42a.
2020-09-17 17:38:32.803 [WARN ] [netty.util.concurrent.DefaultPromise] - An exception was thrown by org.openhab.binding.ipcamera.internal.handler.IpCameraHandler$2.operationComplete()
java.lang.OutOfMemoryError: Java heap space
2020-09-17 17:41:34.115 [WARN ] [netty.util.concurrent.DefaultPromise] - An exception was thrown by org.openhab.binding.ipcamera.internal.handler.IpCameraHandler$2.operationComplete()
java.lang.OutOfMemoryError: Java heap space
2020-09-17 18:02:06.126 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.OutOfMemoryError: Java heap space
2020-09-17 17:37:31.668 [WARN ] [netty.util.concurrent.DefaultPromise] - An exception was thrown by org.openhab.binding.ipcamera.internal.handler.IpCameraHandler$2.operationComplete()
java.lang.OutOfMemoryError: Java heap space

Is it is apropriate to ask for help here or shall I be creating a separate thread for my config issue?
Thank You in advance!
P.S.
my things file, if it helps/suggests anything

[   ipAddress="192.168.60.250", password="******",
    username="admin",
    snapshotUrl="http://192.168.60.250:85/images/snapshot.jpg",
    serverPort=54321,
    ffmpegOutput="/etc/openhab2/html/cameras/garden",
    gifPreroll=1,
    gifPostroll=20
]

(I changed snapshot URL from autodetected :80 to :85 as, if opened in browser, :80 always loads only upper half of image; port:85 loads full)

Try adding
port =85
To your things file as it will be using port 80 still since it defaults to that. Also remove the port from the URL as it may be triggering a bug. Please report back if that fixes it.

1 Like

Perfect!
At first sight, my presets seems to be working.
I can start triggering the presets based on alerts (doorcontacts, movement sensorā€¦). :wink:

You can add the camera (Reolink RLC-423) to the working model list.

btw Do you want me to test anything else? I donā€™t use the images or so, I pull this info from my videosurveillance server (zoneminder). But if you want me to test something, let me know!

Sounds very likely ā€¦ will give it a try over weekend. I was also surprised seeing default URL used in the log file.

2020-09-17 17:12:01.134 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.60.250/images/snapshot.jpg
2020-09-17 17:12:01.176 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.60.250/images/snapshot.jpg
2020-09-17 17:12:01.186 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.60.250/images/snapshot.jpg
2020-09-17 17:12:01.184 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.60.250/images/snapshot.jpg
2020-09-17 17:12:01.238 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.60.250/images/snapshot.jpg

Now, when you have said it and I start reading more the log file, I realize the default auto-detect was even reporting it correctly. I must have made this mistake on one of previous attempts, when trying to switch over to manual .things file. Will let you know!

2020-09-17 16:48:30.735 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xmime4="http://www.w3.org/2004/11/xmlmime" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:tes-e="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tes-nc="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:tes-np="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:tes-sm="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:xmime="http://www.w3.org/2004/06/xmlmime" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tan-ae="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xmlns:tan-re="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tpl="http://www.onvif.org/ver10/plus/wsdl" xmlns:tplt="http://www.onvif.org/ver10/plus/schema"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><trt:GetSnapshotUriResponse><trt:MediaUri><tt:Uri>http://192.168.60.250:85/images/snapshot.jpg</tt:Uri><tt:InvalidAfterConnect>false</tt:InvalidAfterConnect><tt:InvalidAfterReboot>false</tt:InvalidAfterReboot><tt:Timeout>PT60S</tt:Timeout></trt:MediaUri></trt:GetSnapshotUriResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Yes I have always wanted to set that up, would be cool if a door sensor detects the door is opening and the camera pivots around to then point in that direction automatically.

If you have spare time it would be great to test these things.

  1. PTZ
  2. Events
  3. Snapshot url gets auto detected and then actually works if you call ipcamera.jpg
  4. Stream works with the autodetected RTSP, probably easiest to test by triggering a GIF or mp4 recording.

If you can confirm they all work, then I can add it to the working list.

@Austris_V
I looked for a bug and could not find anything. It should have been using the port and URL u specified but the log was not displaying the port correctly which I have change for next build. Not sure what the cause is unless your telling me the URL u entered in was wrong?

I can already confirm that this is working:

  1. PTZ 1 > 9
  2. Snapshot movie: http://x.x.x.x:YYY/snapshots.mjpeg
  3. Snapshot image: http://x.x.x.x:YYY/ipcamera.jpg

Not working right now (just noticed it, so can be a typo from my side):

  1. Pan
  2. Tilt
  3. zoom

For the events and RTSP, I guess I need a storage card inserted or simular? Iā€™m using zoneminder to store my events, so the camera itself doesnā€™t do much. I can try to add a ftp storage location or so for testing.

But will be something for tomorrow or so. :blush:

1 Like

For Events, just put the logs in DEBUG not trace so its less messy and watch if the logs show the motion alarms and other info getting logged. If your not interested in the events the logs will be enough and save you from linking up the channels. Zoneminder probably has better motion detection built in than the camera but there may be another event you like to use.

RTSP testing can be done by reading the info in the readme on the GIF and MP4 recording. You donā€™t need a storage card or ftp or anything. Should be able to test it with a spare half hour and the readme. I would be surprised if there was an issue on this one.

Iā€™m not 100% sure what was there ā€¦ maybe bad luck/wrong order of changes and missing restart?

Anyways, atm I have taken port out as separate config:

Thing ipcamera:onvif:Darzs
[   ipAddress="192.168.60.250", 
    port=85,
    username="admin",
    password="******",
    serverPort=54321,
    ffmpegOutput="/etc/openhab2/html/cameras/buuda",
    gifPreroll=1,
    gifPostroll=20
]

First imprssion is that debug log looks quite clean ā€¦ looks like rtsp://192.168.60.250/media/video1 is not loading (shall I be changing it in camera settings to anything else than H.264 ā€¦ mjpeg maybe?).
And the http://192.168.66.116:54321/ipcamera.jpg is giving the same ā€œno jpg in ramā€

2020-09-18 17:11:25.717 [DEBUG] [era.internal.handler.IpCameraHandler] - File server for camera at 192.168.60.250 has started on port 54321 for all NIC's.
2020-09-18 17:11:26.107 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC time is : 15:11:47
2020-09-18 17:11:26.115 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC date is : 2020-9-18
2020-09-18 17:11:26.121 [DEBUG] [amera.internal.onvif.OnvifConnection] - Openhabs UTC dateTime is:2020-09-18T14:11:26.120Z
2020-09-18 17:11:26.189 [DEBUG] [amera.internal.onvif.OnvifConnection] - deviceXAddr:/onvif/device_service
2020-09-18 17:11:26.192 [DEBUG] [amera.internal.onvif.OnvifConnection] - eventsXAddr:/onvif/event
2020-09-18 17:11:26.194 [DEBUG] [amera.internal.onvif.OnvifConnection] - mediaXAddr:/onvif/media
2020-09-18 17:11:26.197 [DEBUG] [amera.internal.onvif.OnvifConnection] - We hit an issue parsing url:
2020-09-18 17:11:26.552 [DEBUG] [amera.internal.onvif.OnvifConnection] - GetSnapshotUri:/images/snapshot.jpg
2020-09-18 17:11:26.695 [DEBUG] [amera.internal.onvif.OnvifConnection] - GetStreamUri:rtsp://192.168.60.250/media/video1
2020-09-18 17:11:27.301 [DEBUG] [amera.internal.onvif.OnvifConnection] - subscriptionXAddr=/Subscription?Idx=210235TH1N3206000048_158
2020-09-18 17:11:27.469 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:27.626 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:11:27.785 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:11:28.050 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:28.237 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/CellMotionDetector/Motion, Data:IsMotion, Value:false
2020-09-18 17:11:32.168 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:32.648 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:34.375 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:36.026 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:37.149 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:41.746 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:41.901 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:42.097 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:44.729 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:45.036 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:46.057 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:48.730 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1f8676a.
2020-09-18 17:11:48.737 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1951acc.
2020-09-18 17:11:48.738 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@198fb1c.
2020-09-18 17:11:48.742 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@18cf0e.
2020-09-18 17:11:49.335 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:55.738 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:56.021 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:11:57.745 [DEBUG] [era.internal.handler.IpCameraHandler] - There are 1 Channels being tracked, 25 are open.
2020-09-18 17:11:59.718 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:01.178 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:01.456 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:01.632 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:UserAlarm/BandwidthChange, Data:TotalBandwidth, Value:51200
2020-09-18 17:12:01.827 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:05.319 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:05.788 [DEBUG] [era.internal.handler.IpCameraHandler] - There are 1 Channels being tracked, 30 are open.
2020-09-18 17:12:09.302 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:12:11.465 [DEBUG] [pcamera.internal.StreamServerHandler] - Stream Server recieved request 	GET:/ipcamera.jpg
2020-09-18 17:12:11.472 [WARN ] [pcamera.internal.StreamServerHandler] - ipcamera.jpg was requested but there is no jpg in ram to send.
2020-09-18 17:12:12.690 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true

but after a little while, as it reports again the camera time&date, the log later has quite few ā€œreturned prematurelyā€ warnings, too ā€¦ will see if it also ends pu with slowing down openhab/running out of memory

2020-09-18 17:27:06.045 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC date is : 2020-9-18
2020-09-18 17:27:06.050 [DEBUG] [amera.internal.onvif.OnvifConnection] - Openhabs UTC dateTime is:2020-09-18T14:27:06.049Z
2020-09-18 17:27:06.368 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:06.415 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:06.465 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:27:06.602 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:06.835 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:27:06.954 [DEBUG] [amera.internal.onvif.OnvifConnection] - subscriptionXAddr=/Subscription?Idx=210235TH1N3206000048_187
2020-09-18 17:27:07.091 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:07.157 [DEBUG] [amera.internal.onvif.OnvifConnection] - deviceXAddr:/onvif/device_service
2020-09-18 17:27:07.164 [DEBUG] [amera.internal.onvif.OnvifConnection] - eventsXAddr:/onvif/event
2020-09-18 17:27:07.172 [DEBUG] [amera.internal.onvif.OnvifConnection] - mediaXAddr:/onvif/media
2020-09-18 17:27:07.176 [DEBUG] [amera.internal.onvif.OnvifConnection] - We hit an issue parsing url:
2020-09-18 17:27:07.181 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:07.222 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:07.274 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:07.366 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:07.504 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@111d457.
2020-09-18 17:27:07.504 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@12ec7b6.
2020-09-18 17:27:07.505 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@10f4b9.
2020-09-18 17:27:09.957 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:09.963 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:27:09.968 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:09.968 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:09.966 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:09.995 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:10.012 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:27:10.012 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:10.026 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1e739f9.
2020-09-18 17:27:10.041 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:10.067 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@120a3ea.
2020-09-18 17:27:10.074 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1be2e45.
2020-09-18 17:27:10.068 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@ec5c2b.
2020-09-18 17:27:10.078 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@1190551.
2020-09-18 17:27:10.076 [WARN ] [io.netty.channel.nio.NioEventLoop   ] - Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@12cda26.
2020-09-18 17:27:10.153 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:10.339 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:10.845 [DEBUG] [amera.internal.onvif.OnvifConnection] - GetSnapshotUri:/images/snapshot.jpg
2020-09-18 17:27:11.382 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:11.391 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2020-09-18 17:27:11.397 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:11.404 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:11.469 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2020-09-18 17:27:11.515 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:11.524 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:27:11.611 [DEBUG] [amera.internal.onvif.OnvifConnection] - GetStreamUri:rtsp://192.168.60.250/media/video1

ā€¦ no memory exception as of yet, but looks like openhab become iresposive(e.g. 8080 not opening and no more log updates) ā€¦ and eventually the heap exception, too.

2020-09-18 17:31:12.000 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.60.250:80
2020-09-18 17:31:12.002 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:18.457 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:20.658 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:18.453 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:27.328 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:31.697 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/FieldDetector/ObjectsInside, Data:IsInside, Value:true
2020-09-18 17:31:56.380 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.60.250:80
2020-09-18 17:31:53.682 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.CommunicationManager@24a23e' takes more than 5000ms.
2020-09-18 17:31:56.380 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.60.250:80
2020-09-18 17:31:53.682 [WARN ] [me.core.internal.events.EventHandler] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.CommunicationManager@24a23e' takes more than 5000ms.
2020-09-18 17:49:59.562 [DEBUG] [g.ipcamera.internal.onvif.OnvifCodec] - Exception on ONVIF connection: Java heap space

Commented out ipcamera thing settings, restarted w/out it - all looks calm and stable.

Please start your own thread, posting multiple lots of logs and info in this one is going to get lost very quickly.

My guess as to whats wrong is the snapshot is not finding its way to the binding. Events do appear to be working fine so please delete them to keep logs shorter.

If your 100% sure that this url works in a web browser then make sure you have this line in the things fileā€¦ snapshotUrl="http://192.168.60.250:85/images/snapshot.jpg",

This log shows what is going wrong.
020-09-18 17:12:05.788 [DEBUG] [era.internal.handler.IpCameraHandler] - There are 1 Channels being tracked, 30 are open.

You camera appears to not reply to the snapshot request so the binding keeps opening up a new channel and asking again. At this point it had asked 30 times and not gotten a reply back, if things were working it would be 1-2 open and this is why it keeps going until you run out of memory.
Do you have the camera behind a firewall that may be blocking things? Debug logs do not give the full story, I really need TRACE and even then I may need a special build to log what I need if this is some weird compatability issue. I also have no idea what camera this is or any other important basic info on your setup, hence why this needs its own thread.

As a work around that will chew more cpu you can do thisā€¦
snapshotUrl="ffmpeg",
This will force the binding to forget about trying to fetch a snapshot and to generate its own from the RTSP using ffmpeg. Not optimal so it is worth working out why the snapshot is not working.

1 Like