ha-bambulab icon indicating copy to clipboard operation
ha-bambulab copied to clipboard

[Bug] EXTERNAL: Error opening camera streams due to X1 firmware issues

Open bubbleytea opened this issue 1 year ago • 58 comments

Describe the bug

Camera streams stopped working and I see this error in the logs:

2023-09-19 21:17:18.749 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.x1c_****_camera] Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://****:****@192.168.1.168/streaming/live/1

Camera streams time out: image

They were working before when I first set up the integration.

To Reproduce

Install integration and add devices. Eventually the streams just stop loading.

Expected Behaviour

Camera stream loads

What device are you using?

X1C

Firmware Version

01.06.03.00

Home Assistant Version

2023.9.2

Component Version

1.5.0

Log Extracts

2023-09-19 21:17:18.749 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.x1c__camera] Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://:***@192.168.1.168/streaming/live/1

Other Information

I don't see any other errors in the logs. Is there anything else I can do to help debug?

bubbleytea avatar Sep 20 '23 01:09 bubbleytea

Has the IP of your printer changed by any chance?

greghesp avatar Sep 21 '23 15:09 greghesp

Has the IP of your printer changed by any chance?

No, I checked and the IPs of all the printers are still the same. All of the other sensors are working properly (I'm assuming those would be broken too, if the IP changed?).

bubbleytea avatar Sep 21 '23 17:09 bubbleytea

Ah yeah you're right. I got the logic mixed up with something else I did.

Can you access the stream via VLC?

greghesp avatar Sep 21 '23 17:09 greghesp

Hello,

I have the same problem.

Error from stream worker: Error opening stream (EXIT, Immediate exit requested) rtsps://:@us.mqtt.bambulab.com/streaming/live/1

IIDemoniaKII avatar Sep 28 '23 17:09 IIDemoniaKII

Ohhh ok, I know the cause of this now. The URL is populated from the config flow, not the MQTT. Will revert

greghesp avatar Sep 28 '23 17:09 greghesp

Thank you for your work !

IIDemoniaKII avatar Sep 28 '23 17:09 IIDemoniaKII

Can you try the latest pre-release please: https://github.com/greghesp/ha-bambulab/releases/tag/v1.7.1-dev1

greghesp avatar Sep 29 '23 08:09 greghesp

Hello,

Still does not work.

Tried to install locally, without success.

I am attaching error logs, but I am not sure that they correspond to this problem.


Logger: aiohttp.server Source: custom_components/bambu_lab/camera.py:64 Integration: Bambu Lab (documentation, issues) First occurred: 18:10:13 (2 occurrences) Last logged: 18:11:23

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 763, in get return await self.handle(request, camera) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 803, in handle stream = await camera.handle_async_mjpeg_stream(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 624, in handle_async_mjpeg_stream return await self.handle_async_still_stream(request, self.frame_interval) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 612, in handle_async_still_stream return await async_get_still_stream( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 280, in async_get_still_stream img_bytes = await image_cb() ^^^^^^^^^^^^^^^^ File "/config/custom_components/bambu_lab/camera.py", line 76, in async_camera_image stream_source = await self.stream_source() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bambu_lab/camera.py", line 64, in stream_source url = URL(self.coordinator.get_model().camera.rtsp_url).with_user('bblp').with_password( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/yarl/_url.py", line 835, in with_user raise ValueError("user replacement is not allowed for relative URLs") ValueError: user replacement is not allowed for relative URLs

IIDemoniaKII avatar Sep 29 '23 16:09 IIDemoniaKII

Hello,

Still does not work.

Tried to install locally, without success.

I am attaching error logs, but I am not sure that they correspond to this problem.

Logger: aiohttp.server Source: custom_components/bambu_lab/camera.py:64 Integration: Bambu Lab (documentation, issues) First occurred: 18:10:13 (2 occurrences) Last logged: 18:11:23

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 763, in get return await self.handle(request, camera) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 803, in handle stream = await camera.handle_async_mjpeg_stream(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 624, in handle_async_mjpeg_stream return await self.handle_async_still_stream(request, self.frame_interval) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 612, in handle_async_still_stream return await async_get_still_stream( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 280, in async_get_still_stream img_bytes = await image_cb() ^^^^^^^^^^^^^^^^ File "/config/custom_components/bambu_lab/camera.py", line 76, in async_camera_image stream_source = await self.stream_source() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bambu_lab/camera.py", line 64, in stream_source url = URL(self.coordinator.get_model().camera.rtsp_url).with_user('bblp').with_password( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/yarl/_url.py", line 835, in with_user raise ValueError("user replacement is not allowed for relative URLs") ValueError: user replacement is not allowed for relative URLs

Oops, minor issue. New dev release: https://github.com/greghesp/ha-bambulab/releases/tag/v1.7.1-dev2

You might need to reload the integration

greghesp avatar Sep 29 '23 18:09 greghesp

Hello, I can't find the version on HACS.

IIDemoniaKII avatar Sep 30 '23 18:09 IIDemoniaKII

Hello, I can't find the version on HACS.

Have you go the Beta toggle ticked?

greghesp avatar Sep 30 '23 18:09 greghesp

Yes, i see v1.7.1-dev1

IIDemoniaKII avatar Sep 30 '23 18:09 IIDemoniaKII

Yes, i see v1.7.1-dev1

Odd. I just checked my production instance and it's there. Maybe try toggling it? Sometimes its in the drop-down, but you have to select off if and then back into it for it to select

greghesp avatar Sep 30 '23 18:09 greghesp

I will try to uninstall completely and download again

IIDemoniaKII avatar Sep 30 '23 18:09 IIDemoniaKII

No, it doesn't appear 1 2

IIDemoniaKII avatar Sep 30 '23 19:09 IIDemoniaKII

Capture d'écran 2023-09-30 210234

IIDemoniaKII avatar Sep 30 '23 19:09 IIDemoniaKII

Ahhhh, I'd created the tag but not the release. Oops! Try again now

greghesp avatar Sep 30 '23 19:09 greghesp

Upload the file directly to home assistant, unfortunately it still doesn't work

Logger: homeassistant.components.stream.stream.camera.x1c_00m09a371200619_camera Source: components/stream/init.py:434 Integration: Stream (documentation, issues) First occurred: 21:30:52 (7 occurrences) Last logged: 21:34:22

Error from stream worker: Error opening stream (PROTOCOL_NOT_FOUND, Protocol not found) ://bblp:edc1d6f5@disable

IIDemoniaKII avatar Sep 30 '23 19:09 IIDemoniaKII

Now i see, i test

Capture d'écran 2023-09-30 213642

IIDemoniaKII avatar Sep 30 '23 19:09 IIDemoniaKII

Oh - you don't have RTSP enabled on your printer. After the @ sign in that URL should have the IP address, but its reporting disabled instead

greghesp avatar Sep 30 '23 19:09 greghesp

My fault, I forgot to reactivate live. It works, thank you very much! Beautiful evening

IIDemoniaKII avatar Sep 30 '23 19:09 IIDemoniaKII

Seems I've also got the same issue as OP 2023-10-01 11:19:06.584 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.x1c_00m00a280103660_camera] Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://****:****@192.168.1.64/streaming/live/1

I'm not sure this is an issue with the integration, as VLC cannot access the stream either.

@bubbleytea - Have you got Timelapse on? I've never had this issue before, and I've just turned timelapse on and now have this issue

greghesp avatar Oct 01 '23 10:10 greghesp

Hello,

New problem it seems, my timelaps is activate

Logger: homeassistant.components.stream.stream.camera.x1c_00m09a371200619_camera Source: components/stream/init.py:434 Integration: Stream (documentation, issues) First occurred: 12:39:31 (5 occurrences) Last logged: 12:42:02

Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsps://:@192.168.68.140/streaming/live/1 Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://:@192.168.68.140/streaming/live/1 Error from stream worker: Error opening stream (PROTOCOL_NOT_FOUND, Protocol not found) ://bblp:edc1d6f5@disable

IIDemoniaKII avatar Oct 01 '23 10:10 IIDemoniaKII

Error from stream worker: Error opening stream (PROTOCOL_NOT_FOUND, Protocol not found) ://bblp:edc1d6f5@disable

This looks like it's been disabled again

greghesp avatar Oct 01 '23 10:10 greghesp

Reactivate..., this printer likes to play jokes on me...

Logger: homeassistant.components.stream.stream.camera.x1c_00m09a371200619_camera Source: components/stream/init.py:434 Integration: Stream (documentation, issues) First occurred: 12:46:29 (1 occurrences) Last logged: 12:46:29

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://:@192.168.68.140/streaming/live/1

IIDemoniaKII avatar Oct 01 '23 10:10 IIDemoniaKII

I'm also getting this issue as well. It's nothing to do with HA from what I can tell, as I'm also unable to access the stream from VLC. Must be a bug in the firmware

greghesp avatar Oct 01 '23 12:10 greghesp

Re-added IP fix up workaround: #299

AdrianGarside avatar Dec 01 '23 04:12 AdrianGarside

Re-added IP fix up workaround: #299

I've applied the fix to my copy of the component but it's still showing me the same error as @IIDemoniaKII has:

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://****:****@192.168.0.136/streaming/live/1

mateuszdrab avatar Dec 07 '23 13:12 mateuszdrab

Re-added IP fix up workaround: #299

I've applied the fix to my copy of the component but it's still showing me the same error as @IIDemoniaKII has:

Error from stream worker: Error opening stream (ERRORTYPE_5, I/O error) rtsps://****:****@192.168.0.136/streaming/live/1

Double check that its enabled on your printer. This error is the printer not returning a stream, usually because its disabled

greghesp avatar Dec 07 '23 14:12 greghesp

Lan View is enabled - I was just playing with the local instance of Bambu Studio and figured out I can get a cloud stream on demand by running bambu_source and piping it into ffmpeg which is what the studio does. bambu_source takes a token from a file called url.txt which I presume is populated from some API call the studio does.

Printer is in cloud mode - integration is connected using cloud mode as well

mateuszdrab avatar Dec 07 '23 14:12 mateuszdrab