My guess is your camera creates a random password for when handing out the link via onvif. This is probably not an issue, what appears to be the cause of the error is a space in the URL at the end. This is why I print a dash in the logs to show where a string ends. Enter in a snapshot manually to over ride just be sure to test the link in a browser to make sure it works as the random password may expire.
When I question onvif port, I can do it without provide any user/password, then you don’t have to force the user and password that I put in the configuration?
Sorry I am not sure I know what you are asking or if are having an issue?
Yes the binding should allow you to have no user/pass with onvif, however I do not test this very often and hence there could be bugs. If your camera does not have PTZ or you dont care about that feature you can deliberately put the ONVIF port to the wrong number and provide a snapshot over ride and the camera is then much faster to connect as it will skip the ONVIF.
Lastly in a few replies recently people have smart quotes showing, these are tiny 6 and 9 looking quotes and they cause issues with Openhab if you paste them into config files. Please use code fences as it saves new comers issues if they try to cut and paste things from the forum, here is how:
jwiseman
(Mr. Wiseman (OH 4.3 Snapshot on Pi4))
366
Just wanted to say thank you! and kudo’s to you on this binding!
I got it running quickly with this setup:
Synology DSM 6.x running OH2.3 querying against HIKVision Model DS-7208HUI-K2
When I start adding cameras, even just one, Openhabian starts freaking out. Everything grinds to a halt and the logs shows repeated java heap space errors. This is repeatable. And persisted even after totally re-imaging the SD card.
Is there anything specific I have to do to get motion detect to work with foscam or amcrest cameras? According to logs binding connects to camera -
2018-07-14 19:02:38.764 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting that it supports PTZ control with Absolute movement via ONVIF
2018-07-14 19:02:50.672 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ with no errors, now fetching the Video URL for RTSP from the camera.
I also created 2 items - Motion detect on/off and Motion detect switch and linked them to channels. Openhab v 2.3
Here is debug log. Trying to enable/disable motion. If I copy/past url to browser and authenticate then it works.
2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Sending camera at IP:x.x.x.x, URL:/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Enable=true
2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just locked in main1
2018-07-14 20:00:25.069 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Just unlocked main1
@jwiseman
Thanks, I have put the model of your camera in the list that are confirmed to work. How do you find 8 cameras work regarding CPU load and what kind of server? I’m still punching down cables at the moment and building a house on top of many projects Your habpanel looks great.
@Pedals2Paddles
See the first post of this thread. Follow how to create some TRACE log output and then PM it to me after doing a quick find/replace on your passwords. The log needs to be from BEFORE the oom error so I can see how your camera behaves in the binding, I use this to then step through the code to look for faults. Please also provide what camera you have and some more info on your system so we can start looking at any patterns from people that report this. Lastly it would also be a good idea to remove all bindings except this one and see if it works, then add them back 1 at a time if it does.
No, just check in the cameras setup if you have changed the port away from what the binding uses. Yes your camera connects to ONVIF which is good, but the API uses a different port number and that may not be matching. Your log output was a little short to see what happens when the first HTTP request is made of the camera. TRACE output gives more info in the logs to DEBUG and to fault find this I would need TRACE level as it includes the replies back from the camera which sometimes give clues.
I had the same problem, so gave up on this until it’s integrated Into the approved binding.
I have found a workaround for now, but it may not apply to you.
I use habpanel on an old Samsung tab, running fully kiosk browser.
I have a little code that sets the current page to my RTSP feed (full screen) whenever motion is detected in one of the zones where I’d like to be able to see what’s happening, or when a button is pressed on the panel, then reverts it after 15 seconds.
So if someone triggers the motion detector at the front door, the panel screen changes to the full screen web cam feed for 15 seconds then back to whatever it was before.
jwiseman
(Mr. Wiseman (OH 4.3 Snapshot on Pi4))
371
Regarding # Camera’s and CPU Load:
I’m running OH2.3 on a Synology DS716+ unit which has 2 GB of RAM. I have over 400 items and 5 camera’s connected via your IP Binding and another 2 remote camera’s connected via Synology’s Surveillance binding.
The Synology unit runs around 65% RAM and 20% CPU most of the time. I also use it for all my Plex content which is around 1.5 TB. I did order an 8 GB RAM chip for it yesterday for potential growth.
I just try to play with this today. I got a Foscam FI8918W. But it´s given me some problems.
This is from the log:
2018-07-17 22:24:26.332 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:10.4.28.244:80
2018-07-17 22:24:26.422 [ERROR] [l.internal.messaging.saaj.client.p2p] - SAAJ0008: Bad Response; Not Found
2018-07-17 22:24:26.427 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - SOAP error when trying to connect with ONVIF. This may indicate your camera does not fully support ONVIF, check for an updated firmware for your camera. Will try and connect with HTTP. Camera at IP:10.4.28.244, fault was com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (404Not Found
2018-07-17 22:24:26.432 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.
I have no idea why or even if this ipcam is suitable.
Remove the port info from your things file, the binding knows the default ports for fiscal unless u changed the port. Another way to check the onvif port is with a program called onvif device manager.
Hmm… If I remove the port info, I get another error:
2018-07-17 23:22:20.601 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'ipcamera.things'
2018-07-17 23:22:20.613 [WARN ] [ore.common.registry.AbstractRegistry] - Could not remove element: null
java.lang.NullPointerException: null
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.preserveDynamicState(ThingRegistryImpl.java:177) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.onRemoveElement(ThingRegistryImpl.java:158) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.onRemoveElement(ThingRegistryImpl.java:1) ~[?:?]
at org.eclipse.smarthome.core.common.registry.AbstractRegistry.removed(AbstractRegistry.java:174) ~[?:?]
at org.eclipse.smarthome.core.common.registry.AbstractRegistry.removed(AbstractRegistry.java:1) ~[?:?]
at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:59) ~[?:?]
at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:74) ~[?:?]
at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutRemovedElement(AbstractProvider.java:82) ~[?:?]
at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.lambda$20(GenericThingProvider.java:773) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:775) ~[?:?]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:301) ~[?:?]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:139) ~[?:?]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:227) ~[?:?]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:291) ~[?:?]
at org.eclipse.smarthome.core.service.WatchQueueReader.lambda$3(WatchQueueReader.java:323) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-07-17 23:22:20.677 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:10.4.28.244:888
2018-07-17 23:22:20.681 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can not connect with ONVIF to the camera at 10.4.28.244, check the ONVIF_PORT is correct. Fault was java.net.ConnectException: Host not available.
2018-07-17 23:22:20.683 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.
==> /var/log/openhab2/events.log <==
2018-07-17 23:22:20.688 [me.event.ThingUpdatedEvent] - Thing 'ipcamera:FOSCAM:001' has been updated.
If Onvif DM does not find it then either it is disabled in the cameras control panel, or the camera is not ONVIF.
The older non HD cameras have a different API which this binding does not have implemented. This means you will need to setup as a HTTPONLY device and provide a snapshot url and port after testing the URL first in a browser. Google helps to find a working snapshot url for your model.
There is nothing regarding onvif in the controle panel. I have search Google as well, and nothing. So I guess it´s not onvif. It is a pretty old Foscam. I just had it laying around, so I had to test it
Guess I would have to google for this httponly device setup, or simply just skip this old cam and buy a new one. Thanks anyway.
Bug fixes for all cameras that were only in the 11-07-2018 build, plus some changes to hopefully make the binding faster.
HIKVISION now has a new channel for external alarm inputs which most of their models do not have this. @Kristo Let me know if it works.
@Pedals2Paddles
I was finally able to reproduce the OOM error. I dropped my camera to update every 1000ms and it occured, put it back to 2000ms and it went away with a reboot. This does not happen on my fast test setup, only on my Raspberry PI2 server. Post back if changing to a slower refresh fixes it for you and also what hardware your openhab is running on.
Is this the refresh rate in the thing configuration, labeled as Time in milliseconds between checking camera states and fetching an Image? Would having multiple camera things cause this to happen even with the higher suggested refresh rates? Or does only matter on a per thing basis?