Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapo c200 onvif motion problem on new fw #796

Closed
orrpan opened this issue May 15, 2023 · 18 comments
Closed

Tapo c200 onvif motion problem on new fw #796

orrpan opened this issue May 15, 2023 · 18 comments

Comments

@orrpan
Copy link

orrpan commented May 15, 2023

No motion is registered by scrypted.
Seems like home assistant addon found a solution, could it be applied here too?
Pr
https://github.com/home-assistant/core/pull/92627/files
Issue thread
home-assistant/core#91661 (comment)

@EntingChou
Copy link

Facing same problem for me on Tapo c200, can't got any onvif motion event.

@Oriolgn
Copy link

Oriolgn commented Jun 21, 2023

Same problem on Tapo C200, Tapo C100 works

@TiFerr
Copy link

TiFerr commented Jul 9, 2023

Same here… ☹️
Console output: createSubscription error Error: ONVIF SOAP Fault: {"value":"SOAP-ENV:Sender"}

@wrobelda
Copy link

Same problem on Tapo C200, Tapo C100 works

I have a C100 and can't get it to work, either. Are you on 1.3.6 firmware?

@Oriolgn
Copy link

Oriolgn commented Jul 14, 2023

Same problem on Tapo C200, Tapo C100 works

I have a C100 and can't get it to work, either. Are you on 1.3.6 firmware?

C100 is on 1.1.15

@wrobelda
Copy link

C100 is on 1.1.15

OK, mine's on 1.3.6 already

@alessioprescenzo
Copy link

Hi, I have the same above-mentioned problem, the motion sensor doesn't work. Any update on this? I would really like to use the motion sensor to have HKSV working :)

@koush
Copy link
Owner

koush commented Jul 24, 2023

need camera console log with onvif debug mode logging enabled.

@wrobelda
Copy link

wrobelda commented Jul 25, 2023

Not sure if that's the debugging mode you meant — I enabled "Debug events" in camera's advanced settings. Did not see any logging settings in the Plugin itself.

linux x64 #1 SMP PREEMPT_DYNAMIC Thu Jun 15 15:30:13 UTC 2023
server version: 0.39.0
plugin version: @scrypted/onvif 0.0.123
full
########################
7/25/2023, 1:37:32 PM
########################
[HomeKit]: Device is in accessory mode and is online. HomeKit services are being published.
[Rebroadcast Plugin]: prebuffer sessions starting in 5 seconds
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope                          ><SOAP-ENV:Header><wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesResponse</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><tev:GetEventPropertiesResponse><tev:TopicNamespaceLocation>http://www.onvif.org/onvif/ver10/topics/topicns.xml</tev:TopicNamespaceLocation><wsnt:FixedTopicSet>true</wsnt:FixedTopicSet><wstop:TopicSet><tns1:RuleEngine><CellMotionDetector><Motion wstop:topic="true"><tt:MessageDescription IsProperty="true"><tt:Source><tt:SimpleItemDescription Type="tt:ReferenceToken" Name="VideoSourceConfigurationToken"></tt:SimpleItemDescription><tt:SimpleItemDescription Type="tt:ReferenceToken" Name="VideoAnalyticsConfigurationToken"></tt:SimpleItemDescription><tt:SimpleItemDescription Type="xsd:string" Name="Rule"></tt:SimpleItemDescription></tt:Source><tt:Data><tt:SimpleItemDescription Type="xsd:boolean" Name="IsMotion"></tt:SimpleItemDescription></tt:Data></tt:MessageDescription></Motion></CellMotionDetector></tns1:RuleEngine></wstop:TopicSet><wsnt:TopicExpressionDialect>http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet</wsnt:TopicExpressionDialect><wsnt:TopicExpressionDialect>http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete</wsnt:TopicExpressionDialect><tev:MessageContentFilterDialect>http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter</tev:MessageContentFilterDialect><tev:MessageContentSchemaLocation>http://www.onvif.org/onvif/ver10/schema/onvif.xsd</tev:MessageContentSchemaLocation></tev:GetEventPropertiesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Camera supports WSPullPoint <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope                          ><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Analytics><tt:XAddr>http://10.0.0.110:2020/onvif/service</tt:XAddr><tt:RuleSupport>true</tt:RuleSupport><tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport></tt:Analytics><tt:Device><tt:XAddr>http://10.0.0.110:2020/onvif/service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:ZeroConfiguration>false</tt:ZeroConfiguration><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>true</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>false</tt:SystemLogging><tt:FirmwareUpgrade>false</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>20</tt:Major><tt:Minor>6</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>false</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken></tt:Security></tt:Device><tt:Events><tt:XAddr>http://10.0.0.110:2020/onvif/service</tt:XAddr><tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>true</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://10.0.0.110:2020/onvif/service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://10.0.0.110:2020/onvif/service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>false</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr/><tt:VideoSources>0</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>1</tt:AudioSources><tt:AudioOutputs>0</tt:AudioOutputs><tt:RelayOutputs>0</tt:RelayOutputs></tt:DeviceIO></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

[HomeKit]: HomeKit Connection ::ffff:10.0.0.104
listening events
[Rebroadcast Plugin]: mainStream prebuffer session started
[Rebroadcast Plugin]: mainStream prebuffer session starting
[Rebroadcast Plugin]: stream minorStream is not enabled and will be rebroadcast on demand.
stream url rtsp://10.0.0.110:554/stream1
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  OPTIONS rtsp://10.0.0.110:554/stream1 RTSP/1.0
[Rebroadcast Plugin]: CSeq: 0
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 0
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  DESCRIBE rtsp://10.0.0.110:554/stream1 RTSP/1.0
[Rebroadcast Plugin]: Accept: application/sdp
[Rebroadcast Plugin]: CSeq: 1
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 401 Unauthorized
[Rebroadcast Plugin]: CSeq: 1
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: WWW-Authenticate: Digest realm="TP-LINK Streaming Media", nonce="f50117320cb129733e94a117a5a763a1"
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  DESCRIBE rtsp://10.0.0.110:554/stream1 RTSP/1.0
[Rebroadcast Plugin]: Accept: application/sdp
[Rebroadcast Plugin]: CSeq: 2
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Digest username="homeassistant", realm="TP-LINK Streaming Media", nonce="f50117320cb129733e94a117a5a763a1", uri="rtsp://10.0.0.110:554/stream1", algorithm="MD5", response="793bb43ad25bbe4f3368d8353acbd649"
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 2
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: Content-Base: rtsp://10.0.0.110/stream1/
[Rebroadcast Plugin]: Content-Type: application/sdp
[Rebroadcast Plugin]: Content-Length: 562
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: sdp v=0
[Rebroadcast Plugin]: o=- 62713305 1 IN IP4 10.0.0.110
[Rebroadcast Plugin]: s=Session streamed by "TP-LINK RTSP Server"
[Rebroadcast Plugin]: i=stream1
[Rebroadcast Plugin]: t=0 0
[Rebroadcast Plugin]: a=tool:TP-LINK Streaming Media v2015.05.12
[Rebroadcast Plugin]: a=type:broadcast
[Rebroadcast Plugin]: a=control:*
[Rebroadcast Plugin]: a=range:npt=0-
[Rebroadcast Plugin]: a=x-qt-text-nam:Session streamed by "TP-LINK RTSP Server"
[Rebroadcast Plugin]: m=video 0 RTP/AVP 96
[Rebroadcast Plugin]: c=IN IP4 0.0.0.0
[Rebroadcast Plugin]: b=AS:8192
[Rebroadcast Plugin]: a=rtpmap:96 H264/90000
[Rebroadcast Plugin]: a=fmtp:96 packetization-mode=1; profile-level-id=640029; sprop-parameter-sets=Z2QAKawa0A8ARPyzcBAQFAAAAwAEAAADAHo8UIqA,aO4ESSJA
[Rebroadcast Plugin]: a=control:track1
[Rebroadcast Plugin]: m=audio 0 RTP/AVP 8
[Rebroadcast Plugin]: c=IN IP4 0.0.0.0
[Rebroadcast Plugin]: b=AS:64
[Rebroadcast Plugin]: a=rtpmap:8 PCMA/8000
[Rebroadcast Plugin]: a=control:track2
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  SETUP rtsp://10.0.0.110/stream1/track1 RTSP/1.0
[Rebroadcast Plugin]: Transport: RTP/AVP/TCP;unicast;interleaved=0-1
[Rebroadcast Plugin]: CSeq: 3
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Digest username="homeassistant", realm="TP-LINK Streaming Media", nonce="f50117320cb129733e94a117a5a763a1", uri="rtsp://10.0.0.110/stream1/track1", algorithm="MD5", response="76b6d02619f4f13a2e9ad8200fc85080"
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 3
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: Transport: RTP/AVP/TCP;unicast;destination=10.0.0.3;source=10.0.0.110;interleaved=0-1
[Rebroadcast Plugin]: Session: B34EADFC;timeout=65
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  SETUP rtsp://10.0.0.110/stream1/track2 RTSP/1.0
[Rebroadcast Plugin]: Transport: RTP/AVP/TCP;unicast;interleaved=2-3
[Rebroadcast Plugin]: CSeq: 4
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Digest username="homeassistant", realm="TP-LINK Streaming Media", nonce="f50117320cb129733e94a117a5a763a1", uri="rtsp://10.0.0.110/stream1/track2", algorithm="MD5", response="d5362536532d2814495b831b2118be79"
[Rebroadcast Plugin]: Session: B34EADFC
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 4
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: Transport: RTP/AVP/TCP;unicast;destination=10.0.0.3;source=10.0.0.110;interleaved=2-3
[Rebroadcast Plugin]: Session: B34EADFC;timeout=65
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: sdp sps parsing failed
[Rebroadcast Plugin]: Audio codec plugin reported vs detected mismatch g711 pcm_alaw
[Rebroadcast Plugin]: rtsp outgoing message
[Rebroadcast Plugin]:  PLAY rtsp://10.0.0.110/stream1/ RTSP/1.0
[Rebroadcast Plugin]: Range: npt=0.000-
[Rebroadcast Plugin]: CSeq: 5
[Rebroadcast Plugin]: User-Agent: Scrypted
[Rebroadcast Plugin]: Authorization: Digest username="homeassistant", realm="TP-LINK Streaming Media", nonce="f50117320cb129733e94a117a5a763a1", uri="rtsp://10.0.0.110/stream1/", algorithm="MD5", response="69a5771b419c6f8ee0e68b83f7e757ac"
[Rebroadcast Plugin]: Session: B34EADFC
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: rtsp incoming message
[Rebroadcast Plugin]:  RTSP/1.0 200 OK
[Rebroadcast Plugin]: CSeq: 5
[Rebroadcast Plugin]: Date: Wed, May 24 2023 02:25:38 GMT
[Rebroadcast Plugin]: Range: npt=0.000-
[Rebroadcast Plugin]: Session: B34EADFC
[Rebroadcast Plugin]: RTP-Info: url=rtsp://10.0.0.110/stream1/track1;seq=44396;rtptime=2161188232,url=rtsp://10.0.0.110/stream1/track2;seq=27115;rtptime=3115260922
[Rebroadcast Plugin]: 
[Rebroadcast Plugin]: sps parsing failed
[Rebroadcast Plugin]: sending prebuffer 2006.75
[Rebroadcast Plugin]: mainStream active rebroadcast clients: 1
[Rebroadcast Plugin]: Found sync frame in rtsp prebuffer.
[Rebroadcast Plugin]: mainStream active rebroadcast clients: 0


@jeffreylanters
Copy link

jeffreylanters commented Jul 27, 2023

Running into the same issues after updating the c100 to 1.3.6. The people at Home Assistant seem to have fixed it on their platform after contacting Tapo who stated that they didn't change anything in their ONVIF implementation.

home-assistant/core#91661 (comment)

I'll try to look into it as well.

@TiFerr
Copy link

TiFerr commented Sep 18, 2023

While still trying to make this motion detection working in the c200 I came across this from the homeassistant guys:

Camera uses ONVIF standard to communicate motion events. This communication can work with 2 ways:

Pullpoint: Client opens connection to the camera and waits until the camera responds. Camera responds only when there is some event to communicate. After camera responds, client reopens the connection and waits again.
Webhook: Client tells the camera its URL to receive events at. When an event happens, camera communicates this to the URL client defined.
Webhooks are the preffered method of communication as they are faster and lighter. That being said;

Webhooks require an HTTP only HA setup because Tapo cameras do not support HTTPS webhooks
Webhooks require a proper base_url to be defined in HA, so that the URL communicated is correct (you can check URL sent by enabling debug logs for homeassistant.onvif)
Points above are automatically determined by this integration and if the HA does not meet the criteria, webhooks are disabled. That being said;

There are camera (and/or firmwares) which freeze when both webhooks and pullpoint connection is created, which happens at the start to see if webhooks is supported at all so that communication can fallback back to pullpoint.
There are camera firmwares which have pullpoint broken (1.3.6 C200) and only webhooks work
For webhooks to work, all the user needs to do is make sure he is using HA on HTTP and that the HA is available on the URL communicated.

Could it be because Scrypted base URL is https and the Tapo camera doesn't register the webhook?

@jeffreylanters
Copy link

jeffreylanters commented Sep 29, 2023

While still trying to make this motion detection working in the c200 I came across this from the homeassistant guys:

Camera uses ONVIF standard to communicate motion events. This communication can work with 2 ways:
Could it be because Scrypted base URL is https and the Tapo camera doesn't register the webhook?

Good find! I've decided to look into it, but upon inspecting the Scrypted source code, I observed (please correct me if I am mistaken) that it is exclusively using Pullpoint communication for receiving motion detection events. So the secure protocol doesn't seem to be the cause of the problem. I decided to experiment with Webhook communication, and I achieved positive results. Using a minimal server with Webhooks, I managed to receive both Motion and CellMotion detection events when motion initiated and ceased.

I've opened Issue #1107 to continue discussing Webhooks and have also shared the example code for reference.

@CarlOmega
Copy link

CarlOmega commented Nov 1, 2023

So just putting this here as it might help someone in the interim.
You can downgrade your camera to an older firmware following:
nervous-inhuman/tplink-tapo-c200-re#4

Firmwares: https://github.com/tapo-firmware/Tapo_C200/tree/main

Do this at your own risk as I am sure there could be complications. For myself I have C200 Hv1 and went to 1.1.8 as I was following this table from HA forum on working versions: home-assistant/core#91661 (comment)

Then motion events should be working again after some rebooting.

Finally would check this out: https://community.tp-link.com/en/home/forum/topic/631802
As it looks like there will be a new firmware release soon. might be able to get the beta but I'm still waiting on a response.

TL;DR: Reflash camera to old FW version. Hope they fix soon.

Edit: Have received a response "Hi, The official firmware for the Tapo C200 V1 will be released soon and it will solve the issue, it's suggested to wait for the official firmware if you don't mind. Best Regards"

@jeffreylanters
Copy link

Edit: Have received a response "Hi, The official firmware for the Tapo C200 V1 will be released soon and it will solve the issue, it's suggested to wait for the official firmware if you don't mind. Best Regards"

Thank you for the update! The exact some problems are occurring on the C100 (V2) models, have you receive an update about those as well?

@TiFerr
Copy link

TiFerr commented Nov 2, 2023

So just putting this here as it might help someone in the interim. You can downgrade your camera to an older firmware following: nervous-inhuman/tplink-tapo-c200-re#4

Firmwares: https://github.com/tapo-firmware/Tapo_C200/tree/main

Do this at your own risk as I am sure there could be complications. For myself I have C200 Hv1 and went to 1.1.8 as I was following this table from HA forum on working versions: home-assistant/core#91661 (comment)

Then motion events should be working again after some rebooting.

Finally would check this out: https://community.tp-link.com/en/home/forum/topic/631802 As it looks like there will be a new firmware release soon. might be able to get the beta but I'm still waiting on a response.

TL;DR: Reflash camera to old FW version. Hope they fix soon.

Edit: Have received a response "Hi, The official firmware for the Tapo C200 V1 will be released soon and it will solve the issue, it's suggested to wait for the official firmware if you don't mind. Best Regards"

Thanks a lot!! Life saver!!! I started by downgrading the firmware to 1.3.5 with no success. The I downgraded again in steps until 1.1.9 where I lost all feed and no success.
In the end what solved the issue was the request for firmware update in the private message! Was really fast and now i get consistent motion detection in scrypted.

@jeffreylanters
Copy link

Thanks a lot!! Life saver!!! I started by downgrading the firmware to 1.3.5 with no success. The I downgraded again in steps until 1.1.9 where I lost all feed and no success.
In the end what solved the issue was the request for firmware update in the private message! Was really fast and now i get consistent motion detection in scrypted.

@TiFerr I ran into the exact same issues, where 1.3.5 did not resolve the problem, and I'm on 1.1.9 now, where I'm not able to get any feed at all. -- What exactly did you mean with the private message? Would you be able to help me as well, or point me in the right direction? Thanks!

@TiFerr
Copy link

TiFerr commented Nov 2, 2023

@jeffreylanters this:

Finally would check this out: https://community.tp-link.com/en/home/forum/topic/631802 As it looks like there will be a new firmware release soon. might be able to get the beta but I'm still waiting on a response.

I logged in the forums then sent the private message and waited. A few hours later i had an update firmware message on the Tapo app. After the update Scrypted started with some “Snapshot failed” message but eventually (some reboots later) it got over it and resumed the feed and the motion alerts. They are a bit sluggish but they work.

@gnouts
Copy link

gnouts commented Nov 21, 2023

Updating to 1.3.9 solved this for me

@koush koush closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants