JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.17k stars 89 forks source link

hd stream stops working #541

Closed nc-jeni closed 8 months ago

nc-jeni commented 8 months ago

Description

After I have using the stream for a while it suddenly stopped working.

HD Stream Unavailable

I have tried to restart both HA, reload the integration and even rebooting the cam. Camera works without problems from the Tapo App.

Reproduction Steps

Install the component as described on GitHub. Adds card

Card on dashboard ```yaml square: false type: grid cards: - camera_view: live type: picture-glance title: Living room image: https://demo.home-assistant.io/stub_config/kitchen.png entities: - sensor.sun_next_midnight - sensor.sun_next_noon camera_image: camera.tapo_c100_livingroom_hd_stream - type: horizontal-stack cards: - show_name: false show_icon: true type: button tap_action: action: toggle icon: mdi:eye-off name: Privacy entity: switch.tapo_c100_livingroom_privacy icon_height: 50px show_state: true - show_name: false show_icon: true type: button tap_action: action: toggle entity: switch.tapo_c100_livingroom_record_to_sd_card name: Record icon: mdi:camera icon_height: 50px show_state: true - show_name: false show_icon: true type: button tap_action: action: toggle entity: light.tapo_c100_livingroom_floodlight_timed icon: mdi:light-flood-up name: Flood light icon_height: 50px show_state: true columns: 1 ```

Keep it running, play with it by switching modes such as night- and privacy mode. Enter and exit the app. Tried different protocol setups in the integration after the error was introduced, but it didn't help.

Expected behavior

Expected the stream to continue .

If applicable, add error logs.

2024-03-28 10:17:26.101 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.tapo_c100_livingroom_hd_stream] Error from stream worker: 
Error opening stream (HTTP_OTHER_4XX, Server returned 4XX Client Error, but not one of 40{0,1,3,4}) rtsp://****:****@192.168.50.151:554/stream1

2024-03-28 10:35:34.552 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.50.151', port=443): 
Max retries exceeded with url: /stok=350f0232ebe64739ba7d3048a1c238f8/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffff686b4950>:
Failed to establish a new connection: [Errno 113] Host is unreachable'))

2024-03-28 14:32:30.249 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.tapo_c100_livingroom_hd_stream]
Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@192.168.50.151:554/stream1

Device Firmware

1.3.11 Build 231121 Rel.39420n(4555)

Integration Version

main, 5.4.17

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Ubuntu 23.10 on Raspberry Pi5 Home Assistant is running containerized in Docker

Search for similar issues

Yes

Additional information

Home Assistant v24.3.3 Tapo C100

JurajNyiri commented 8 months ago

Host is unreachable. Probably ip changed or network does not work properly.

nc-jeni commented 8 months ago

No, IP is not changed! It is giving the same address from the router each time as it is bonded to MAC address.

JurajNyiri commented 8 months ago

Host is unreachable from HA. There is nothing wrong with the integration, you will need to ensure HA can reach the camera.

Check FAQ as well for overloading the camera section.

nc-jeni commented 8 months ago

It can reach the camera, and as I was telling, it starts working, and then it stops.

root@home-assistant:/etc/home-assistant# ping 192.168.50.151
PING 192.168.50.151 (192.168.50.151) 56(84) bytes of data.
64 bytes from 192.168.50.151: icmp_seq=1 ttl=64 time=2.83 ms
64 bytes from 192.168.50.151: icmp_seq=2 ttl=64 time=2.71 ms
64 bytes from 192.168.50.151: icmp_seq=3 ttl=64 time=2.28 ms
64 bytes from 192.168.50.151: icmp_seq=4 ttl=64 time=2.09 ms
64 bytes from 192.168.50.151: icmp_seq=5 ttl=64 time=2.37 ms
64 bytes from 192.168.50.151: icmp_seq=6 ttl=64 time=2.78 ms
64 bytes from 192.168.50.151: icmp_seq=7 ttl=64 time=3.03 ms
64 bytes from 192.168.50.151: icmp_seq=8 ttl=64 time=2.04 ms

Do you have a link for the FAQ that tells more about overloading the camera section? @JurajNyiri

I have now added

If the noise sensor becomes unresponsive, make sure you have extra_arguments: -nostats in the configuration.

It does no longer become unresponsive, but still no stream.

JurajNyiri commented 8 months ago

Inside main readme file - https://github.com/JurajNyiri/HomeAssistant-Tapo-Control?tab=readme-ov-file#troubleshooting--faq "I see error Invalid authentication data. Make sure you have created your 3rd party account via Tapo app. You can also test if these credentials work via rtsp stream, for example VLC using link rtsp://username:password@IP Address:554/stream1 when I enter correct password"

nc-jeni commented 8 months ago

Credentials for the camera are created via the Tapo app, and I can access and change all settings, but no streams.

JurajNyiri commented 8 months ago

See the rtsp stream limitation I linked above.

nc-jeni commented 8 months ago

Got it, thanks.

  1. I cancelled the trial of Tapo Care (don't even no why I opt-in for it at all)
  2. Kept the extra_arguments: -nostats in configuration to prevent overloading the camera section