OH3 ipcamera binding add jpg URL to Page stays blank

Hey cracks!

I’m struggling with something which should be pretty basic… can’t get it to work though and I’m hoping to find some help here (nothing through the forum search that really helped so far…).

So I have a security cam which snapshot image I’d like to integrate in a simple page widget. What I did so far:
I installed the ipcamera binding and got this to work without any issues. The thing is generating an URL which I can access without any problems from any browser inside the network. The URL is http://ipofmyohdevice:8003/ipcamera.jpg

I then created an image card with the URL to the image.

component: oh-image-card
config:
  url: http://ipcofmyohdevice:8003/ipcamera.jpg

The widget stays blank and after sometime displays the classic “broken image symbol”.

If I select the Webframe Widget it stays blank too.

I also created a custom widget from here, but this stays blank too: OH3 Widget: Move and see your PTZ camera feed on a page - Add-ons / UIs - openHAB Community

Again, the URL definitely works from any browser and the image is displayed. Could it have something to do with the fact, that the image URL is on the OH-Device itself?

Any help to further troubleshoot this is greatly appreciated!

EDIT: It actually might be related to jpeg but this doesn’t really make sense to me. If I try to access an image url somewhere on the internet, if it’s a PNG type it works. If the URL is a .jpg extension, same thing, the widget stays blank…

EDIT2: I’m getting closer. Opening the OpenHab Page with Firefox and not any of the chrome based browsers works. So it seems to be browser related issue. Strangely, on the App on Android it doesn’t work either… continuing to looking in to it.

OK, so what does this have to do with the IP Camera Binding? So far what you are describing has nothing to do with that binding.

My recommendation would be to in fact use the IP Camera Binding. Configure that URL that you show above as the Snapshot URL and fill in the rest of the required parameters. Then link an Image Item to the Image channel and a Switch Item to the Poll Image channel. When the Switch is on, the Image Item will be populated with the latest snapshot from the camera.

You can then put the Image Item on your UI and because all the communication is between the OH server and the camera on your local network, the image will appear no matter how you are connected to OH, be it remotely or locally.

My recommendation is to either:

  • update the title of your post to remove references to the IP Camera binding since you are not using it and hopefully someone who knows this better can help

or

  • actually set up and configure the IP Camera binding per the instructions in the binding’s docs.

I can say that the using the IP Camera binding as I described appears to work well for me.

There’s a misunderstanding. I indeed use the ipcamera binding to create the snapshot image and access as you suggest the image on the OH server. As stated in my second edit though, it rather seems to be a browser related issue. It works ok in other than chromium based browser as it seems. I will close the issue, since - I agree with you - doesn’t seem to be related to the binding.

You can enable DEBUG logging to see if the binding is getting the request from the browser. If it never gets the request, then it may be a security setting or firewall plugin that the browser has that is blocking it. You could also use wireshark on your network to see if the request leaves the browsers machine.

Hi Rich,

I have a scenario that I’d like to see is it possible. I’m converting to OH 3.x right now and I have a bunch of IMAGE items in my item file. The goal is to get everything working with minimal changes before I start rewriting/improving code towards the 3.x platform.

The IP Camera binding has changed the way it handles the static IMAGE channel. It use to be a simple item file 1=1 mapping in 2.5 version.

The new way is a URL directly into OH that passes through the IP Camera binding and it displays the static image at that given point. Bottom line, there is NO channel URL to map IMAGE (that doesn’t impact OH System Bus) to in the items file now.

What I like to see if this is possible with OH 3.x is this in my items file? Not sure if you can link an Image item to a URL directly now?

Image MyPic { http://openhabian:8080/ipcamera/2df5aa8a86/ipcamera.jpg }

Thoughts?

Best, Jay

Is there a reason you can’t use the Poll Image and Image Channels?

Just be sure to have a reasonably long poll time.

That’s the only think I have experience with for the IPCamera binding.

I have been working with @matt1 in the migration between 2.x to 3.x binding versions and he’s saying we really shouldn’t be using the Image channel due to the performance impact it has on the OH Bus system.

I really don’t recommend using the image channel for multiple reasons, one of which is it floods the event bus with the image data.

He was saying this was an option below, just want to know the syntax of it so I can type it into my .items file.

Yet another way is to use an Image item or oh-image card that gets fed the ipcamera.jpg url and set to update every 3 seconds.

Best, Jay

You do not create a item.

If your wanting to display in a layout page. You can use the “image card” as the basic method if you dont want to use the widget mentioned below.

Layout Pages | openHAB

If your wanting to display in a sitemap you use the image element with a refresh. You do not need an item as it can take a URL directly
Sitemaps | openHAB

But my favorite way is to use the autofps.mjpeg url in the widget that is found in the marketplace as it has overlays to show when alarms are occurring and for PTZ cameras you can control them from the same widget.

There are other ways but lets keep it simple.