Page 1 of 2

ZM 1.37.61 - ONVIF event messages issues.

Posted: Sun Jul 07, 2024 8:46 pm
by Primed73
I purchased a Tapo C500 camera two weeks ago.
From day zero Onvif events were broken on the camera firmware.

A couple of days ago they pushed a firmware update, tested in ODM and started getting responses from the event service.

onvif.PNG
onvif.PNG (70.87 KiB) Viewed 8774 times

After I added Motion to the ONVIF_Alarm_Text, the logs were reporting:

Got Motion Alarm!
Triggered off ONVIF
Failed to get ONVIF messages! 8 (null)

I found the following in zmc_m6.log as a single example:

[ONVIF polling : Got Good Response! 0]
[Got Motion Alarm!]
[Setting ClosesEvent]

And further down:

[Result of getting ONVIF messages= 8 soap_fault_string=(null) detail=null]
[Failed to get ONVIF messages! 8 (null)]

Using tshark I ran a packet capture during an event opening, is there anything here that Zoneminder would have trouble seeing?


<tev:CurrentTime>2024-07-06T00:49:35Z</tev:CurrentTime>
<tev:TerminationTime>2024-07-06T00:53:54Z</tev:TerminationTime>
<wsnt:NotificationMessage>
<wsnt:SubscriptionReference><wsa5:Address></wsa5:Address></wsnt:SubscriptionReference>
<wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExp ... wsnt:Topic>
<wsnt:Message><tt:Message PropertyOperation="Initialized" UtcTime="2024-07-06T00:49:35Z">
<tt:Source>
<tt:SimpleItemValue="vsconf" Name="VideoSourceConfigurationToken"></tt:SimpleItem>
<tt:SimpleItem Value="VideoAnalyticsToken" Name="VideoAnalyticsConfigurationToken"></tt:SimpleItem>
<tt:SimpleItem Value="MyMotionDetectorRule" Name="Rule"></tt:SimpleItem></tt:Source>
<tt:Data><tt:SimpleItem Value="true"Name="IsMotion"></tt:SimpleItem></tt:Data>


Got to the point where I'm scratching my head going any further.
Could this still be a firmware issue with the camera or is there something I'm missing?

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Fri Jul 12, 2024 12:56 pm
by Primed73
Hi all, anyone got any ideas on this?

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Fri Jul 12, 2024 4:21 pm
by iconnor
The error code for 8 is:
SOAP_EMPTY
A soap_status error code: XML element or attribute is empty when a value is required. More...

It may be that our event poll request is missing something.

We need to compare what we are sending and receiving and what ODM sends and receives.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Sat Jul 13, 2024 10:02 am
by Primed73
Thanks for the reply @iconnor

I'll take captures from subscription to pull messages (during capture) on ODM in Windows and from the Zoneminder machine and place there here at some point this week.

Cheers.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Sat Jul 13, 2024 6:13 pm
by Primed73
Hi again,

I ran a capture on the Windows machine with ODM running and on the Zoneminder machine.
ODM sends a MessageID, Zoneminder doesn't.

ODM PullMessages request to camera:

Code: Select all

    <s:Envelope
        xmlns:s="http://www.w3.org/2003/05/soap-envelope"
        xmlns:a="http://www.w3.org/2005/08/addressing">
        <s:Header>
            <a:Action
                s:mustUnderstand="1">
                http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest
                </a:Action>
            <a:MessageID>
                urn:uuid:3db01f87-15f2-46df-b6b9-ddfbc59673dc
                </a:MessageID>
            <a:ReplyTo>
                <a:Address>
                    http://www.w3.org/2005/08/addressing/anonymous
                    </a:Address>
                </a:ReplyTo>
            <Security
                s:mustUnderstand="1"
                xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                <UsernameToken>
                    <Username>
                        redacted
                        </Username>
                    <Password
                        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
                        redacted
                        </Password>
                    <Nonce
                        EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">
                        redacted
                        </Nonce>
                    <Created
                        xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                        2024-07-13T16:40:32.406Z
                        </Created>
                    </UsernameToken>
                </Security>
            <a:To
                s:mustUnderstand="1">
                http://192.168.1.238:1025/event-1025_1025
                </a:To>
            </s:Header>
        <s:Body
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <PullMessages
                xmlns="http://www.onvif.org/ver10/events/wsdl">
                <Timeout>
                    PT1M
                    </Timeout>
                <MessageLimit>
                    1024
                    </MessageLimit>
                </PullMessages>
            </s:Body>
        </s:Envelope>


Camera PullMessages response to ODM

Code: Select all

<?xml
    <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
        xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
        xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
        xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:wsa5="http://www.w3.org/2005/08/addressing"
        xmlns:xmime="http://tempuri.org/xmime.xsd"
        xmlns:xop="http://www.w3.org/2004/08/xop/include"
        xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
        xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
        xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2"
        xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
        xmlns:tt="http://www.onvif.org/ver10/schema"
        xmlns:ter="http://www.onvif.org/ver10/error"
        xmlns:tns1="http://www.onvif.org/ver10/topics"
        xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
        xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"
        xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
        xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
        xmlns:tdn="http://www.onvif.org/ver10/network/wsdl"
        xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
        xmlns:trp="http://www.onvif.org/ver10/replay/wsdl"
        xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"
        xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl">
        <SOAP-ENV:Header>
            <wsa5:MessageID>
                urn:uuid:3db01f87-15f2-46df-b6b9-ddfbc59673dc
                </wsa5:MessageID>
            <wsa5:To
                SOAP-ENV:mustUnderstand="true">
                http://192.168.1.238:1025/event-1025_1025
                </wsa5:To>
            <wsa5:Action
                SOAP-ENV:mustUnderstand="true">
                http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse
                </wsa5:Action>
            </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <tev:PullMessagesResponse>
                <tev:CurrentTime>
                    2024-07-13T16:40:33Z
                    </tev:CurrentTime>
                <tev:TerminationTime>
                    2024-07-13T16:41:33Z
                    </tev:TerminationTime>
                <wsnt:NotificationMessage>
                    <wsnt:SubscriptionReference>
                        <wsa5:Address>
                            </wsa5:Address>
                        </wsnt:SubscriptionReference>
                    <wsnt:Topic
                        Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">
                        tns1:RuleEngine/CellMotionDetector/Motion
                        </wsnt:Topic>
                    <wsnt:Message>
                        <tt:Message
                            PropertyOperation="Initialized"
                            UtcTime="2024-07-13T16:40:33Z">
                            <tt:Source>
                                <tt:SimpleItem
                                    Value="vsconf"
                                    Name="VideoSourceConfigurationToken">
                                    </tt:SimpleItem>
                                <tt:SimpleItem
                                    Value="VideoAnalyticsToken"
                                    Name="VideoAnalyticsConfigurationToken">
                                    </tt:SimpleItem>
                                <tt:SimpleItem
                                    Value="MyMotionDetectorRule"
                                    Name="Rule">
                                    </tt:SimpleItem>
                                </tt:Source>
                            <tt:Data>
                                <tt:SimpleItem
                                    Value="true"
                                    Name="IsMotion">
                                    </tt:SimpleItem>
                                </tt:Data>
                            </tt:Message>
                        </wsnt:Message>
                    </wsnt:NotificationMessage>
                </tev:PullMessagesResponse>
            </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>
The camera is returning MessageID to ODM.
Is this required for the response?

Zoneminder PullMessages request to camera:

Code: Select all

    <?xml
        version="1.0"
        encoding="UTF-8"
        ?>
    <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
        xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
        xmlns:wsa5="http://www.w3.org/2005/08/addressing"
        xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
        xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
        xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2"
        xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
        xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
        xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
        xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion"
        xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
        xmlns:wsc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512"
        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
        <SOAP-ENV:Header>
            <wsse:Security
                SOAP-ENV:mustUnderstand="true">
                <wsu:Timestamp>
                    <wsu:Created>
                        2024-07-13T16:40:22Z
                        </wsu:Created>
                    <wsu:Expires>
                        2024-07-13T16:40:32Z
                        </wsu:Expires>
                    </wsu:Timestamp>
                <wsse:UsernameToken
                    wsu:Id="Auth">
                    <wsse:Username>
                        redacted
                        </wsse:Username>
                    <wsse:Password
                        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
                        redacted
                        </wsse:Password>
                    <wsse:Nonce
                        EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">
                        redacted
                        </wsse:Nonce>
                    <wsu:Created>
                        2024-07-13T16:40:22Z
                        </wsu:Created>
                    </wsse:UsernameToken>
                </wsse:Security>
            </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <tev:PullMessages>
                <tev:Timeout>
                    PT20S
                    </tev:Timeout>
                <tev:MessageLimit>
                    10
                    </tev:MessageLimit>
                </tev:PullMessages>
            </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>


Camera PullMessages response to Zoneminder:

Code: Select all

 <?xml
        version="1.0"
        encoding="UTF-8"
        ?>
    <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
        xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
        xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
        xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex"
        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:wsa5="http://www.w3.org/2005/08/addressing"
        xmlns:xmime="http://tempuri.org/xmime.xsd"
        xmlns:xop="http://www.w3.org/2004/08/xop/include"
        xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
        xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
        xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2"
        xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
        xmlns:tt="http://www.onvif.org/ver10/schema"
        xmlns:ter="http://www.onvif.org/ver10/error"
        xmlns:tns1="http://www.onvif.org/ver10/topics"
        xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
        xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"
        xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
        xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
        xmlns:tdn="http://www.onvif.org/ver10/network/wsdl"
        xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
        xmlns:trp="http://www.onvif.org/ver10/replay/wsdl"
        xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"
        xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl">
        <SOAP-ENV:Header>
            <wsa5:Action
                SOAP-ENV:mustUnderstand="true">
                http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse
                </wsa5:Action>
            </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <tev:PullMessagesResponse>
                <tev:CurrentTime>
                    2024-07-13T16:40:20Z
                    </tev:CurrentTime>
                <tev:TerminationTime>
                    2024-07-13T16:40:40Z
                    </tev:TerminationTime>
                <wsnt:NotificationMessage>
                    <wsnt:SubscriptionReference>
                        <wsa5:Address>
                            </wsa5:Address>
                        </wsnt:SubscriptionReference>
                    <wsnt:Topic
                        Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">
                        tns1:RuleEngine/CellMotionDetector/Motion
                        </wsnt:Topic>
                    <wsnt:Message>
                        <tt:Message
                            PropertyOperation="Initialized"
                            UtcTime="2024-07-13T16:40:28Z">
                            <tt:Source>
                                <tt:SimpleItem
                                    Value="vsconf"
                                    Name="VideoSourceConfigurationToken">
                                    </tt:SimpleItem>
                                <tt:SimpleItem
                                    Value="VideoAnalyticsToken"
                                    Name="VideoAnalyticsConfigurationToken">
                                    </tt:SimpleItem>
                                <tt:SimpleItem
                                    Value="MyMotionDetectorRule"
                                    Name="Rule">
                                    </tt:SimpleItem>
                                </tt:Source>
                            <tt:Data>
                                <tt:SimpleItem
                                    Value="true"
                                    Name="IsMotion">
                                    </tt:SimpleItem>
                                </tt:Data>
                            </tt:Message>
                        </wsnt:Message>
                    </wsnt:NotificationMessage>
                </tev:PullMessagesResponse>
            </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>
I also noticed the message limit for ODM is 1024, for Zoneminder it is 10.
The timeout setting for ODM is 1 minute, the timeout of Zoneminder is 20 seconds.
Again, I don't know if any if this is relevant.

Cheers.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Wed Jul 17, 2024 4:41 pm
by Primed73
I believe this was also happening in 1.37.60 builds.
Shall I spin up a VM and try a test install of previous 1.37 versions to see if it's ever worked for this camera?

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Wed Jul 17, 2024 4:45 pm
by iconnor
No that would be a waste of time.

I've been trying to recreate this with my C520WS... at the moment it doesn't even send event messages...

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Wed Jul 17, 2024 4:54 pm
by Primed73
Have you done a firmware update on the camera recently?
ODM wouldn't even read events until tp-link looked into the firmware fault and pushed an update.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Wed Jul 17, 2024 5:38 pm
by iconnor
NO updates available. ODM does not work with it. Hopefully soon.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Wed Jul 17, 2024 7:43 pm
by Primed73
It looks like they are releasing firmware this month to address this issue for the C520WS:

https://community.tp-link.com/en/smart- ... pic/666806

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Thu Jul 18, 2024 12:52 pm
by iconnor
I'm pretty happy with this cam and once that firmware release comes out, I'll have to make some social media comments about it.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Thu Jul 18, 2024 6:12 pm
by Primed73
I am pretty impressed with tp-link's tech support and forums, as long as you provide them with lists of what is working and not working, what you have done to fix your issue and given screenshots, they get right on it and keep you updated on progress.

I think it was about 3 weeks from them diagnosing the fault, putting together working firmware and pushing it out to me.

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Fri Aug 02, 2024 2:47 pm
by Primed73
Hi @iconnor,
Just out of interest, did they end up pushing a firmware update for the C520WS yet?

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Fri Aug 02, 2024 4:08 pm
by iconnor
They did, I'm at 1.2.28 now... but event subscription doesn't work. Not in ODM or ZM. It doesn't understand the To: directive in the headers

Re: ZM 1.37.61 - ONVIF event messages issues.

Posted: Fri Aug 02, 2024 9:41 pm
by Primed73
I suggest creating a thread on the TP-Link forums, paste a screenshot of the ODM error, they'll probably escalate it to their internal support (like I said, they really are quite good) hopefully they'll push you an updated firmware like they did with me.