core icon indicating copy to clipboard operation
core copied to clipboard

MJPEG IP Camera broke in 2023.6

Open mariwing opened this issue 2 years ago • 22 comments

The problem

After installing 2023.6 the MJPEG IP Camera integration for my very old D-Link camera broke. It has worked for many years and rolling back to 2023.5 it works "again". I see that something was changed regarding http client and authentication.

I use a url in the format http://username:[email protected]/image/jpeg.cgi. Opening the url directly in the browser still works but the MJPEG IP Camera integration does not (only shows broken image).

What version of Home Assistant Core has the issue?

core-2023.6.2

What was the last working version of Home Assistant Core?

core-2023.5.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MJPEG IP Camera

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

mariwing avatar Jun 19 '23 19:06 mariwing

Having a similar issue as well. All my other cameras work, but my old Tenvis camera stopped working and HA returns a 502 Bad Gateway when trying to access.

markdepalma avatar Aug 16 '23 15:08 markdepalma

I am only get this to work by hard coding the creds in the request, but even then only still view refreshes work. Still getting the 502 when clicking the camera to open it.

Example: http://IPADDRESS/videostream.cgi?user=admin&pwd=password

markdepalma avatar Aug 16 '23 15:08 markdepalma

I have the same problem with an old Foscam FI9828P (502 Bad Gateway)

My configuration has been with the user/pass in the url since I switched it to the frontend configuration

http://xxx.xxx.xxx.xxx/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=<username>&pwd=<password>`

I also checked the logs, found no errors

emkookmer avatar Aug 27 '23 09:08 emkookmer

Same problem. After upgrading HA my doorbell mjpeg camera broke.

patrickfong avatar Sep 11 '23 05:09 patrickfong

I'm having the same issue as well. Worked fine in 2023.5.x

Does anybody have any fixes?

smacbride avatar Sep 13 '23 18:09 smacbride

No, still not working. Are there any alternatives?

patrickfong avatar Sep 13 '23 18:09 patrickfong

I have the same problem with my VStarcam c29. When I trying to see my dashboard there is no image in the card and the message appears in logs "Error getting new camera image from Mjpeg Camera: 400, message="Invalid header value char:\n\n b'Connection: close'\n ^", url=URL('http://192.168.8.111:59975/snapshot.cgi?user=admin&pwd=<password>') If I press on the card video is showing well.

castamonte avatar Oct 07 '23 07:10 castamonte

I believe I also have this issue. It has also broken notifications for me, as linked above.

jameshobden avatar Oct 11 '23 17:10 jameshobden

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Still an issue, the person that upgraded the dependencies seemingly never even bothered to look at this issue/error report. Frustrating at times to be a Home Assistant user.

mariwing avatar Jan 09 '24 17:01 mariwing

Still an issue for me.

CORRECTION: I just tried it now and it seems to be working. This must have been resolved in the last two updates.

markdepalma avatar Jan 09 '24 17:01 markdepalma

Not working for me. Just tested with 2024.1.2

smacbride avatar Jan 09 '24 18:01 smacbride

There is a problem, cameras are not being added to the new house. http://IP/video/mjpg.cgi

hintoz avatar Jan 11 '24 00:01 hintoz

Can someone facing this issue please post:

  1. URL that you are using (redact the username and password)
  2. Are you using any special characters in either the username or password?
  3. Authentication method - Basic or Digest?
  4. Any applicable logs (enable debug logging, if necessary)?

codyc1515 avatar Jan 14 '24 21:01 codyc1515

Still Image URL: http://10.0.0.163/image.jpg (this works) MJPEG URL: http://10.0.0.163/video.cgi (not working - used to work about a year ago)

  1. Password does have an "!" in it.
  2. My options dialog doesn't show anything for auth method
  3. I've enabled logging but I don't see any errors. Basically the preview works and when you click on the preview to see the feed, nothing happens, it just brings up an empty window. This used to work several versions ago.

smacbride avatar Jan 15 '24 19:01 smacbride

Have you tried a simpler password without any special characters? Are you using a username too?

Also, what is the make and model?

codyc1515 avatar Jan 15 '24 19:01 codyc1515

The preview works just fine, and that requires the password, its just the live feed that isn’t working.

However I will try a simpler password to see if that works.

It’s a Dlink DCS-5020L

From: Cody C @.> Sent: Monday, January 15, 2024 12:17 PM To: home-assistant/core @.> Cc: E. Scott MacBride @.>; Comment @.> Subject: Re: [home-assistant/core] MJPEG IP Camera broke in 2023.6 (Issue #94877)

Have you tried a simpler password without any special characters? Are you using a username too?

Also, what is the make and model?

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/94877#issuecomment-1892668420, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AULTKOHCIF7GFXI3UHQWNL3YOV6DBAVCNFSM6AAAAAAZMJ5NWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSGY3DQNBSGA. You are receiving this because you commented.Message ID: @.@.>>

smacbride avatar Jan 15 '24 19:01 smacbride

It looks like your camera supports H.264 which you may find to be more reliable in the mean time. Let us know how you get on with amending your password.

codyc1515 avatar Jan 15 '24 19:01 codyc1515

OK I changed the password and removed the “!” and it still doesn't work.

I will investigate changing the camera to H.264. I assume that will require a different integration than the MJPEG?

Thank for the help!

From: Cody C @.> Sent: Monday, January 15, 2024 12:49 PM To: home-assistant/core @.> Cc: E. Scott MacBride @.>; Comment @.> Subject: Re: [home-assistant/core] MJPEG IP Camera broke in 2023.6 (Issue #94877)

It looks like your camera supports H.264https://eu.dlink.com/si/sl/-/media/consumer_products/dcs/dcs-5020l/manual/dcs5020la1manualv100.pdf which you may find to be more reliable in the mean time. Let us know how you get on with amending your password.

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/94877#issuecomment-1892698508, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AULTKODLKARDFQ5SRCSECSDYOWB4LAVCNFSM6AAAAAAZMJ5NWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSGY4TQNJQHA. You are receiving this because you commented.Message ID: @.@.>>

smacbride avatar Jan 15 '24 20:01 smacbride

Yep, just generic camera.

codyc1515 avatar Jan 15 '24 21:01 codyc1515

I switched to the generic camera integration and my camera is now working. Thanks to Cody C.

smacbride avatar Jan 15 '24 22:01 smacbride

I've got an old MJPEG-only camera (DCS-932L) and the preview in lovelace (the camera_proxy URL) endpoint is serving 500s, but the live view (the camera_proxy_stream URL) works fine. It's just HTTP basic auth to the camera, alphabetic-only username and password. I can specify the URL as http://user:pass@IP/video.cgi with no credentials in the MJPEG IP Camera integration, or I can specify it as http://IP/video.cgi with username/password specified in the separate fields and I see the same behavior. Nothing shows up in logs, but I'm happy to tweak a config to try and get useful debug logs if you'll point me in the right direction. Host is a Pi 4 running homeassistant in the provided Docker container (ghcr.io/home-assistant/home-assistant:2024.2.3 as of this writing.)

If I try to specify both forms of authentication, then I do get a log message about how it can't combine the credentials and that things are misconfigured, so I'm extra mystified by the seeming no-log 500 being served.

I hope that's useful information!

durin42 avatar Mar 03 '24 19:03 durin42

No sooner than I write that comment, I realized that somehow the still image URL wasn't configured for that camera - adding that fixes the issue. Mysteriously my other camera (an old Foscam) doesn't have a still image and works fine - so maybe the component could do to log when it can't load a requested still image or something? I'm guessing based on the behavior I just saw.

durin42 avatar Mar 03 '24 19:03 durin42