core: Generic Camera randomly stops working

The problem

I have 3 Generic Camera integrations in configuration.yaml. These work anywhere from just a few hours to slightly over a week. Then they no longer load and show an image in my dashboard. It only shows a broken image icon for all 3 camera.

What version of Home Assistant Core has the issue?

Core: 2022.2.6 - 2022.2.9

What was the last working version of Home Assistant Core?

Pre Core 2022.2.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Camera:Generic

Link to integration documentation on our website

https://www.home-assistant.io/integrations/generic

Diagnostics information

There does not appear to be any log data for Generic:Camera. If there is, please tell me where to find it and I will post it here.

Example YAML snippet

**/config/configuration.yaml**

camera:
  - platform: generic
    name: ThorCam1
    still_image_url: !secret foscam_thorcam1_url
    authentication: digest
    verify_ssl: false    
  - platform: generic
    name: ThorCam2
    still_image_url: "https://172.27.1.22/cgi-bin/snapshot.cgi"
    username: !secret amcrest_username
    password: !secret amcrest_password
    authentication: digest
    verify_ssl: false
  - platform: generic
    name: ThorCam3
    still_image_url: "https://172.27.1.23/cgi-bin/snapshot.cgi"
    username: !secret amcrest_username
    password: !secret amcrest_password
    authentication: digest
    verify_ssl: false

/config/ui-lovelace.yaml

      - type: vertical-stack
        cards:
          - type: picture-glance
            title: Front Door
            entities: 
              - entity: switch.task_lamp
                icon: mdi:desk-lamp
            camera_image: camera.thorcam2
          - type: picture-entity
            name: Living Room
            entity: camera.thorcam3
            camera_image: thorcam3               
          - type: picture-entity
            entity: camera.thorcam1
            camera_image: camera.thorcam1
            name: Kitchen


### Anything in the logs that might be useful for us?

```txt
The System Log file is filled with these Errors. Yet copy/pasting the static image URL (as used in /config/configuration.yaml) inot my browser results in immediate response from the web camera and the display of the current captured image from the camera.

2022-02-24 13:31:11 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam3
2022-02-24 13:33:41 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam3
2022-02-24 13:41:48 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam2
2022-02-24 13:44:48 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam2
2022-02-24 13:50:48 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam2
2022-02-24 13:51:38 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam2
2022-02-24 13:51:44 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam1
2022-02-24 13:51:48 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam2
2022-02-24 13:53:44 ERROR (MainThread) [homeassistant.components.generic.camera] Timeout getting camera image from ThorCam1

All three (3) web cameras (2 are Amcrest, 1 is Foscam) show video feeds via their web page and though TinyCam Android App. While the Home Assistant Dashboard display a broken Image Icon for all 3 cameras.



### Additional information

I am using Generic Camera for Amcrest because the Amcrest integration does not support self-signed certificates, not a way to ignore those certificates.
I am using Generic Camera for FosCam as that camera is riddled with security holes and so I don't trust its integration is not compromised as well.

To Temporarily get the Generic Camera integration working again, I restart the Home Assistant Server: 
Configuration -> Settings -> Server Controls -> Server Management: Restart

Again, this only works anywhere from a few hours to maybe a week before it fails again. I do not touch, or change, or restart any of the cameras. 

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (12 by maintainers)

Most upvoted comments

Hopefully #72573 above takes care of it