IpCamera: New IP Camera Binding

I just finished adding this ability with Amcrest cameras and I took a blind stab at Foscam but need a user to help check the reponse from a foscam to fully finish that feature off on that brand.

Another approach with other brands of cameras with no API would be to disable all email sending from the camera and hand that task over to openhab. I dont like that approach as much as I like spreading the load of tasks around devices so that when openhab goes down you do not loose “all your eggs in the one basket”. By buying a camera with an API you get more abilities.

New build 22-04-2018 has following changes:

  • Image channel is now working, you can see a picture that auto updates in PaperUI. Your camera needs to reply with a snapshot URL for this to work, please post if your camera does not fill in the imageurl channel with a link as I may need to provide a manual field to enter this in for cameras that don’t auto find what is needed.

  • Motion enable and disable is added for Amcrest and Foscam with the latter needing testing and feedback before it will fully work.

Tested version 2.3.0.201804221426 with one of my Foscam C1 cameras.
Everything seems to work, nice job @matt1!

08:31:16.503 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from UNINITIALIZED to INITIALIZING
08:31:16.510 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to connect to IP Camera at IP:192.168.200.199:888
08:31:26.908 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to fetch the Media Profile list from the camera
08:31:31.681 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 0 details reported by camera at IP:192.168.200.199 *********************
08:31:31.689 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the binding by pressing on the pencil icon in PaperUI.
08:31:31.691 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:videoencoder_name0
08:31:31.693 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder       :H_264
08:31:31.694 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality       :3.0
08:31:31.703 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion     :1280 x 720
08:31:31.710 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate       :2034
08:31:31.713 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 1 details reported by camera at IP:192.168.200.199 *********************
08:31:31.721 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:videoencoder_name1
08:31:31.728 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder       :H_264
08:31:31.744 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality       :3.0
08:31:31.746 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion     :320 x 180
08:31:31.748 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate       :100
08:31:45.419 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF
08:31:45.426 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from INITIALIZING to ONLINE

Image SufraCAM_Image (gTest) {channel="ipcamera:FOSCAM:1d342744:image"}
String SufraCAM_ImageURL (gTest) {channel="ipcamera:FOSCAM:1d342744:imageurl"}
String SufraCAM_VideoURL (gTest) {channel="ipcamera:FOSCAM:1d342744:videourl"}
>items list Sufra*
SufraCAM_Image (Type=ImageItem, State=raw type (image/jpeg): 58776 bytes, Label=null, Category=null, Groups=[gTest])
SufraCAM_ImageURL (Type=StringItem, State=http://192.168.200.199:88/cgi-bin/CGIProxy.fcgi?usr=XXXXX&pwd=XXXXXXXX&cmd=snapPicture2, Label=null, Category=null, Groups=[gTest])
SufraCAM_VideoURL (Type=StringItem, State=rtsp://192.168.200.199:554/videoMain, Label=null, Category=null, Groups=[gTest])
>

LATER:
Can’t get motion detection to work though…
The switch item I linked to the corresponding channel doesn’t switch to ON…
I’ll enable DEBUG and investigate further…

LATER2:
Nothing in the log regarding motion…

openhab> list -s | grep ipcamera
268 │ Active   │  80 │ 2.3.0.201804221426     │ org.openhab.binding.ipcamera
openhab> log:set DEBUG org.openhab.binding.ipcamera
openhab> log:tail
10:26:40.361 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Camera dispose called, about to remove the Camera thing.
10:26:40.361 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1dccb33f' changed from ONLINE to UNINITIALIZED
10:26:40.412 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Camera dispose called, about to remove the Camera thing.
10:26:40.445 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1dccb33f' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
10:26:40.491 [DEBUG] [org.openhab.binding.ipcamera         ] - ServiceEvent UNREGISTERING - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=473, service.bundleid=268, service.scope=bundle, component.name=org.openhab.binding.ipcamera.internal.IpCameraHandlerFactory, component.id=297} - org.openhab.binding.ipcamera
10:26:40.534 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from ONLINE to UNINITIALIZED
10:26:40.747 [DEBUG] [org.openhab.binding.ipcamera         ] - BundleEvent STOPPING - org.openhab.binding.ipcamera
10:26:40.794 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
10:26:40.838 [DEBUG] [org.openhab.binding.ipcamera         ] - BundleEvent STOPPED - org.openhab.binding.ipcamera
10:26:40.936 [DEBUG] [org.openhab.binding.ipcamera         ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=474, service.bundleid=268, service.scope=bundle, component.name=org.openhab.binding.ipcamera.internal.IpCameraHandlerFactory, component.id=298} - org.openhab.binding.ipcamera
10:26:41.165 [DEBUG] [org.openhab.binding.ipcamera         ] - BundleEvent STARTING - org.openhab.binding.ipcamera
10:26:41.219 [DEBUG] [org.openhab.binding.ipcamera         ] - BundleEvent STARTED - org.openhab.binding.ipcamera
10:26:41.322 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Getting configuration to initialize an IP Camera.
10:26:41.323 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1dccb33f' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
10:26:41.367 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - Getting configuration to initialize an IP Camera.
10:26:41.356 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to connect to IP Camera at IP:192.168.200.198:888
10:26:41.429 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to connect to IP Camera at IP:192.168.200.199:888
10:26:41.397 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
10:26:53.421 [ERROR] [.sun.xml.internal.messaging.saaj.soap] - SAAJ0601.util.newSAXParser.exception
10:26:53.455 [ERROR] [xml.internal.messaging.saaj.soap.impl] - SAAJ0250: Cannot extract Document from body
10:26:53.488 [ERROR] [ding.ipcamera.handler.IpCameraHandler] - Camera gave a SOAP exception during the 30 second poll
10:26:55.212 [ERROR] [.sun.xml.internal.messaging.saaj.soap] - SAAJ0601.util.newSAXParser.exception
10:26:55.300 [ERROR] [xml.internal.messaging.saaj.soap.impl] - SAAJ0250: Cannot extract Document from body
10:26:55.403 [ERROR] [ding.ipcamera.handler.IpCameraHandler] - Camera gave a SOAP exception during the 30 second poll
10:26:57.255 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to fetch the Media Profile list from the camera
10:26:57.336 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - About to fetch the Media Profile list from the camera
10:27:06.466 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 0 details reported by camera at IP:192.168.200.199 *********************
10:27:06.566 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the binding by pressing on the pencil icon in PaperUI.
10:27:06.673 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:videoencoder_name0
10:27:06.702 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder       :H_264
10:27:06.731 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality       :3.0
10:27:06.760 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion     :1280 x 720
10:27:06.765 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 0 details reported by camera at IP:192.168.200.198 *********************
10:27:06.791 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate       :2034
10:27:06.836 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera will use this Media Profile unless you change it in the binding by pressing on the pencil icon in PaperUI.
10:27:06.864 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 1 details reported by camera at IP:192.168.200.199 *********************
10:27:06.910 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 is named:videoencoder_name0
10:27:06.954 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:videoencoder_name1
10:27:06.984 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video encoder       :H_264
10:27:07.013 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder       :H_264
10:27:07.041 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video quality       :3.0
10:27:07.070 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality       :3.0
10:27:07.098 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video resoltion     :1280 x 720
10:27:07.126 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion     :320 x 180
10:27:07.157 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 0 uses video bitrate       :2048
10:27:07.217 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - ********************* Media Profile 1 details reported by camera at IP:192.168.200.198 *********************
10:27:07.187 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate       :100
10:27:07.266 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 is named:videoencoder_name1
10:27:07.330 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video encoder       :H_264
10:27:07.360 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video quality       :3.0
10:27:07.390 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video resoltion     :320 x 240
10:27:07.422 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Media Profile 1 uses video bitrate       :200
10:27:33.276 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This camera supports the following Video links. NOTE: The camera may report a link or error that does not match the header, this is the camera not a bug in the binding.
10:27:33.338 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This camera supports the following Video links. NOTE: The camera may report a link or error that does not match the header, this is the camera not a bug in the binding.
10:27:34.227 [INFO ] [smarthome.event.ItemStateChangedEvent] - Date changed from 2018-04-23T10:26:34.204+0300 to 2018-04-23T10:27:34.205+0300
10:27:52.059 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - HTTP Stream:rtsp://192.168.200.199:554/videoMain
10:27:52.137 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - HTTP Stream:rtsp://192.168.200.198:554/videoMain
10:28:05.546 [INFO ] [smarthome.event.ItemStateChangedEvent] - HEM_Power changed from 240.539 to 242.259
10:28:08.347 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - TCP Stream:rtsp://192.168.200.199:554/videoMain
10:28:08.903 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - TCP Stream:rtsp://192.168.200.198:554/videoMain
10:28:23.473 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - RTSP Stream:rtsp://192.168.200.199:554/videoMain
10:28:24.416 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - RTSP Stream:rtsp://192.168.200.198:554/videoMain
10:28:38.912 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - UDP Stream:rtsp://192.168.200.199:554/videoMain
10:28:39.504 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - UDP Stream:rtsp://192.168.200.198:554/videoMain
10:28:45.911 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF
10:28:45.955 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1d342744' changed from INITIALIZING to ONLINE
10:28:46.595 [INFO ] [ding.ipcamera.handler.IpCameraHandler] - Camera is reporting that it does NOT support Absolute PTZ controls via ONVIF
10:28:46.641 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'ipcamera:FOSCAM:1dccb33f' changed from INITIALIZING to ONLINE
10:28:50.966 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - The request is going to be :/cgi-bin/CGIProxy.fcgi?usr=XXXXXX&pwd=XXXXXX&cmd=snapPicture2
10:28:51.170 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This reponse from camera contains :image/jpeg:
10:28:51.183 [INFO ] [smarthome.event.ItemStateChangedEvent] - Total_Radiation changed from 536.42 to 548.14
10:28:51.226 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This reponse from camera is 76333 bytes long
10:28:51.675 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - The request is going to be :/cgi-bin/CGIProxy.fcgi?usr=XXXXXX&pwd=XXXXXX&cmd=snapPicture2
10:28:51.809 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_Image changed from raw type (image/jpeg): 75038 bytes to raw type (image/jpeg): 76333 bytes
10:28:52.436 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This reponse from camera contains :image/jpeg:
10:28:52.492 [DEBUG] [ding.ipcamera.handler.IpCameraHandler] - This reponse from camera is 73684 bytes long

LATER3:
More details…
I tried to add the switch to enable/disable the motion alarm and it throws some errors.
Looks like the binding tried to connect to standard HTTP port (80), but I had my cameras use a different port - in my case 88 (ONVIF port is 888, RTSP = 554, HTTP = 88, HTTPS = 443).
Maybe the HTTP port should be configurable in the thing properties?

10:51:01.594 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link 'SufraCAM_MotionAlarmEnabled-ipcamera:FOSCAM:1d342744:enableMotionAlarm' has been added.
10:51:01.761 [ERROR] [home.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: Connection refused: /192.168.200.198:80
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.200.198:80
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:?]
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:325) ~[268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:633) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.ConnectException: Connection refused
        ... 11 more
10:51:01.670 [ERROR] [home.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: Connection refused: /192.168.200.199:80
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.200.199:80
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:?]
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:325) ~[268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:633) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.ConnectException: Connection refused
        ... 11 more
10:53:30.245 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'SufraCAM_MotionAlarmEnabled' received command ON
10:53:30.269 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.ipcamera.handler.IpCameraHandler@af5456': Connection refused: /192.168.200.199:80
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.200.199:80
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:?]
        at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:325) ~[268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:633) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [268:org.openhab.binding.ipcamera:2.3.0.201804221426]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.ConnectException: Connection refused
        ... 11 more
10:53:30.303 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarmEnabled changed from NULL to ON

LATER4: :smile:

Maybe the HTTP port should be configurable in the thing properties?

@matt1, ONVIF Device Manager correctly identifies the HTTP port, so maybe you could use that (and HTTPS)…
image

2 Likes

I just added port as a config item. Takes five minutes to do that compared to 20 hours to add auto find and add camera features. In the middle of tracking a bug down in some new features so can’t do a build till they r working. Soon.

New build 24-04-2018 has new changes:

  • Changed digest auth handling a lot which may make things faster for some cameras.
  • Added ability to change the port. Have an auto detect feature idea to try, detect the port used in the snapshot link the camera reports back it supports. Defaults to port 80 which is standard http port.
  • Added ability for non ONVIF cameras to use this binding if they have a http/s link to fetch a snapshot.
  • More debug output into the logs added. Until I hear it works on a number of cameras I will leave a lot of log traffic turned on.

Testing latest version(2.3.0.201804240539)…

Connection to the configured HTTP port working (as I said, in my case is the HTTP port is 88).
However, motion still not working.
As far as I can see, there is a problem calling getDevState… The binding does not use the credentials:

24-Apr-2018 10:18:47.735 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler added
24-Apr-2018 10:18:47.735 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler removed
24-Apr-2018 10:18:47.741 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - +++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState:
24-Apr-2018 10:18:47.836 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Tue, 24 Apr 2018 07:18:47 GMT
Server: lighttpd/1.4.35
24-Apr-2018 10:18:47.837 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 51, cap: 51/51, unwrapped: PooledUnsafeDirectByteBuf(ridx: 211, widx: 216, cap: 1024)), decoderResult: success)
24-Apr-2018 10:18:47.837 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>-2</result>
</CGI_Result>
:
24-Apr-2018 10:18:47.838 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
24-Apr-2018 10:18:47.839 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
24-Apr-2018 10:18:47.839 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - -------------- Binding closing channel --------------

The request should be /cgi-bin/CGIProxy.fcgi?usr=XXXXX&pwd=XXXXXXX&cmd=getDevState

Not the case when the binding is handling the auth using the BASIC method. Trust me the plain text password and user is not needed as your log shows the camera replied with 200 OK so it is working.
What is probably not working is the message is chunked and I have not tested that part of the binding.

FYI
The way you posted is unsecure as the password is in plain text and my binding wont do that.
The binding uses base64 encoding which is not secure either but WAY BETTER than plain text.
HTTPS should be used for cameras that either use plain text or base64 passwords which I will look at https at some point.

Does anything work? do you see a picture in the image channel?

thanks for helping out with the testing.

Yes, it does work!
Only the motion part is not … :smile:

Of course, I cannot get into an argument with you on that.
It’s only that I saw in the Foscam API that a CGI_Result of -2 means: Username or password error
Also, when getting the picture from the camera you are using authentication:

24-Apr-2018 10:39:12.204 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - +++ The request is going to be :/cgi-bin/CGIProxy.fcgi?usr=XXXX&pwd=XXXXXXXX&cmd=snapPicture2

What do you mean the way I posted?
I just copy/paste from the log and edit the username and password…

OK thanks for clarifying.
The link for the picture actually gets reported by the camera, it is not one I hard coded into the binding. Which that is why it is working fine :slight_smile:

The result -2 shows the chunked is not an issue so you are correct it must be the camera requires the plain text in the link and the standard BASIC auth does not work…

can you try this link in a browser please?

http://user:pass@IP:PORT/cgi-bin/CGIProxy.fcgi?cmd=getDevState 

Does it give -2 result?

Using http://XXXXX:XXXXX@192.168.200.199:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState in Chrome on Win8.1 gave me the same -2 result…

Here are some result from curl:

openhab@openHAB:~$ curl "http://XXXXX:XXXXX@192.168.200.199:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState"
<CGI_Result>
    <result>-2</result>
</CGI_Result>
openhab@openHAB:~$ curl "http://192.168.200.199:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState"
<CGI_Result>
    <result>-2</result>
</CGI_Result>
openhab@openHAB:~$ curl "http://192.168.200.199:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX"
<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXXXXXXXXXXXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
openhab@openHAB:~$

Just uploaded a newer version that should (cross fingers) work.
Please check that when the camera comes online that the enable/disable control updates and shows correct state. Then when movement is the channel should trigger and reset correctly.

Thanks for your help testing as that output was perfect and what I needed.

Testing 2.3.0.201804241146… Motion is working:

16:07:10.939 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarm changed from OFF to ON

Corresponding log from the binding (motion detection was enabled from previous test):

24-Apr-2018 16:07:30.644 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler removed
24-Apr-2018 16:07:30.672 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler added
24-Apr-2018 16:07:30.704 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - +++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
24-Apr-2018 16:07:31.214 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Tue, 24 Apr 2018 13:07:28 GMT
Server: lighttpd/1.4.35
24-Apr-2018 16:07:31.214 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
24-Apr-2018 16:07:31.217 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>2</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>1</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXXXXXXXXXXXXXXXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXXXXXXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
24-Apr-2018 16:07:31.219 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
24-Apr-2018 16:07:31.220 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
24-Apr-2018 16:07:31.220 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - -------------- Binding closing channel --------------

Good job, @matt1 - at least for Foscam C1 cameras is working fine!

Thanks, it is always good to hear how things are working for others especially as I only own a single camera whilst I test out the one I have before buying more. Not sure which brand I will go for yet so hence why I like to hear about how other peoples cameras are working.

Does your camera have audio alarm working via the binding? You may need to turn the feature on manually first using the API in a browser. Not sure what cameras support what but your C1 camera does have a mic.

New build 25-04-2018:

  • Newer netty 4.1.24 as previous version had a memory leak in the library which I spent days thinking it was my code hunting for it. Lot of wasted time.
  • Amcrest now has audio alarm channel which works great on my cam. Cant reach threshold via API, so it needs to be set via web direct to cam.
  • Added some of the work to get HTTPS working, but please ignore the controls as it is not done yet. Feedback is welcome on how it is presented to the user. Switch will ensure all traffic goes to https or http. My camera slows down heaps when I use https so not sure I will enable it on my setup as I have digest auth working.

I now have the bare features working that I need to get my own setup working as a baby monitor and security cameras outside. Going to trial using this in rules sending notifications to my TV via kodi and also turning lights on to a low level of light when a baby crys to use as a nightlight and things like that.

Amcrest has 15-17 second reset times on the alarms.
Foscam has 60 second reset times AFAIK.

Yes, the sound alarm is working too!
I have a problem with the previous build of the binding (2.3.0.201804241146). I seems that, when loosing connection to the camera (one reason or another) it doesn’t try to reconnect…

    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXXXXXXXXX</wifiConnectedAP>
    <infraLedState>1</infraLedState>
</CGI_Result>
:
25-Apr-2018 04:00:36.490 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
25-Apr-2018 04:00:36.490 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
25-Apr-2018 04:00:36.490 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - -------------- Binding closing channel --------------
25-Apr-2018 04:00:36.491 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler removed
25-Apr-2018 04:00:39.704 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler added
25-Apr-2018 04:00:40.777 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler added
25-Apr-2018 04:00:49.705 [ERROR] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Can not connect to the camera at 192.168.200.199:88 check your network for issues or change cameras settings.
25-Apr-2018 04:00:49.710 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler removed
25-Apr-2018 04:00:50.778 [ERROR] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Can not connect to the camera at 192.168.200.198:88 check your network for issues or change cameras settings.
25-Apr-2018 04:00:50.789 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - *** Handler removed

The camera rebooted at that time (not sure why) and came back online 4 minutes later, at 04:04. As you can see, the binding tried to reconnect only 2 times an then gave up. I’ll need to restart the binding or openHAB itself. Maybe you can find a way to retry the connection… mmmm… every minute or something like this?

The channel Enable/Disable the Motion Alarm is very useful, of course. Could you implement also one to enable/disable the audio alarm?

Also, could the binding pull the status of this channels? Right now, if you restart the binding, the Enable/Disable the Motion Alarm switch is set to OFF even if you previously set it to ON or you enabled the motion alarm from browser/camera app

The binding already had half this feature implemented using the link below. I was needing someone to report what the camera returns, however when I just checked the code I noticed I can already use the existing alarm polling to work out if it is on or off, next build should work. There is a chance that when you move the control the camera is part way through replying and flip the switch on you, so it may be better to use the link below, let me know. Doing it the way in the next build the enable/disable channel will be updated way more often and if you change it via a webpage or camera app, it should then follow. I suspect it will be a trade off…

http://192.168.200.199:88/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=username&pwd=password

Done, I can not do this for amcrest as I looked and it appears to not be possible. The same goes for enabling and disabling audio alarm for amcrest although this kind of thing is easy to implement with openhab rules. Each time I add a feature I am looking at multiple brands and working out the best way to keep things consistant. Amcrest has a way to global disable the camera sending emails ON and OFF. Foscam has it as well, so can you test this please? change the 1 to a 0 to disable the emails and of course add the user/pass to the end.

/cgi-bin/CGIProxy.fcgi?cmd=setSMTPConfig&isEnable=1

Regarding the ONLINE/OFFLINE when network has an issue, that is because I am only half way through adding that feature, a few days ago it would ignore network issues and stay online. Doing a lot of work on cleaning that side of things up at the moment. If you change a setting for an online camera the later builds now reconnect and use the newer settings.

New build 29-04-2018 has these changes:

  • New UI changes to group settings better.
  • New ability to stop updating the image channel to reduce bandwidth used by binding.
  • Fixed some more disconnect and reconnect issues.
  • Better online and offline detection for http cameras.
  • More audio alarm features. Foscam got a new channel.
  • Changed the default port numbers for Foscam.

You may need to delete and re-add your things to see new channels and new configuration settings.

Hi @DubZ,
Have not done much looking into 2 way audio until today but this seems to be the next major thing to look at as I have a working picture and all other features I need are also working, but no audio. 2 way audio is something that may involve a lot of time and require careful consideration on how to implement compared to what I have done so far. WebRTC looks good and worth investigating so thanks for the heads up as it is opensource with google behind it with features like noise cancelling.

I started a thread at github to discuss the features and what people want to see. I’ll probably wait for comments for a few weeks/months and then start coding. Do you see point to point support as enough or will I need to find a way that supports sending the mic from 1 camera to play on multiple tablets at the same time?

Place to speak about the feature out of this thread to keep this thread cleaner…

https://github.com/Skinah/IpCamera/issues/1

Sorry for not replying sooner… was out of town for a few days…
Testing 2.3.0.201804291225

  • enableAudioAlarm works properly. I can enable/disable the audio alarm properly. Didn’t see audioAlarm triggered though, but I have to test this further.
  • setting thresholdAudioAlarm to an arbitrary value seems to disable the audio alarm:
08:37:17.883 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'SufraCAM_AudioAlarmThreshold' received command 62
08:37:17.911 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_AudioAlarmThreshold changed from 0 to 62
02-May-2018 08:37:17.055 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:37:17.063 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:37:17.323 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:37:24 GMT
Server: lighttpd/1.4.35
02-May-2018 08:37:17.323 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
02-May-2018 08:37:17.324 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>1</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
02-May-2018 08:37:17.327 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:37:17.329 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:37:17.884 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:37:17.900 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=setAudioAlarmConfig&sensitivity=1&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:37:17.991 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:37:24 GMT
Server: lighttpd/1.4.35
02-May-2018 08:37:17.992 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 50, cap: 50/50, unwrapped: PooledUnsafeDirectByteBuf(ridx: 210, widx: 215, cap: 1024)), decoderResult: success)
02-May-2018 08:37:17.992 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
</CGI_Result>
:
02-May-2018 08:37:17.992 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:37:17.993 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:37:22.056 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:37:22.067 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:37:22.348 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:37:29 GMT
Server: lighttpd/1.4.35
02-May-2018 08:37:22.349 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
02-May-2018 08:37:22.537 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>0</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
02-May-2018 08:37:22.539 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:37:22.539 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
  • There seems to be something fishy with the detection of the enableMotionAlarm channel… It flips when detecting motion:
08:22:07.465 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarm changed from OFF to ON
08:22:07.474 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarmEnabled changed from OFF to ON
08:22:12.348 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarm changed from ON to OFF
08:22:12.357 [INFO ] [smarthome.event.ItemStateChangedEvent] - SufraCAM_MotionAlarmEnabled changed from ON to OFF
02-May-2018 08:22:02.394 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:22:07.055 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:22:07.073 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:22:07.456 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:22:14 GMT
Server: lighttpd/1.4.35
02-May-2018 08:22:07.457 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
02-May-2018 08:22:07.458 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>2</motionDetectAlarm>
    <soundAlarm>1</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
02-May-2018 08:22:07.460 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:22:07.462 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:22:12.055 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:22:12.065 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:22:12.341 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:22:19 GMT
Server: lighttpd/1.4.35
02-May-2018 08:22:12.342 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
02-May-2018 08:22:12.343 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>1</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
02-May-2018 08:22:12.345 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:22:12.345 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:22:17.056 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199
02-May-2018 08:22:17.064 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - ++ The request is going to be :/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=XXXXX&pwd=XXXXX:
02-May-2018 08:22:17.563 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Transfer-Encoding: chunked
Date: Wed, 02 May 2018 05:22:24 GMT
Server: lighttpd/1.4.35
02-May-2018 08:22:17.564 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - DefaultHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 528, cap: 528/528, unwrapped: PooledUnsafeDirectByteBuf(ridx: 689, widx: 694, cap: 1024)), decoderResult: success)
02-May-2018 08:22:17.565 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is :<CGI_Result>
    <result>0</result>
    <IOAlarm>0</IOAlarm>
    <motionDetectAlarm>1</motionDetectAlarm>
    <soundAlarm>1</soundAlarm>
    <record>0</record>
    <sdState>0</sdState>
    <sdFreeSpace>0k</sdFreeSpace>
    <sdTotalSpace>0k</sdTotalSpace>
    <ntpState>0</ntpState>
    <ddnsState>0</ddnsState>
    <url>XXXXX</url>
    <upnpState>0</upnpState>
    <isWifiConnected>1</isWifiConnected>
    <wifiConnectedAP>XXXXX</wifiConnectedAP>
    <infraLedState>0</infraLedState>
</CGI_Result>
:
02-May-2018 08:22:17.567 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - EmptyLastHttpContent
02-May-2018 08:22:17.568 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - HTTP Result back from camera is ::
02-May-2018 08:22:22.055 [DEBUG] [g.openhab.binding.ipcamera.handler.IpCameraHandler] - Trying to connect with new request for camera at IP:192.168.200.199

I’m not using my Foscam cameras to send emails in case of alarms. Right now, that option is disabled. The motion and/or audio alarms work without this. So, enabling/disabling won’t effect the motion/audio alarms.

New Build 02-05-2018 following changes:

  • Fixed two issues listed below. The rest should be the same.

OK I made a change, I added isenabled to the request, which will mean if you move the threshold it will enable the alarm. We will call it a feature as it was a quick way to hopefully get it fixed.

Found and fixed a bug, my fault for cutting and pasting too much late into the night.

Thanks for reporting.