JurajNyiri / HomeAssistant-Tapo-Control

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

C320ws (HWv2-FWv1.0.5) goes offline for several hours within the day. #362

Closed krasatos closed 5 months ago

krasatos commented 1 year ago

Description

Hey there, I have 11 Tapo Cameras wired through ethernet on my network. Two c310-fw1.3.2, and 9 c320ws (two of them are hw2-fw1.0.5, the remaining 7 are hw1-fw1.3) They are wired with passive POE splitters and they all stream to a frigate machine.

I noticed that the cameras would go offline for several hours and then suddenly reappear again. The leds on them seemed to work ok, but i couldnt access the cameras (from app/frigate/ha)

It seemed strange as only the two hw2/fw1.0.5 cameras did this.

I removed just those two units from the HA intergration and now it seems i've gone 10h with no interuption.

Could be the hw or the fw i dont know, just thought i should let you know, perhaps it helpse someone out in the future.

Reproduction Steps

Camera goes offline randomly 2-3 times during the day for several hours each time. Then comes back and works ok for a while.

Expected behavior

.

If applicable, add error logs.

No response

Device Firmware

1.0.5

Using stream component

Yes

Does camera work via official integrations?

No

Camera has all attributes filled out in developer tools

No

HASS Environment

Supervised

Search for similar issues

Yes

Additional information

No response

cartman-sp69 commented 1 year ago

I'm experiencing the exact same thing same cameras, when I disable the integration everything works perfectly and the cameras do not disconnect but when the integration is enabled the cameras stop working. Cameras are also on the same FW version 1.0.5.

For now, I have reverted back to the RSTP streaming and not being able to control the cameras from the HomeAssistant till the issue is fixed.

JurajNyiri commented 1 year ago

I have 7 C200s HW1.0 and HW3.0 and they work as expected. Unfortunately I am not able to replicate this. Please provide as much information as possible. In most of the cases previously reported which showed network communication issues, it was caused by users network, or too much load on camera.

paffeke commented 1 year ago

I'm experiencing same thing too with Tapo C320WS. When i enable the integration i can control camera from HAintegration and from Tapo app, but after a bit of time (matter of minutes) the camera become unreachable from HA integration and from Tapo app. Checking on my unifi switch and on my router the camera seems to lose network connectivity and it has no ip address at all. If so, I unplug the camera from power to restart it.

krasatos commented 1 year ago

24h+ later everything is working fine (with the integration disabled)

Please provide as much information as possible

Unfortunately I do not know what info to provide. As i cannot replicate the issue by some action - it just happens at random intervals.

For now, I have reverted back to the RSTP streaming and not being able to control the cameras from the HomeAssistant till the issue is fixed.

I only use the integration to turn privacy on/off. So for now i am just missing this feature on these two cameras.

Checking on my unifi switch and on my router the camera seems to lose network connectivity and it has no ip address at all.

In some cases, the two cameras in question kept appearing in my unifi client list and i could even ping them. But no stream or app conectivity

andrei4002 commented 1 year ago

similar behaviour here with a c225. camera becomes unavailable and need to unplug it to get it back running (left it like that for a week and it never came back by itself)

it's also weird that it should show as unavailable in home assistant but it shows idle, and sending commands throws errors. was hoping to at least do some detection automation and restart the camera via a remote plug when going offline

i haven't looked at what the integration does or how it works, but i'm thinking if it may be a case where it continuously does some streaming that could mess up with the camera somehow after a while?

tateu commented 1 year ago

I may be experiencing the same thing with a new Tapo C325WB, firmware 1.05 and 1.08. I've had the camera for 8 days and about once per day, it will stop working in HA, the Tapo app and rtsp. I could still ping its ip address but no other connectivity worked. I never left it in that state for very long to see if it came back on its own, I've always just manually rebooted it to get it working again.

It just occurred to me that this integration...maybe the time sync feature since that probably talks to the device on a regular basis...might be the cause of the issue. I am going to completely disable it for several days and see what happens. If the camera works without issue, that will be a pretty good indicator that something is wrong here.

JurajNyiri commented 1 year ago

If that does not help you can try disabling also motion sensor (and reboot HA after).

sorenlouv commented 1 year ago

Thanks @JurajNyiri for all the work on this integration!

I'm seeing the same problems as others where the camera (Tapo C325WB) goes offline until I manually unplug it. The problem goes away after removing this integration.

While the integration was active (for around 48 hours) I noticed that the Home Assistant logs were being flooded with warnings. Perhaps this can help in determining the root cause?

Approx. 5200 occurrences (this is by far the most frequent warning. Happens almost every 30 seconds):

2023-07-24 22:07:15.550 WARNING (MainThread) [homeassistant.components.camera] Updating tapo_control camera took longer than the scheduled update interval 0:00:30

Approx. 700 occurrences:

2023-07-24 05:23:43.371 WARNING (MainThread) [homeassistant.components.switch] Updating tapo_control switch took longer than the scheduled update interval 0:00:30

Approx. 600 occurrences:

2023-07-24 22:07:39.491 ERROR (MainThread) [custom_components.tapo_control] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Approx. 300 occurrences:

2023-07-23 02:44:54.691 ERROR (MainThread) [custom_components.tapo_control] Unexpected error fetching Tapo resource status data: Server disconnected without sending a response.
File "/config/custom_components/tapo_control/__init__.py", line 277, in async_update_data
File "/config/custom_components/tapo_control/utils.py", line 712, in syncTime 

Approx. 210 occurrences:

2023-07-24 05:27:38.309 WARNING (MainThread) [homeassistant.components.siren] Updating tapo_control siren took longer than the scheduled update interval 0:01:00

Approx. 150 occurrences:

2023-07-24 05:30:43.394 ERROR (MainThread) [custom_components.tapo_control] Unexpected error fetching Tapo resource status data: 
File "/config/custom_components/tapo_control/__init__.py", line 277, in async_update_data
File "/config/custom_components/tapo_control/utils.py", line 712, in syncTime
JurajNyiri commented 1 year ago

All the logs above are expected if the camera is not responding or you have network issues. To move forwards see See https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1643653356 and https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1643794989 .

If at any point it stops being an issue, start enabling things and report back with what is causing it.

Also make sure to NOT use camera at the same time with anything other than this integration. No other streams running, No RTSP streams, No NVR, No other HA instance, not the app on phone, no other integrations, no Frigate, MotionEye or any other software requesting stuff from camera.

If you do use it more than twice in parallel, it is expected to be overloaded and start refusing providing data as is stated in official FAQ for the cameras.

pgarciafc commented 1 year ago

Hi,

I used to suffer a lot of this (5-20 disconnections every day), and managed to 'workaround' it using an automation that detects when one of the sensors goes to 'unknown' state and then triggering a restart of the smart socket where the cam is plugged into. Every time this automation is triggered, it also sends me a notification via Telegram informing on the event.

However, i'm also affected by https://community.tp-link.com/en/smart-home/forum/topic/616862 (I believe somebody raised this issue here too), which basically consists on, since FW version 1.0.5 (HW 2.0), the spotlight leds are always on, no matter what. TP-Link released a beta firmware (1.0.6) and asked me to test it out in order to see if that fixes the spotlight issue.

The funny part is that it didn't fix the spotlight, but my camera is no longer freezing/going offline. The automation has worked 4 times in the last 5 days where the previous 5 it was triggered around 60 times.

Hope this helps. Pablo.

michbeck100 commented 1 year ago

@pgarciafc What is the exact version number of your 1.0.6 Beta Version? Mine is 1.0.6 Build 230612 Rel. 67384n. At least my beta version doesn't solve the offline issues described here. And I also didn't have problems with the spotlight leds at all.

howi42 commented 11 months ago

Is this a Home Assistant issue or a camera issue ? Or is it unclear ?

howi42 commented 11 months ago

And, reverting to RTSP does not solve the problem.

howi42 commented 11 months ago

Just to add my observations . I am using 1 c320ws and to c310, all wireless.

  1. The c310 worked without problems, the c320ws started immediately showing the discussed behavior.
  2. I switched the c320ws with one of the c310. As a result, this c310 started to go offline.
  3. I then used wired LAN, and the problems are gone. I checked the wireless conditions, they should be ok. There must be other reasons. One possible problem : The camera in question is located very close to a large sat dish . Or, the wireless connection in these cameras might be very sensitive.
howi42 commented 10 months ago

I need to correct me : cabled or not does not matter. I have three of these, one works always as expected, the two others have the problem.

jonathanrobichaud4 commented 10 months ago

Same thing has been happening to me. I've tried disabling the extra features except webhooks I think. is there any more info I should provide? Camera is a c225

mafr95 commented 10 months ago

I have 3 cameras (C200, C210 and C220). The described problems happening to me only with the C220. I've disabled webhooks, motion sensor, time sync and sound detection with no luck.

C220 Firmware is 1.0.10 Build 230803 Rel.60903n

jojeji commented 10 months ago

Hello, I was facing the same issue on 3 cameras (C320WS FW.: 1.0.5). I disabled not needed entities in HA and the cameras keep alive since 3 days. Active entities: image

Maybe it`s also a workaround for some of you.

howi42 commented 10 months ago

That seems to help !

Thanks

On Mon, Oct 9, 2023, 12:29 jojeji @.***> wrote:

Hello, I was facing the same issue on 3 cameras (C320WS FW.: 1.0.5). I disabled not needed entities in HA and the cameras keep alive since 3 days. Active entities: [image: image] https://user-images.githubusercontent.com/77567363/273558533-52e22a62-7a77-4e8c-a9db-5a80c0637237.png

Maybe it`s also a workaround for some of you.

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1752749786, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNDO3FBNH2OAAHULDLTX6PGZPAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJSG42DSNZYGY . You are receiving this because you commented.Message ID: @.***>

froniusMW commented 10 months ago

My C320WS goes offline regardless setting or disabled entinitys. Super stable on wifi if removed from integration

howi42 commented 10 months ago

I disabled most of the entities and all cameras are stable for days now. And, I have been told by support, that a new firmware might be able to adress the integration issues.

On Fri, Oct 13, 2023, 08:28 froniusMW @.***> wrote:

My C320WS goes offline regardless setting or disabled entinitys. Super stable on wifi if removed from integration

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1760973267, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNECRKWNEJMUOTRKC6DX7DNPNAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRQHE3TGMRWG4 . You are receiving this because you commented.Message ID: @.***>

mafr95 commented 10 months ago

In the last days I have already disabled all entities except the camera hd stream. The C220 is still going offline serveral times a day.

I'm hoping for a new firmware to fix that.

jojeji commented 10 months ago

My C320WS goes offline regardless setting or disabled entinitys. Super stable on wifi if removed from integration

After the Tapo-Control update with sd-card information, the issue also came back on my side. I disabled all of the new entities, but the issue is still there. Now, on the 1. cam I disabled webhooks and "use camera stream in HA" --> no Issue since ~1.5 d On cam 2. I just disabled "use camera stream in HA" --> no Issue since 1.5 days On Cam 3. I disabled only webhooks --> camera was not online since that so I can´t give a feedback.

I hope the new firmware of the camera fill fix this.

RedNo7 commented 10 months ago

I have the same issue with a C225 which goes unavailable randomly. I have disabled all entities except the privacy switch. It's driving me nuts.

However, I have noticed that when it goes unavailable, it's also unavailable in the Tapo app i.e. not an integration problem but a camera hardware problem.


edit: Scratch that, I have both situations problem 'fix'
unavailable in HA but available in the Tapo app restart HA
unavailable in both HA and the Tapo app. restart camera
howi42 commented 10 months ago

I have been promised new firmware today, will see, if it makes a difference.

On Mon, Oct 16, 2023, 11:59 RedNo7 @.***> wrote:

I have the same issue with a C225 which goes unavailable randomly. I have disabled all entities except the privacy switch. It's driving me nuts.

However, I have noticed that when it goes unavailable, it's also unavailable in the Tapo app i.e. not an integration problem but a camera hardware problem.

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1764130672, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNHUTGBXRQM2ILJQLGDX7UAQFAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUGEZTANRXGI . You are receiving this because you commented.Message ID: @.***>

sorenlouv commented 10 months ago

Is there a possibility that the problem is caused by this integration (HomeAssistant-Tapo-Control) flooding the camera with requests causing it to crash? I only observe the camera becoming unresponsive when this integration is enabled.

Looking at the logs I see 100s of requests being made to the camera in a short amount of time. If it is a matter of implementing a more conservative backoff mechanism that sounds like a simple solution to a very widespread problem.

howi42 commented 10 months ago

That is correct and that is the reason that for some of us reducing the number of retrieved parameters helped with this problem.

On Mon, Oct 16, 2023, 16:58 Søren Louv-Jansen @.***> wrote:

Is there a possibility that the problem is caused by this integration ( HomeAssistant-Tapo-Control) flooding the camera with requests causing it to crash? I only observe the camera becoming unresponsive when this integration is enabled.

Looking at the logs I see 100s of requests being made to the camera in a short amount of time. If it is a matter of implementing a more conservative backoff mechanism that sounds like a simple solution to a very widespread problem.

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1764672389, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNHPNDKZS4ALFWLIKF3X7VDRJAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUGY3TEMZYHE . You are receiving this because you commented.Message ID: @.***>

RedNo7 commented 10 months ago

That is correct and that is the reason that for some of us reducing the number of retrieved parameters helped with this problem.

Can you explain (how to do) this please? ...or do you mean disabling the unnecessary sensors etc?

froniusMW commented 10 months ago

I think it is a camera issue. I have both C310 and C320 on frigate. C320 gets many errors, of ffmpeg crash and more. No errors with c310

howi42 commented 10 months ago

I disabled in Homeassistant most of the camera entities.

On Mon, Oct 16, 2023, 17:18 RedNo7 @.***> wrote:

That is correct and that is the reason that for some of us reducing the number of retrieved parameters helped with this problem.

Can you explain (how to do) this please?

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1764721978, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNBBOPPATIDFMBPRMSLX7VF3BAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUG4ZDCOJXHA . You are receiving this because you commented.Message ID: @.***>

howi42 commented 10 months ago

The new firmware is available, but I could not test it, I am travelling. End of the week I will give it a try

On Mon, Oct 16, 2023, 17:24 froniusMW @.***> wrote:

I think it is a camera issue. I have both C310 and C320 on frigate. C320 gets many errors, of ffmpeg crash and more. No errors with c310

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1764734403, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNCC3AK2ZEDRXAU4KZLX7VGSXAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUG4ZTINBQGM . You are receiving this because you commented.Message ID: @.***>

JurajNyiri commented 10 months ago

Looking at the logs I see 100s of requests being made to the camera in a short amount of time. If it is a matter of implementing a more conservative backoff mechanism that sounds like a simple solution to a very widespread problem.

This is not true - or intended. If you see something like that, provide logs and more exact data.

In any case this should be fixed on camera, device should not simply go offline permanently. But if we can do something to fix and you are seeing this, post logs and details and we can help solve the issue.

RedNo7 commented 10 months ago

Another interesting datapoint: This morning, my enabled select.x and button.x entities are all showing unavailable, but I can see my stream in my dash and the controls work perfectly (via buttons using action: call-service). I should add the camera.x entities are available.

JurajNyiri commented 10 months ago

This means camera is refusing connection for control - or you have privacy mode on.

RedNo7 commented 10 months ago

This means camera is refusing connection for control - or you have privacy mode on.

Privacy mode is off, and the controls work fine via call-service though...?

JurajNyiri commented 10 months ago

The call to get data could be failing. We will not know more without debug logs.

RedNo7 commented 10 months ago

I'll upload them the next time it happens

Necunet commented 10 months ago

Hello, I have 5 cameras plugged. 2 C210, 1 C500, 1 C320WS and 1 C520WS. I'm just getting the error you mentioned in C320WS and C520WS. I've put a smart plug on each camera that goes offline and launch an automation to turn each camera off and on. I have disabled all entities except the video and the problem continues. I hope the problem will be resolved.

howi42 commented 10 months ago

regardless what experts are saying, disabling unneeded entities for the 310 solves my problem. The new firmware for the 320 seems to help, too. For this camera I enabled all entities again, still running fine.

On Wed, Oct 18, 2023, 21:07 Necunet @.***> wrote:

Hello, I have 5 cameras plugged. 2 C210, 1 C500, 1 C320WS and 1 C520WS. I'm just getting the error you mentioned in C320WS and C520WS. I've put a smart plug on each camera that goes offline and launch an automation to turn each camera off and on. I have disabled all entities except the video and the problem continues. I hope the problem will be resolved.

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1769155360, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNANUA5VBP7ZGDIZVGLYAASI5AVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRZGE2TKMZWGA . You are receiving this because you commented.Message ID: @.***>

michbeck100 commented 10 months ago

@howi42 What firmware do you have? I got a beta firmware (1.0.6 Build 230612 Rel.67384n) and the problems were not solved with that. I have it on two C320WS.

howi42 commented 10 months ago

The 320 uses 1.0.9

On Thu, Oct 19, 2023, 08:32 Michael Kotten @.***> wrote:

@howi42 https://github.com/howi42 What fireware do you have? I got a beta firmware (1.0.6 Build 230612 Rel.67384n) and the problems were not solved with that,

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1770149168, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNHLKA54B4THJXF4NYDYADCP7AVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGE2DSMJWHA . You are receiving this because you were mentioned.Message ID: @.***>

howi42 commented 10 months ago

to be more specific, Firmware: 1.0.9 Build 231013 Rel.41533n Hardware: 2.0

On Thu, Oct 19, 2023, 08:32 Michael Kotten @.***> wrote:

@howi42 https://github.com/howi42 What fireware do you have? I got a beta firmware (1.0.6 Build 230612 Rel.67384n) and the problems were not solved with that,

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1770149168, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNHLKA54B4THJXF4NYDYADCP7AVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGE2DSMJWHA . You are receiving this because you were mentioned.Message ID: @.***>

michbeck100 commented 10 months ago

Is this a beta version? If I search for firmware updates I don't see any.

howi42 commented 10 months ago

yes, it is.

On Thu, Oct 19, 2023, 10:56 Michael Kotten @.***> wrote:

Is this a beta version? If I search for firmware updates I don't see any.

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1770364600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNGIAXTIKW65VIZEWETYADTNHAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGM3DINRQGA . You are receiving this because you were mentioned.Message ID: @.***>

jshep321 commented 9 months ago

@howi42 How does one get the beta firmware 1.0.9?

howi42 commented 9 months ago

I was in contact with their support team.

On Wed, Oct 25, 2023, 18:46 jshep321 @.***> wrote:

@howi42 https://github.com/howi42 How does one get the beta firmware 1.0.9?

— Reply to this email directly, view it on GitHub https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/362#issuecomment-1779672309, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3MNEUQZRSXJP7HTDNDG3YBE7ADAVCNFSM6AAAAAA2ALHSFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZGY3TEMZQHE . You are receiving this because you were mentioned.Message ID: @.***>

Proche72 commented 9 months ago

I am glad I am not only one having trouble with the cameras. I have two C225 and one C110. Both C225 becoming offline very often. The C110 is stable. The C225 are on FW 1.0.24 build 230731

Fettkeewl commented 9 months ago

Can confirm my C520WS also falls off every so often and requires a reboot. (my 5 c200 have no issue and my previous c310 didnt either).

All cameras have the same setup. RSTP for main and substream used once in frigate and cameras added in this integration, nothing fancy.

For testing currently I removed my m520WS from this integration. Will see how long it stays online with only frigate using the RTSP stream.

If all is well then; Next step is to Activate camera again in this integration but disable the camera entities created . As per @JurajNyiri s comment:

  • Camera entities expose rtsp link stream to HA, that's all. What HA does with this stream depends on your usage and setup. Disabling the entities will stop exposing the URL to HA and does have an effect.

It's strange but I think I recall my camera worked normally on a few releases ago (I had weeks of uptime, not once forced to power cycle) then all the suddenly .. issues.... do not know if it was prior to 5.4.0 or at it.

JurajNyiri commented 9 months ago

You can / should put in frigate restream link instead to options.

TheRedBull205 commented 9 months ago

As of yesterday, an update has been given for the C320WS V2: https://www.tp-link.com/nl/support/download/tapo-c320ws/v2/?app=tether#Firmware-Release-Notes

Not sure yet if this solves this issue, but let's hope so.

Release Notes: Tapo C320WS(EU)_V2_1.0.10 Build 231102

Publicatiedatum: 2023-11-09 Modifications and Bug Fixes:

  1. Optimized the SD card recording function.
  2. Enhanced stability and performance.
  3. Fixed the problem of missing cloud videos in some cases.
  4. Fixed the issue that the spotlight may keep turning on in some cases.
  5. Fixed some minor bugs.