Generic Camera not working

Hi,

I have a RPi B+ serving a picture from the Pi Cam.
I can access the picture via web browser easily and as expected under the following url: http://10.5.0.53:8080/bwtdisplay.jpg.

I have configured the generic ip camera integration as follows:

camera:
  - platform: generic
    still_image_url: http://10.5.0.53:8080/bwtdisplay.jpg
    verify_ssl: false

All I can see in the overview is the name of the camera with the status “idle” next to it. When I click on the camera, a frame with the camera name is shown but nothing else.

If I add a name attribute to the camera, it is not recognized.

What am I doing wrong?

BR,
Ck

Edit

Try

type: picture-entity
entity: light.bed_light
image: http://10.5.0.53:8080/bwtdisplay.jpg
https://www.home-assistant.io/lovelace/picture-entity/

you mean as an action?

If you open the browser console, do you see any errors there? To open the console, in most browsers, just press F12.

Accessing the picture on the web server directly with chromium gives:

Resource interpreted as Document but transferred with MIME type image/jpeg: "http://10.5.0.53:8080/bwtdisplay.jpg".

But that’s all.

Accessing it via HassIO UI gives:

WebSocket connection to 'ws://10.4.148.228:8123/api/websocket' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
e @ socket.ts:53
camera.generic_camera:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any idea?

The websocket error is a bit strange. Is everything else displaying as expected in the UI except for the camera?

And any camera related errors in the HA log in developer tools?

  1. Yes.
  2. No.

This is a bit strange. Maybe you should rule out the possibility that there is something with the image encoding from the PI Cam that HA does not like. You could do this by copying the image to the www folder of your config folder and changing the url of the still image to

still_image_url:  http://10.4.148.228:8123/local/bwtdisplay.jpg

I am assuming that your HA url is http://10.4.148.228:8123
If this does not work, there is something wrong with the image encoding.

Yes!
The picture is shown in the UI when I copy it to local www.
But how can I solve the problem? What would I need to change? Something in the HTTP Response?

I tried a different web server on the RPi with the same result.
Browser shows picture “interpreted as document”.
HassIO cannot access it with the following error in the browser console:

app-header-layout.js:191 GET http://10.4.148.228:8123/api/camera_proxy/camera.generic_camera?token=49379b7bc0e9899166a5a4ed3c435ae5ab46518dd131f428d09ec28ccda13c80 500 (Internal Server Error)

The HassIO logs show two errors now:

Connection to tcp://10.5.0.53:8080 failed: Operation timed out
10:24:07 PM – components/stream/worker.py (ERROR) - message first occurred at 10:16:37 PM and shows up 3 times

Timeout getting image from: Generic Camera
10:23:58 PM – generic (ERROR) - message first occurred at 10:16:38 PM and shows up 3 times

Any idea how to solve this?

Looks like a route issue. Can you ping the ip from your HA server, i.e. attach to the hassio container and try to ping the ip of the camera server.

1 Like

or just ssh into the hassio server (if you have setup ssh) and try to ping the camera RPI ip.

Thank you!!!

Last week I implemented a new firewall roule and I totally forgot about it.
I put the RPi in the correct subnet and now I have a connection.

I can see the still image as icon.
But when I try to access the stream it keeps loading.

Ok, good! I don’t see that you have configured a stream_source in your camera config.

Now its working. I had to use the mjpeg camera for the stream. Everything is working now.

Thank you!

1 Like