IpCamera: New IP Camera Binding

Hello!
I’m trying to configure your add-on, but I get an error:

2018-05-23 20:57:09.132 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.x.x
2018-05-23 20:57:09.137 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/webcapture.jpg?command=snap&channel=0:
2018-05-23 20:57:09.231 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.0)
HTTP/1.0 200 OK
Content-type: image/jpeg
Cache-Control: max-age=315360000Server: uc-httpd 1.0.0
Expires: 0
2018-05-23 20:57:09.643 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 512, cap: 512/512, unwrapped: PooledUnsafeDirectByteBuf(ridx: 512, widx: 512, cap: 512)), decoderResult: success)
2018-05-23 20:57:09.643 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - !!! Camera may have closed the connection which can be normal. Cause reported is:{}
java.lang.ArrayIndexOutOfBoundsException: 0
    at org.openhab.binding.ipcamera.handler.IpCameraHandler$CommonCameraHandler.channelRead(IpCameraHandler.java:365) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at org.openhab.binding.ipcamera.internal.MyNettyAuthHandler.channelRead(MyNettyAuthHandler.java:193) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [262:org.openhab.binding.ipcamera:2.3.0.201805230847]
    at java.lang.Thread.run(Thread.java:748) [?:?]
2018-05-23 20:57:09.645 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent

This is generic IP camera with ONVIF 2.0 support (“Gadinan 720p”). RTSP and snapshots works normal, but there is no any image in openhab.

I think the authentification is working now?

2018-05-23 19:47:36.547 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera dispose called, about to remove/change a Cameras settings.
2018-05-23 19:47:36.559 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Getting configuration to initialize a new IP Camera at IP 192.168.178.110
2018-05-23 19:47:36.571 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.178.110:8080
2018-05-23 19:47:37.299 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profile this camera supports.
2018-05-23 19:47:37.962 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Checking the selected Media Profile is a valid number.
2018-05-23 19:47:37.963 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Fetching a Token for the selected Media Profile.
2018-05-23 19:47:37.964 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Auto fetching the snapshot URL for the selected Media Profile.
2018-05-23 19:47:38.490 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to fetch some information about the Media Profiles from the camera
2018-05-23 19:47:38.491 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 0 details reported by camera at IP:192.168.178.110 *********************
2018-05-23 19:47:38.491 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the binding by pressing on the pencil icon in PaperUI.
2018-05-23 19:47:38.492 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:main_video_encoder_cfg
2018-05-23 19:47:38.492 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder	:H_264
2018-05-23 19:47:38.493 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality	:4.0
2018-05-23 19:47:38.493 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion	:1280 x 720
2018-05-23 19:47:38.494 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate	:2048
2018-05-23 19:47:38.495 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 1 details reported by camera at IP:192.168.178.110 *********************
2018-05-23 19:47:38.495 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:sub_video_encoder_cfg
2018-05-23 19:47:38.496 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder	:H_264
2018-05-23 19:47:38.496 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality	:4.0
2018-05-23 19:47:38.497 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion	:640 x 352
2018-05-23 19:47:38.497 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate	:512
2018-05-23 19:47:38.498 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to interrogate the camera to see if it supports PTZ.
2018-05-23 19:47:44.691 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting it supports PTZ controls via ONVIF
2018-05-23 19:47:44.692 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Pan  from -1.0 to 1.0
2018-05-23 19:47:44.693 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Tilt from -1.0 to 1.0
2018-05-23 19:47:44.694 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Zoom from -1.0 to 1.0
2018-05-23 19:47:45.573 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Camera replied with null when asked what its position was, going to fake the position so PTZ still works.
2018-05-23 19:47:45.574 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ, now fetching the Video URL's the camera supports.
2018-05-23 19:47:46.588 [ERROR] [ing.saaj.soap.ver1_2.SOAPPart1_2Impl] - SAAJ0415: InputStream does not represent a valid SOAP 1.2 Message
2018-05-23 19:47:46.590 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.178.110
2018-05-23 19:47:46.597 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/web/auto.jpg?-usr=admin&-pwd=PASSWORD&:
2018-05-23 19:47:46.627 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Server: Ipcam
Access-Control-Allow-Origin: *
Date: Wed, 23 May 2018 17:47:46 GMT
Last-Modified: Wed, 23 May 2018 17:47:46 GMT
Content-Type: image/jpeg
Content-Length: 24814
Connection: close
Accept-Ranges: bytes
2018-05-23 19:47:46.635 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 1024, cap: 1024/1024, unwrapped: PooledUnsafeDirectByteBuf(ridx: 1024, widx: 1024, cap: 1024)), decoderResult: success)
2018-05-23 19:47:46.637 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 8192, widx: 16384, cap: 16384)), decoderResult: success)
2018-05-23 19:47:46.639 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 8192, cap: 8192/8192, unwrapped: PooledUnsafeDirectByteBuf(ridx: 16384, widx: 16384, cap: 16384)), decoderResult: success)
2018-05-23 19:47:46.641 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 7406, cap: 7406/7406, unwrapped: PooledUnsafeDirectByteBuf(ridx: 7406, widx: 7406, cap: 65536)), decoderResult: success)
2018-05-23 19:47:46.643 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.178.110
2018-05-23 19:47:46.650 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/web/auto.jpg?-usr=admin&-pwd=PASSWORD&:
2018-05-23 19:47:46.759 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)

but the motion alarm switch doesn’t change.
And I still have a lot of debug messages, even after I updated to the latest version

@matt1 Sorry, for which camera? One of the two working Hikvisions, or the generic one that I’m currently unable to get online?

The generic cam shows “OFFLINE - CONFIGURATION_ERROR” in paperui.

Even though port should be correct, as I got it from Onvif Device Manager.
URI: http://192.168.1.203:8899/onvif/device_service
Onvif ver 2.0

Can’t think what else to try, everything looks correct, I’ve tried different ports.

Here is the log file, it was too large to add as text to the post, so I had to upload it as .xml.
xml.xml (115.6 KB)

I flipped the test switch on the Hiks during motion, and nothing. What am I looking for?
The Hiks are forever filling the log file like so:

2018-05-24 00:07:27.728 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 179480 bytes to raw type (image/jpeg): 277852 bytes

2018-05-24 00:07:30.812 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 178928 bytes to raw type (image/jpeg): 180136 bytes

2018-05-24 00:07:31.904 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 277852 bytes to raw type (image/jpeg): 275988 bytes

2018-05-24 00:07:35.756 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 180136 bytes to raw type (image/jpeg): 179980 bytes

2018-05-24 00:07:36.745 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 275988 bytes to raw type (image/jpeg): 271228 bytes

2018-05-24 00:07:40.774 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 179980 bytes to raw type (image/jpeg): 178600 bytes

2018-05-24 00:07:41.796 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 271228 bytes to raw type (image/jpeg): 271332 bytes

2018-05-24 00:07:45.759 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 178600 bytes to raw type (image/jpeg): 180640 bytes

2018-05-24 00:07:46.874 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 271332 bytes to raw type (image/jpeg): 273996 bytes

2018-05-24 00:07:50.749 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 180640 bytes to raw type (image/jpeg): 179364 bytes

2018-05-24 00:07:52.778 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 273996 bytes to raw type (image/jpeg): 176668 bytes

2018-05-24 00:07:55.754 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 179364 bytes to raw type (image/jpeg): 178844 bytes

2018-05-24 00:07:57.854 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 176668 bytes to raw type (image/jpeg): 273276 bytes

2018-05-24 00:08:00.735 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 178844 bytes to raw type (image/jpeg): 178332 bytes

2018-05-24 00:08:01.870 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 273276 bytes to raw type (image/jpeg): 274484 bytes

2018-05-24 00:08:05.763 [vent.ItemStateChangedEvent] - CamFG_IMG changed from raw type (image/jpeg): 178332 bytes to raw type (image/jpeg): 180072 bytes

2018-05-24 00:08:06.845 [vent.ItemStateChangedEvent] - CamBG_IMG changed from raw type (image/jpeg): 274484 bytes to raw type (image/jpeg): 273984 bytes

@japhias
Yes it looks like it is working and it is fine to ignore the error for the videoURL which is not used currently.
I will need some examples of what your camera outputs, and learning from the last few days, I think it is best I give you the links to use in a browser even though they are in the binding already. Once I get some example output I can add more functionality. At the moment you may find some features work if you move the controls and watch the cameras setup.

@gman

This error explains the reason is the camera replies with NULL when asked for a snapshot url.

Camera failed to report a valid Snaphot URL, try over-riding the Snapshot URL auto detection by entering a known URL.

If you enter in a URL manually for the camera it will skip this and it may allow the camera to come online. If the camera does not have PTZ features then just set it up as a HTTPONLY thing. It will make life easier if you only watch openhab.log and not all the log files.

You do not need to flip the switch anymore unless your cameras do not work with the auto URL for checking the motion alarm. There are two URLS so one is sent automatically and the other is still on the test button. Check if the enable/disable switch is sitting at the ON position, then the motion switch should move when the alarm is detected. If the switch is off then it means you need to enable it in the cameras setup as the binding can not enable/disable the alarm yet.

Yes, this is why the binding has the ability to stop the image from updating unless an event occurs. You find this in paperUI by pressing the pencil icon.

You’re right, adding an Over-ride does allow the camera to come online, but I don’t know a snapshot url for this camera, only rtsp stream. So I’ll have to wait for that addition to the binding to be able to get screenshots from the camera, correct?

@Yura_Qenf
Currently your camera is not compatible with the binding, it misses the content-length before sending the image. I’ll create an issue on github regarding this to see how many cameras do this.

@toroid
Thank you, I will look at this soon, please be patient as I may have a few nights off.

@ArsalanAlli
Yes the binding defaults to polling every 5000 milli seconds, try setting it to 1000 or a lower valve that works as it may be possible to flood some cameras with too many requests or to create a load on your openhab servers CPU.

@gman
Yes or you may be able to use a script to turn the rtsp into a snapshot, but it may be simply easier to use Motion, Zoneminder or blueiris to do this for you. I have not used those programs so not sure which ones can do it.
edit: Here are some example scripts that people are using

New build 24-05-2018 has following changes:

  • HIKVISION only, New channel for line crossing alarm.
  • Backend changes to make multiple motion alarms possible, may cause issues in other brands but is testing fine on AMCREST.

@japhias
Using any web browser please enter these addresses corrected for your camera. Please enable basic or digest auth in the cameras settings as I don’t like to use urls in plain text if the camera supports another way. If you need to adjust the URL to get it to work please post what you changed and also what comes up in the browser. Feel free to send by PM or in github issue as that makes it easier to find.

Check if audio alarm is happening

http://192.168.178.88/cgi-bin/hi3510/param.cgi?cmd=getaudioalarmattr

enable/disable motion alarm

http://192.168.1.2/cgi-bin/hi3510/param.cgi?cmd=setmdattr&-enable=1

http://192.168.1.2/cgi-bin/hi3510/param.cgi?cmd=setmdattr&-enable=0

enable/disable the audio alarm

http://192.168.178.88/cgi-bin/hi3510/param.cgi?cmd=setaudioalarmattr&-aa_enable=1

http://192.168.178.88/cgi-bin/hi3510/param.cgi?cmd=setaudioalarmattr&-aa_enable=0

set the audio alarm threshold to 50

http://192.168.178.88/cgi-bin/hi3510/param.cgi?cmd=setaudioalarmattr&-aa_enable=1&-aa_value=50

Yes the binding defaults to polling every 5000 milli seconds, try setting it to 1000 or a lower valve that works as it may be possible to flood some cameras with too many requests or to create a load on your openhab servers CPU.

@matt1i have lower the value of refreshinterval but there is still some delay present in motion alarm detection…well I am emphasising on delay so much is due to the fact that I have also used node.js script from ragingcomputer.com, u might have heared about that script…it detects the motion instantly…can we achsieve that kind of speed in alarm triggering…sorry if am asking too much here…U have done a great job in enabling us to control our cameras via binding…

Thanks for the improvements,
I haven’t checked how it works yet.
But immediately there is one desire.
Perhaps we should add a text item where we indicate which signal is working.
Simply, several types of smart Analytics can be enabled on the camera at the same time.

Matt, I created a github issue with the results.

Hi all

I’m very newbie in OH, my camera is a SANNCE I21AC and it support ONVIF, I can see live video with ONVIF Device Manager.
Ipcamera binding detect it and show ONLINE status but show these errors:

2018-05-24 13:36:33.987 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Fetching the number of Media Profile this camera supports.
2018-05-24 13:36:37.777 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Checking the selected Media Profile is a valid number.
2018-05-24 13:36:37.780 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Fetching a Token for the selected Media Profile.
2018-05-24 13:36:37.782 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Auto fetching the snapshot URL for the selected Media Profile.
2018-05-24 13:36:41.387 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - About to fetch some information about the Media Profiles from the camera
2018-05-24 13:36:41.390 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 0 details reported by camera at IP:192.168.1.23 *********************
2018-05-24 13:36:41.392 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the binding by pressing on the pencil icon in PaperUI.
2018-05-24 13:36:41.394 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:VideoEncoderConfiguration_000
2018-05-24 13:36:41.396 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder	:H_264
2018-05-24 13:36:41.398 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality	:1.0
2018-05-24 13:36:41.400 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion	:1280 x 720
2018-05-24 13:36:41.401 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate	:1024
2018-05-24 13:36:41.403 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 1 details reported by camera at IP:192.168.1.23 *********************
2018-05-24 13:36:41.404 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:VideoEncoderConfiguration_001
2018-05-24 13:36:41.405 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder	:H_264
2018-05-24 13:36:41.406 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality	:1.0
2018-05-24 13:36:41.408 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion	:640 x 360
2018-05-24 13:36:41.409 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate	:512
2018-05-24 13:36:41.410 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - About to interrogate the camera to see if it supports PTZ.
2018-05-24 13:37:19.205 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Camera is reporting it supports PTZ controls via ONVIF
2018-05-24 13:37:19.209 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Pan  from -1.0 to 1.0
2018-05-24 13:37:19.211 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Tilt from -1.0 to 1.0
2018-05-24 13:37:19.213 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - The camera can Zoom from -1.0 to 1.0
2018-05-24 13:37:22.619 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Camera replied with null when asked what its position was, going to fake the position so PTZ still works.
2018-05-24 13:37:22.622 [INFO ] [ing.ipcamera.handler.IpCameraHandler] - Finished with PTZ, now fetching the Video URL's the camera supports.
2018-05-24 13:37:31.061 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.1.23
2018-05-24 13:37:31.739 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/snapshot.cgi:
2018-05-24 13:37:31.866 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - 401: This reply from the camera is normal if it needs Basic or Digest auth details.
2018-05-24 13:37:31.882 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.1.23
2018-05-24 13:37:31.902 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - + The request is going to be GET:/snapshot.cgi:
2018-05-24 13:37:31.934 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: failure(java.lang.IllegalArgumentException: a header name cannot contain the following prohibited characters: =,;: \t\r\n\v\f: ,), version: HTTP/1.1)
HTTP/1.1 200 OK
Server: GoaHead
2018-05-24 13:37:32.085 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 401 Unauthorized
Server: GoAhead-Webs
Date: Mon May  7 15:25:00 2018
WWW-Authenticate: Digest realm="WIFICAM", domain=":17498",qop="auth", nonce="e68757ec4fcc787f47f347a968564fc4", opaque="5ccc069c403ebaf9f0171e9517f40e41",algorithm="MD5", stale="FALSE"
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
2018-05-24 13:37:32.103 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 178, cap: 178/178, unwrapped: PooledUnsafeDirectByteBuf(ridx: 515, widx: 515, cap: 1024)), decoderResult: success)
2018-05-24 13:37:32.109 [DEBUG] [ing.ipcamera.handler.IpCameraHandler] - Trying to connect with 

I provide user and password in ONVIF Thing Configuration Parameters and not use any of prohibited characters: =,;: \t\r\n\v\f: ,),

How may I include a video or image in a sitemap, something like this?

Image url="http://google.com/leaveLinkAsThis" item=ONVIFGenericIPCameraWithONVIFSupport_ImageURL refresh=5000

Video url="http://google.com/leaveLinkAsThis" item=ONVIFGenericIPCameraWithONVIFSupport_VideoURL encoding="mjpeg"

Thanks a lot.
Luis

same question for me.

@matt1 The line crossing detector can’t be turned on separately from the motion detector now.
And if you turn on the motion detector is not particularly clear it turns out which one of them works

I found one interesting document - I think he will help you

https://drive.google.com/open?id=18pJMRMizd1_CPjCDxLAb-PW3lWbXuDvr

@ArsalanAlli Yes it is clearly possible if a script is doing it. If my understanding is correct I can see two ways to make improvements, but there are many areas that could be improved that benefit more brands of cameras and it is a matter of how much I do when I don’t get paid and I don’t even own one of those cameras.

@japhias

Thanks I’ll take a look when I get some time and reply on the github thread.

@Luis_Gonzalez1
Try updating the firmware for your camera. The netty library is reporting the camera uses illegal characters in the header of replies, it is not something that you are doing wrong. Report it to your camera support.

See the readme file which is found with the jar files, and at github. A full example is there. You need to get a picture showing in PaperUI first before it will work in the sitemap.

@toroid
There was no point putting a switch in when it would not work until the feature I already mentioned to you prevents the control from working. Changing any setting in a HIK camera needs extra features added to the binding before it can be added as a feature.

@matt I want to add not a switch but a text field that displays the last log event.
In the future, you can use the openhab rules already for those who need to add switches to those who need them. In the text box, display the type “motiondetect active” or other event camera records.

@matt1 Time to time my camera is displaying this message.

Camera at 172.29.8.70:80 is not closing the connection quick enough.

Any idea !!

New build 26-05-2018:

  • New changes for INSTAR only, other cameras should see no change.

Not sure how this would work if the camera sends two events at the same time, you would only see the second alarm and miss the first. I do like the idea, for people who wish to have a String that lists the last event and the time that it occured, the picture then shows what the camera saw when the last event went off.
https://github.com/Skinah/IpCamera/issues/6

That is nothing to be worried about and I see it every now and then with my camera. When I upgrade the binding to go fully async a lot of things like this will change.

Hi Matt,

Maybe this problem has been noticed before, but i cant seem to get a good connection to my IPcam.
I added the binding and my camera as a thing. (status is “online”)
When i go to paper ui, I get the folowing:


Can you help me out? My goal is to get the feed in HabPanel.

Thanks,
Tom

Can you send me the debug log output please so I can take a look?

To change the log level:
1.Start Karaf
2.Enter in
log:set DEBUG org.openhab.binding.ipcamera

Then the file is openhab.log that contains what I need to fault find this. I will only need the section where the camera connects and then send the first few requests for the snapshot.

thanks.

I have an Axis camera and I can help testing. However it seems like Vapix is going to be decommissioned from Axis and replaced by WSDL - see link
I found some stuff about Axis WSDL here.