IpCamera: New IP Camera Binding

Yes but I don’t use habpanel yet, have a tablet ready to play with it soon.

Can you give me an example on how to set it up as HTTPONLY.
Browsing foscam, there is a specific URL for fetching jpg snapshot:

http://ip address:port/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=admin&pwd=xxx

How would this be setup in the ipcamera.things file?

try this, but I suspect the url is wrong as that is for HD foscams. This link may have one that works, but please try entering it into a browser first to prove that the url works.

Thing ipcamera:HTTPONLY:002 [ IPADDRESS="", PASSWORD="suitcase123456", USERNAME="admin", SNAPSHOT_URL_OVERIDE="", PORT=80]

Could be the above is for the newer HD cams. Foscam isn´t quite clear on this, since latest firmware is newer than the old mentioned methode.

The other options I found is using


resolution 320x240: http://ip:port/snapshot.cgi?&resolution=8
resolution 640x480: http://ip:port/snapshot.cgi?&resolution=32

These are from Foscam forum in a thread beeing 5 years old.
I guess I just have to try :smiley:

These are fully working url´s for Foscam FI8918W, (and probably same age Ipcameras from Foscam). In case others might be interested:


And this is URL for video stream: (not an option through the binding).

http://IP/videostream.cgi?user=admin&pwd=password" encoding="mjpeg"

This is the things file:

Thing ipcamera:HTTPONLY:001 [ IPADDRESS="IP adress", PASSWORD="password", USERNAME="admin", SNAPSHOT_URL_OVERIDE="http://IP adress/snapshot.cgi?usr=admin&pwd=password", PORT=80]


For anyone that gets OOME (out of memory errors) with the java heap space, then this is how I solved it to allow me to drop the refresh down to 1000ms. I have had my two cameras running for >24 hours without issues. I suspect this has to do with javas garbage collection not running often enough to deal with the large amounts of data passing through the image item if you are running your system close to the max allocated heap size.

In the openhab console run this command (optional just for your info)


It gives you output like this…

  Karaf version               4.1.5
  Karaf home                  /usr/share/openhab2/runtime
  Karaf base                  /var/lib/openhab2
  OSGi Framework              org.eclipse.osgi-3.12.50.v20170928-1321

  Java Virtual Machine        OpenJDK Client VM version 25.152-b76
  Version                     1.8.0_152
  Vendor                      Azul Systems, Inc.
  Pid                         418
  Uptime                      13 hours 15 minutes
  Total compile time          12 minutes
  Live threads                175
  Daemon threads              71
  Peak                        199
  Total started               6482
  Current heap size           183,100 kbytes
  Maximum heap size           243,520 kbytes
  Committed heap size         238,552 kbytes
  Pending objects             0
  Garbage collector           Name = 'Copy', Collections = 8778, Time = 4 minutes
  Garbage collector           Name = 'MarkSweepCompact', Collections = 437, Time = 7 minutes
  Current classes loaded      20,333
  Total classes loaded        20,509
  Total classes unloaded      176
Operating system
  Name                        Linux version 4.14.52-v7+
  Architecture                arm
  Processors                  4

Run this in linux to open the file for editing after typing in logout to exit the console. (required: this is changing the heap size)

sudo nano /etc/default/openhab2

Change the already existing line to have this if it is empty. The -Xmx512m gives the heaps more space to grow up to a max of 512mb. (required: this is changing the heap size)

EXTRA_JAVA_OPTS="-XX:+HeapDumpOnOutOfMemoryError -Xmx512m"

Save and exit using the commands listed at the bottom of the screen, then…

sudo reboot

Lastly you can check the ram usage with this command… (optional)

free -h

example output after doing the above and a reboot on a pi2 is

              total        used        free      shared  buff/cache   available
Mem:           976M        373M        374M        9.7M        228M        545M
Swap:           99M          0B         99M

1 Like

Still bombing out.

I can run one camera thing and corresponding image item. Refresh set to 2000ms. Works fine. If I add a second camera thing and item, even with refresh intervals sets set for 5000ms, it keels over and dies with heap space errors. Could this be an SD card issue? You’re able to do it just fine, so I’m inclined to believe there is something wrong on my end. All cameras are Hikvisions FYI.

Yes it could be SD card as corruption can cause any kind of problem with any symptom, however since you can get 1 going fine I would not go looking at that first.
What happens if you try only the 2nd camera by itself ? Unfortunately not all HIK cameras are the same due to hacked firmwares being very common, also they are all different Megapixel amounts.
You are going to have to try and narrow the cause down.
Is it only 1 camera that does it?
Does removing all other bindings allow it to work?
What java and hardware do you use? I know very little about your setup.

Best you open a new thread and post more details in it as any serious look into something like this needs a thread so things dont get lost amoung other peoples replys.

New Build 26-07-2018 has following changes:

  • Amcrest: fix for older firmwares that was stopping alarms from being seen.
  • Hikvision: fix for external alarm input feature.
  • Readme updated with better info and examples for items and sitemaps.

All other cameras should not be effected and if your working fine, no need to change.

Hello All,

i’m planning to buy Dahua ipcam with face detection but in any of API ( i found 1,67 newest - https://www.telecamera.ru/bitrix/components/bitrix/forum.interface/show_file.php?fid=1022477&action=download)

I can’t see any face detection part.


First of all many thanks for the effort to release such binding.

However i have a Hik Vision NVR, and i started the configuration to integrate the Cameras connected to the NVR with Openhab. At first i struggled to make them worked then after my several trials by changing some parameters i found that the cameras worked normally and i could configure 4 cameras. But later on i found them gone again. in the front tail logs this message keeps pop up

2018-08-01 21:58:16.878 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - !!! Channel was found idle but could not located it to close it down
2018-08-01 21:58:16.882 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can’t find ch when removing handler URL:null

The IP Cameras Things are all time online but am not able to see the images again.

Please help !!

First reboot your server, then with frontail do a search for warn and error as often things eariler on in the log can cause other things to break. Does a reboot fix it? If not then please feel free to send me some TRACE level log output via personal message to keep this thread cleaner and I can use that to look for any issues that may steam from something ‘unique’ that your camera does. The first post in this thread explains how to change the log to TRACE and back again.

I have just installed openhab2 on a rasp pi1. I can’t get the image to update. I store all the images and videos on a NAS within the configuration of my hikvision camera’s. Is there something I should change in the Openhab things setup? I am using paperui as I am new to this. Maybe the below extact from the log will help.

2018-08-05 00:44:51.931 [ERROR] [l.internal.messaging.saaj.client.p2p] - SAAJ0008: Bad Response; Bad Request
2018-08-05 00:44:52.065 [ERROR] [ing.ipcamera.handler.IpCameraHandler] - Camera replied with NULL when trying to get a list of the media profiles
2018-08-05 00:44:52.139 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Following NPE occured when trying to connect to the camera with ONVIF.java.lang.NullPointerException

With HIKVISION the onvif is disabled and you also need to create a user and pass before it accepts connections. In the first post of this thread is a video link that shows it being done. The api is also disabled by default and needs to be enabled.

@matt1 thanks, image works now. With the hikvision cameras I have, there is also an intrusion detection. Is this available in your binding. If not can I help to get it in the binding?

My camera has the same alarm so happy to add that which is around a one hour change for me to make. Not sure when I will have the time but should be able to look at it in the next week or two. Been busy getting my server running on an odroid c2 to give me a lot more ram for the cameras and this now seems to be up and running. The other features I am considering are Flash card features have to do a review of all brands to plan how best to implement it in a consistent way between brands.

does anyone face the challange seeing camera’s feed (picture) in PaperUI (locally and via myopenhab.org) however not able to see picture via mobile app?


I’m using an model trx-jo013mpx-13 camera.
You can see the camera here!

When i use:
https://www.telecamera.ru/bitrix/components/bitrix/forum.interface/show_file.php?fid=1022477&action=download from above i was able to see it with
““AMCREST” IP camera with ONVIF and API support.”
but i can’t connnect an “item” to the “thing”. What i need to type in my “conf” files?

@matt1 should there be a possibility to see camera feed via mobile app or only via PaperUI?

I find the feed does not work in the IOS app for me, but works extremely well on my tablet with the Android app. I have seen people post that the IOS app is not updated or maintained as often as the Andriod app so check if a bug is listed for this on github. It is possible that it does not display if the image is larger than the screen size and the image can be resized with extra switches which are explained in the openhab documentation, have not looked at this in depth to see if there is a work around or what the cause is.

Also NEVER expose the image to the openhab.org cloud connector, the moment it is exposed it will constantly send data out and use bandwidth from your connection as well as the community server even if you have no apps or UI’s open it will still be spamming the server.

See the readme it has examples of what to put in your conf files.