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

XM530AI AZISHN 1080P 2.0MP Wifi IP Camera live stream not working #91678

Closed
Dehumanizer77 opened this issue Apr 19, 2023 · 70 comments · Fixed by #91485 or #92711
Closed

XM530AI AZISHN 1080P 2.0MP Wifi IP Camera live stream not working #91678

Dehumanizer77 opened this issue Apr 19, 2023 · 70 comments · Fixed by #91485 or #92711
Assignees
Labels
integration: onvif problem in device Issue lies within the device, such firmware, software, or user customization/config stale

Comments

@Dehumanizer77
Copy link

The problem

Since I have upgraded to core 2023.4.5, one of my onvif cameras is constantly rebooting. When I look to integrations, I am seeing this:
Retrying configuration: Could not connect to camera 172.16.0.120:8899: All connection attempts failed
and the camera is restarted every time HA retries the connection.
It seems the initial onvif command is causing the camera to restart for some reason. There was no such issue in 2023.4.4 and it's still working fine when I have downgraded to 2023.4.4

What version of Home Assistant Core has the issue?

core-2023.4.5

What was the last working version of Home Assistant Core?

core-2023.4.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

onvif

Link to integration documentation on our website

https://www.home-assistant.io/integrations/onvif/

Diagnostics information

This is all related to the camera in question, I assume that after the last Post request the camera dies.

2023-04-19 14:00:57.028 DEBUG (MainThread) [onvif] Creating service ('devicemgmt', None) with http://172.16.0.120:8899/onvif/device_service
2023-04-19 14:00:57.033 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/device_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/device/wsdl/GetCapabilities</wsa:Action>wsa:MessageIDurn:uuid:ac603861-657e-46e0-b51a-950f4b3e5415</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">/DXS2Ozschj3lSESWjqnN+wEzL4=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">z/XSxllISP7/HGzmnsqvSA==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:00:57+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetCapabilities xmlns:ns0="http://www.onvif.org/ver10/device/wsdl">ns0:CategoryAll</ns0:Category></ns0:GetCapabilities></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.350 DEBUG (MainThread) [onvif] Creating service ('devicemgmt', None) with http://172.16.0.120:8899/onvif/device_service
2023-04-19 14:02:17.353 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/device_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/device/wsdl/GetCapabilities</wsa:Action>wsa:MessageIDurn:uuid:efc6015d-1f90-4455-9ef8-7fdab3813f85</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">UXS1tulvIPTLWxBOhBJC0zpfeTw=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Wr+8mts4knmddKvm1jfjag==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetCapabilities xmlns:ns0="http://www.onvif.org/ver10/device/wsdl">ns0:CategoryAll</ns0:Category></ns0:GetCapabilities></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.409 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/device_service (status: 200):
b'<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:ter="http://www.onvif.org/ver10/error"><s:Header>wsa:MessageIDurn:uuid:efc6015d-1f90-4455-9ef8-7fdab3813f85</wsa:MessageID></s:Header><s:Body>tds:GetCapabilitiesResponsetds:Capabilitiestt:Analyticstt:XAddrhttp://172.16.0.120:8899/onvif/analytics_service</tt:XAddr>tt:RuleSupporttrue</tt:RuleSupport>tt:AnalyticsModuleSupporttrue</tt:AnalyticsModuleSupport></tt:Analytics>tt:Devicett:XAddrhttp://172.16.0.120:8899/onvif/device_service</tt:XAddr>tt:Networktt:IPFilterfalse</tt:IPFilter>tt:ZeroConfigurationtrue</tt:ZeroConfiguration>tt:IPVersion6false</tt:IPVersion6>tt:DynDNStrue</tt:DynDNS>tt:Extensiontt:Dot11Configurationfalse</tt:Dot11Configuration></tt:Extension></tt:Network>tt:Systemtt:DiscoveryResolvefalse</tt:DiscoveryResolve>tt:DiscoveryByetrue</tt:DiscoveryBye>tt:RemoteDiscoveryfalse</tt:RemoteDiscovery>tt:SystemBackupfalse</tt:SystemBackup>tt:SystemLoggingtrue</tt:SystemLogging>tt:FirmwareUpgradefalse</tt:FirmwareUpgrade>tt:SupportedVersionstt:Major17</tt:Major>tt:Minor12</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major16</tt:Major>tt:Minor12</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major2</tt:Major>tt:Minor60</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major2</tt:Major>tt:Minor40</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major2</tt:Major>tt:Minor20</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major2</tt:Major>tt:Minor10</tt:Minor></tt:SupportedVersions>tt:SupportedVersionstt:Major2</tt:Major>tt:Minor0</tt:Minor></tt:SupportedVersions>tt:Extensiontt:HttpFirmwareUpgradefalse</tt:HttpFirmwareUpgrade>tt:HttpSystemBackupfalse</tt:HttpSystemBackup>tt:HttpSystemLoggingfalse</tt:HttpSystemLogging>tt:HttpSupportInformationfalse</tt:HttpSupportInformation></tt:Extension></tt:System>tt:IOtt:InputConnectors0</tt:InputConnectors>tt:RelayOutputs1</tt:RelayOutputs>tt:Extensiontt:Auxiliaryfalse</tt:Auxiliary><tt:Extension /></tt:Extension></tt:IO>tt:Securitytt:TLS1.1false</tt:TLS1.1>tt:TLS1.2false</tt:TLS1.2>tt:OnboardKeyGenerationfalse</tt:OnboardKeyGeneration>tt:AccessPolicyConfigtrue</tt:AccessPolicyConfig>tt:X.509Tokenfalse</tt:X.509Token>tt:SAMLTokenfalse</tt:SAMLToken>tt:KerberosTokenfalse</tt:KerberosToken>tt:RELTokenfalse</tt:RELToken>tt:Extensiontt:TLS1.0false</tt:TLS1.0>tt:Extensiontt:Dot1Xtrue</tt:Dot1X>tt:SupportedEAPMethod0</tt:SupportedEAPMethod>tt:RemoteUserHandlingfalse</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device>tt:Eventstt:XAddrhttp://172.16.0.120:8899/onvif/event_service</tt:XAddr>tt:WSSubscriptionPolicySupporttrue</tt:WSSubscriptionPolicySupport>tt:WSPullPointSupporttrue</tt:WSPullPointSupport>tt:WSPausableSubscriptionManagerInterfaceSupportfalse</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events>tt:Imagingtt:XAddrhttp://172.16.0.120:8899/onvif/image_service</tt:XAddr></tt:Imaging>tt:Mediatt:XAddrhttp://172.16.0.120:8899/onvif/media_service</tt:XAddr>tt:StreamingCapabilitiestt:RTPMulticastfalse</tt:RTPMulticast>tt:RTP_TCPtrue</tt:RTP_TCP>tt:RTP_RTSP_TCPtrue</tt:RTP_RTSP_TCP></tt:StreamingCapabilities>tt:Extensiontt:ProfileCapabilitiestt:MaximumNumberOfProfiles3</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media>tt:PTZtt:XAddrhttp://172.16.0.120:8899/onvif/ptz_service</tt:XAddr></tt:PTZ>tt:Extensiontt:DeviceIOtt:XAddrhttp://172.16.0.120:8899/onvif/deviceIO_service</tt:XAddr>tt:VideoSources1</tt:VideoSources>tt:VideoOutputs0</tt:VideoOutputs>tt:AudioSources1</tt:AudioSources>tt:AudioOutputs0</tt:AudioOutputs>tt:RelayOutputs0</tt:RelayOutputs></tt:DeviceIO></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>'
2023-04-19 14:02:17.422 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/device_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime</wsa:Action>wsa:MessageIDurn:uuid:7bc893c7-83bc-4078-a56e-1ade3a2bb7c1</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">BhiHmx6tMnhISzXGpvylJgq1fBw=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xYC8zwoAVU7yxZWhi4YRAQ==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetSystemDateAndTime xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"/></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.481 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/device_service (status: 200):
2023-04-19 14:02:17.497 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/device_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/device/wsdl/GetDeviceInformation</wsa:Action>wsa:MessageIDurn:uuid:64b95439-68e2-4e26-84bd-4fb725727235</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">TtCOJPHGIhhcSkn/qgcu70bWXMg=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">pEM9dyftwaq/818KVejuiw==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetDeviceInformation xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"/></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.548 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/device_service (status: 200):
2023-04-19 14:02:17.553 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/device_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/device/wsdl/GetNetworkInterfaces</wsa:Action>wsa:MessageIDurn:uuid:6b6d41b5-20a6-4662-9764-904b389a9bfe</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">LWcDt7evgPlrg/FZeuWDlw9NPH4=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">jiv/pBhaWj3kO3tKMbxkaQ==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetNetworkInterfaces xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"/></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.606 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/device_service (status: 200):
b'<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:ter="http://www.onvif.org/ver10/error"><s:Header>wsa:MessageIDurn:uuid:6b6d41b5-20a6-4662-9764-904b389a9bfe</wsa:MessageID></s:Header><s:Body>tds:GetNetworkInterfacesResponse<tds:NetworkInterfaces token="eth0">tt:Enabledtrue</tt:Enabled>tt:Infott:Nameeth0</tt:Name>tt:HwAddress00:12:43:21:81:48</tt:HwAddress>tt:MTU1500</tt:MTU></tt:Info>tt:IPv4tt:Enabledtrue</tt:Enabled>tt:Configtt:Manualtt:Address172.16.0.120</tt:Address>tt:PrefixLength24</tt:PrefixLength></tt:Manual>tt:DHCPfalse</tt:DHCP></tt:Config></tt:IPv4></tds:NetworkInterfaces><tds:NetworkInterfaces token="eth1">tt:Enabledtrue</tt:Enabled>tt:Infott:Nameeth2</tt:Name>tt:HwAddressA4:EF:15:48:30:B7</tt:HwAddress>tt:MTU1500</tt:MTU></tt:Info>tt:IPv4tt:Enabledtrue</tt:Enabled>tt:Configtt:Manualtt:Address172.16.0.120</tt:Address>tt:PrefixLength24</tt:PrefixLength></tt:Manual>tt:DHCPfalse</tt:DHCP></tt:Config></tt:IPv4></tds:NetworkInterfaces></tds:GetNetworkInterfacesResponse></s:Body></s:Envelope>'
2023-04-19 14:02:17.611 DEBUG (MainThread) [onvif] Creating service ('media', None) with http://172.16.0.120:8899/onvif/media_service
2023-04-19 14:02:17.616 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/media_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/media/wsdl/GetServiceCapabilities</wsa:Action>wsa:MessageIDurn:uuid:5e9b8858-1505-4f72-bdcb-0e0e0109edbe</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/media_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">CUZXN4qc58kWp3LuaPhZbKE+Eak=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">3aaDEJly4cJ/97dGjY53/g==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetServiceCapabilities xmlns:ns0="http://www.onvif.org/ver10/media/wsdl"/></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.688 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/media_service (status: 200):
2023-04-19 14:02:17.698 DEBUG (MainThread) [onvif] Creating service ('events', None) with http://172.16.0.120:8899/onvif/event_service
2023-04-19 14:02:17.702 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/event_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest</wsa:Action>wsa:MessageIDurn:uuid:5f02e508-b6b6-4ebb-9b69-1d5cf519ed1f</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/event_service</wsa:To>wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionRequest</wsa:Action>wsa:MessageIDurn:uuid:d5265942-8b97-47d3-ae98-50e01c12f3fc</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/event_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">/0MsaSXy/0tqUjp4mmHhc0Ct+sY=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">vF8lpivJtXIf+cO4z96iAA==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:CreatePullPointSubscription xmlns:ns0="http://www.onvif.org/ver10/events/wsdl">ns0:InitialTerminationTime2023-04-20T12:02:17Z</ns0:InitialTerminationTime></ns0:CreatePullPointSubscription></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.789 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/onvif/event_service (status: 200):
b'<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:ter="http://www.onvif.org/ver10/error"><s:Header>wsa:MessageIDurn:uuid:5f02e508-b6b6-4ebb-9b69-1d5cf519ed1f</wsa:MessageID>wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionResponse</wsa:Action></s:Header><s:Body>tev:CreatePullPointSubscriptionResponsetev:SubscriptionReferencewsa:Addresshttp://172.16.0.120:8899/event_service/0</wsa:Address></tev:SubscriptionReference>wsnt:CurrentTime2023-04-19T15:08:49Z</wsnt:CurrentTime>wsnt:TerminationTime2023-04-19T15:08:49Z</wsnt:TerminationTime></tev:CreatePullPointSubscriptionResponse></s:Body></s:Envelope>'
2023-04-19 14:02:17.795 DEBUG (MainThread) [onvif] Creating service ('subscription', 'PullPointSubscription') with http://172.16.0.120:8899/event_service/0
2023-04-19 14:02:17.797 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/event_service/0:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewRequest</wsa:Action>wsa:MessageIDurn:uuid:54d6e22a-3177-45f6-a486-913262736f0e</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/event_service/0</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">jcsgBie5726I4WFqZXo2a/nfvX4=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">uhy5KcftIcg8C0FwxDrc8g==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:Renew xmlns:ns0="http://docs.oasis-open.org/wsn/b-2">ns0:TerminationTime2023-04-20T12:02:17Z</ns0:TerminationTime></ns0:Renew></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.857 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/event_service/0 (status: 200):
2023-04-19 14:02:17.860 DEBUG (MainThread) [onvif] Creating service ('pullpoint', 'PullPointSubscription') with http://172.16.0.120:8899/event_service/0
2023-04-19 14:02:17.862 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/event_service/0:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SetSynchronizationPointRequest</wsa:Action>wsa:MessageIDurn:uuid:c58d385c-bec8-40cb-b460-eb71a11638cd</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/event_service/0</wsa:To>wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/PullPointSubscription/SetSynchronizationPointRequest</wsa:Action>wsa:MessageIDurn:uuid:69469021-605f-4ae8-9eeb-08e3a87ce6ff</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/event_service/0</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">D0kzhqaru4Te77sq+wRFWZ1NqbI=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">hyPZ255um/rGxT9noWd14w==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:SetSynchronizationPoint xmlns:ns0="http://www.onvif.org/ver10/events/wsdl"/></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:17.911 DEBUG (MainThread) [zeep.transports] HTTP Response from http://172.16.0.120:8899/event_service/0 (status: 200):
2023-04-19 14:02:17.917 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/event_service/0:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest</wsa:Action>wsa:MessageIDurn:uuid:913a0b7b-3193-40b2-ab86-a4a437a128c8</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/event_service/0</wsa:To>wsa:Actionhttp://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest</wsa:Action>wsa:MessageIDurn:uuid:68247829-769b-43c8-b2da-bf9f1de62a3c</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/event_service/0</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">wK0eJzTZ5Izv51dQK5f+vdSVQpI=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">mTytDAQxBMYlaojqmIFJrg==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:17+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:PullMessages xmlns:ns0="http://www.onvif.org/ver10/events/wsdl">ns0:TimeoutPT5S</ns0:Timeout>ns0:MessageLimit100</ns0:MessageLimit></ns0:PullMessages></soap-env:Body></soap-env:Envelope>'
2023-04-19 14:02:18.016 DEBUG (MainThread) [onvif] Creating service ('imaging', None) with http://172.16.0.120:8899/onvif/image_service
2023-04-19 14:02:18.022 DEBUG (MainThread) [zeep.transports] HTTP Post to http://172.16.0.120:8899/onvif/media_service:
b'\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:Actionhttp://www.onvif.org/ver10/media/wsdl/GetProfiles</wsa:Action>wsa:MessageIDurn:uuid:f56d9064-d15c-431f-b98c-d35c276782ed</wsa:MessageID>wsa:Tohttp://172.16.0.120:8899/onvif/media_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:UsernameTokenwsse:Usernameadmin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">xxNl4MKXC+En/14+N/ymo2Uo+4s=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">X8uYNYzHQDlitJlRsKXUTw==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-04-19T12:02:18+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header>soap-env:Body<ns0:GetProfiles xmlns:ns0="http://www.onvif.org/ver10/media/wsdl"/></soap-env:Body></soap-env:Envelope>'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @hunterjm, mind taking a look at this issue as it has been labeled with an integration (onvif) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of onvif can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign onvif Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


onvif documentation
onvif source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Apr 21, 2023

I have a new version I'm working on here that might avoid the issue (or not as nothing should be triggering the camera to crash and reboot)

#91661 (comment)

Please report the reboots to the camera vendor so they can fix their firmware. There isn't anything outlandish going on with the onvif integration, and it should not be able to cause the camera to reboot on its own.

@Dehumanizer77
Copy link
Author

Sure, I can, but you know how it is with chinese vendors... Plus I would need something to report, as I don't exactly know what triggers the reboot, I don't know exactly how to replicate it.

@bdraco
Copy link
Member

bdraco commented Apr 21, 2023

In theory it would be the last xml post before the camera crashes. If you can figure out which one it is we might be able to avoid the issue... but the vendor should really fix their firmware 😉

@Dehumanizer77
Copy link
Author

I 100% agree they should fix it...

@csurulyal
Copy link

csurulyal commented Apr 22, 2023

My camera is on a dead loop as well :( . I don't think the vendor should fix the firmware. Until 4.4 it worked well.

@GrimDeclaw
Copy link

Hi,
Same boat here : random chinese onvif ptz cam, on reboot loop since 2.4.5 until I disable the integration.

@GrimDeclaw
Copy link

I have a new version I'm working on here that might avoid the issue (or not as nothing should be triggering the camera to crash and reboot)

#91661 (comment)

Please report the reboots to the camera vendor so they can fix their firmware. There isn't anything outlandish going on with the onvif integration, and it should not be able to cause the camera to reboot on its own.

It actualy did the trick. The custom_component git pull fix the reboot loop

@tomajzl
Copy link

tomajzl commented Apr 25, 2023

Hi, same problem here.

I have chinese cameras: XM-PT817-50P

https://www.techage.com/products/techage-5mp-48v-poe-ptz-dome-video-camera-ai-human-detect-two-way-audio-camera-onvif-xmeye-with-tf-card-slot

Before update of HA was ONVIF working properly.
After update is this camera not available in HA and not available anymore thru any other access (web interface or NVR in my network). I must to delete/disable ONVIF integration for this camera IP adress to make it alive.

Error log from HA:

Logger: homeassistant.config_entries
Source: config_entries.py:942
First occurred: April 24, 2023 at 18:19:22 (5 occurrences)
Last logged: 17:38:20

Config entry 'Auto - 00:12:41:77:BB:25' for onvif integration not ready yet: Could not connect to camera 192.168.2.15:8899: All connection attempts failed; Retrying in background
Config entry 'Vyper_back - 00:12:43:0A:CB:F9' for onvif integration not ready yet: Could not connect to camera 192.168.2.23:8899: All connection attempts failed; Retrying in background
Config entry 'NVT - 00:12:43:0A:CB:F9' for onvif integration not ready yet: Could not connect to camera, verify credentials are correct: Invalid Timezone; Retrying in background
Config entry 'Camera_test - 00:12:43:0A:CB:F9' for onvif integration not ready yet: Could not connect to camera 192.168.2.23:8899: All connection attempts failed; Retrying in background

Onvif_error

@Artekbed
Copy link

Cześć, tutaj ten sam problem.

Mam aparaty chińskie: XM-PT817-50P

https://www.techage.com/products/techage-5mp-48v-poe-ptz-dome-video-camera-ai-human-detect-two-way-audio-camera-onvif-xmeye-with-tf- Gniazdo karty

Przed aktualizacją HA ONVIF prawidłowo. Po aktualizacji ta kamera jest niedostępna w HA i nie jest już dostępna przez żaden inny dostęp (interfejs internetowy lub NVR w mojej sieci). Należy włączyć/wyłączyć dodatkowy ONVIF dla tego adresu IP kamery, aby ożywić.

Dziennik błędów z HA:

Rejestrator: homeassistant.config_entries Źródło: config_entries.py:942 Pierwsze wystąpienie: 24 kwietnia 2023 r. o 18:19:22 (5 wystąpień) Ostatnie logowanie: 17:38:20

Wpis konfiguracji „Auto - 00:12:41:77:BB:25” dla integracji onvif jeszcze nie jest kompletny: Nie można połączyć się z kamerą 192.168.2.15:8899: Wszystkie próby połączenia nie powiodły się; Ponawianie próby w tle Wpis konfiguracji „Vyper_back - 00:12:43:0A:CB:F9” dla integracji onvif jeszcze nie jest kompletne: Nie można połączyć się z kamerą 192.168.2.23:8899: Wszystkie połączenia połączenia nie powiodły się; Ponawianie próby w tle Wpis konfiguracji „NVT - 00:12:43:0A:CB:F9” dla integracji onvif jeszcze nie jest skończone: Nie można połączyć się z kamerą, sprawdź poprawność poświadczeń: Nieprawidłowość strefy czasowej; Ponawianie próby w tle Wpis konfiguracji „Camera_test - 00:12:43:0A:CB:F9” dla integracji onvif jeszcze nie jest kompletny: Nie można połączyć się z kamerą 192.168.2.23:8899: Wszystkie próby połączenia nie powiodły się; Ponawiam próbę w tle

Onvif_error

Check the CORE logs, you will probably get a similar message:

2023-04-26 14:01:31.755 WARNING (MainThread) [homeassistant.components.onvif] The date/time on NVT (UTC) is '2023-04-26 13:01:31+00:00', which is different from the system '2023-04-26 12:01:31.703516+00:00', this could lead to authentication issues

Camera date is invalid and not authenticated. Apparently you need to change the time zone in the camera, but after restarting the error comes back. I'm fighting with that too.

@bdraco
Copy link
Member

bdraco commented Apr 26, 2023

Thanks for the link. Ordered that camera. Probably already fixed in 2023.5.x though

@Dehumanizer77
Copy link
Author

I can confirm that in core version 2023.5.2 the problem has been fixed. Thank you!

@tomajzl
Copy link

tomajzl commented May 8, 2023

Hello, I can also confirm, that issue, which I had with some cameras has been fixedy by 2023.5.0 release.
Now all cameras working as magic as before troubles.

Information for others: Timezone was not the issue (I tried lot of settings and no help until released fix in 2023.5.0).

Guys, you are AWESOME!

Thank you :)

@Dehumanizer77
Copy link
Author

Well, it's still not really OK, I have just found that I can't get a stream in HA out of the camera. I have it on the dashboard, the static image which gets reloaded every 10 seconds is OK, but when I click it to get the realtime video, I can't even see the video controls (i.e. play button, fullscreen button etc. I just get a title and that's it, like this:
Screenshot at 2023-05-08 19-18-08
Plus, now when I open the camera software and want to go to the settings, the camera reboots. When I detach it from HA, it doesn't do it. So I suppose the camera still gets somehow overloaded by some commands from HA or something...

@bdraco
Copy link
Member

bdraco commented May 8, 2023

I ordered that techage camera a few weeks ago. It still hasn’t showed up yet. I will see if I can improve compatibility when it does

From the tracking it looks like it will show up next week

@bdraco bdraco reopened this May 8, 2023
@bdraco
Copy link
Member

bdraco commented May 8, 2023

@Dehumanizer77 can you post a link to the one you are using if it’s not the same?

@Dehumanizer77
Copy link
Author

Sure, it's this one:
https://a.aliexpress.com/_mswXcuu

@bdraco
Copy link
Member

bdraco commented May 8, 2023 via email

@Dehumanizer77
Copy link
Author

Thanks a lot!
If you can accept bitcoin lightning payments, I can contribute you some sats :-)

@bdraco bdraco changed the title Latest changes in onvif causing one of the cameras to reboot all over. Latest changes in onvif causes XM530AI AZISHN 1080P 2.0MP Wifi IP Camera to crash and reboot May 9, 2023
@bdraco bdraco changed the title Latest changes in onvif causes XM530AI AZISHN 1080P 2.0MP Wifi IP Camera to crash and reboot Onvif causes XM530AI AZISHN 1080P 2.0MP Wifi IP Camera to crash and reboot May 9, 2023
@bdraco bdraco added the problem in device Issue lies within the device, such firmware, software, or user customization/config label May 9, 2023
@Dehumanizer77
Copy link
Author

By the way I have observed that the onvif integration now takes a lot of time on startup, at least 30-40 seconds, it wasn't a case before.
And also now it randomly reboots some of my cams on startup (my other cameras are the same as the one I posted, but without wifi). After startup, it doesn't cause any cameras to permanently reboot (but it does from time to time, not really often)

@bdraco
Copy link
Member

bdraco commented May 11, 2023

# Example configuration.yaml entry
logger:
  default: info
  logs:
    homeassistant.components.onvif: debug
    httpx: debug
    onvif: debug
    zeep: debug

If you want to send a full log, I might be able to see something obvious before the camera shows up.

If there is anything sensitive in them that you don't want to post here, my email is [email protected]

1 similar comment
@bdraco

This comment was marked as duplicate.

@Dehumanizer77
Copy link
Author

Is this related to onvif or it's something completely different and unrelated?
Logger: aiohttp.server
Source: /usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py:403
First occurred: 13:26:04 (118 occurrences)
Last logged: 13:34:01

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 332, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.InvalidURLError: 400, message='Invalid char in url path'

@bdraco
Copy link
Member

bdraco commented Jun 1, 2023

There isn't enough information there to give you an answer either way

@Dehumanizer77
Copy link
Author

I have enabled debug logging for aiohttp.server, but I didn't get any more information than this. Any idea how can I find out which URL triggered the error?

@bdraco
Copy link
Member

bdraco commented Jun 1, 2023

I'd probably strace or tcpdump and look at the http traffic coming in

@Dehumanizer77
Copy link
Author

Ok the errors stopped after upgrade to 6.1, however there is still a bug with the restarting camera, even after disabling webhooks, PLEASE change whatever you have changed before. The last working version I have is with HA Core 2023.5.3
With both 6.0 and 6.1 the camera restarts in a loop.

@bdraco
Copy link
Member

bdraco commented Jun 10, 2023

There are a significant amount of changes ~6000 lines and fixes for over 14 different cameras. Without some more information its going to be nearly impossible to know which change triggers the bad behavior in the camera firmware.

Right now its just dumb luck that avoids the problem and subsequently recreates it since we don't know what is triggering the camera to crash. Since I can't recreate the problem with the test unit I purchased, I'll need the strace or tcpdump of the camera traffic right before it crashes to make a better guess about what triggers the camera to crash.

@Dehumanizer77
Copy link
Author

Ok, I hope I'll have some time tomorrow to play with it.

@Dehumanizer77
Copy link
Author

One more thing that came into my mind, I have the camera (as well as the others that don't restart) connected to a NVR, so maybe that's why you can't reproduce it, the camera might have some resources exhausted by beeing connected to some other source as well or something. You might be able to reproduce it if you install the NVR software, connect the camera and let the live stream open, while also connecting it to Home Assistant via onvif.
But I'll try to get the dump of the traffic tomorrow if I'll have a time for that anyway.

@Dehumanizer77
Copy link
Author

I wanted to do a tcpdump but I don't have enough time to play with it and for some reason I am not getting any actual packets in the output, only syn/ack packets... The command I have used is this: tcpdump -i any -s0 src host 192.168.128.10 and dst host 172.16.0.120 -w output.pcap where the first IP is HA server and the second is the camera. I am running tcpdump on the router through which the traffic is forwarded.

@bdraco
Copy link
Member

bdraco commented Jun 11, 2023

You’ll likely have to do the tcpdump on the ha instance as it may not be hitting your router if it stays on the same subnet

@Dehumanizer77
Copy link
Author

Well it's not on the same subnet / vlan as you see, plus the port on the switch from the HA does have port isolation turned on, so it has to pass through the router, that's why I don't understand what's going on. And it logs syn/ack packets... Strange

@Dehumanizer77
Copy link
Author

Ok I was able to get the tcpdump, but this time it seems disabling webhooks has helped... But last time I was testing it, I was even restarting HA and still it was stuck in a reboot loop. Now I only unchecked "disable webhooks" and pressed reload and then restarts have stopped.
Anyway, here are the pcap files in case you'll be able to figure something out of it. First two are with webhooks enabled (both end at the exact time when the camera has stopped responding) and the third one is with webhooks disabled
output.zip

@bdraco
Copy link
Member

bdraco commented Jun 11, 2023

Just a guess but I suspect starting the webhook subscription triggers a memory leak in the camera and it eventually crashes.

Once you disable the webhook you probably need to hard power cycle the camera since even starting the webhook subscription once might start the chain of events that causes the camera to eventually crash

@bdraco
Copy link
Member

bdraco commented Jun 13, 2023

Is everything still stable after disabling webhooks and rebooting the camera?

@Dehumanizer77
Copy link
Author

I have only tested it and got back to 5.3 since there was another unrelated issue in other custom integration, but that has apparently been fixed yesterday so I might give it a try today.

@Dehumanizer77
Copy link
Author

So far so good. I have it now running for about 30 minutes and no camera restart, so hopefully this will last. Previously it was restarting at least once every minute or two so it seems not using webhooks really helps. Will let you know tomorrow to confirm.

@Dehumanizer77
Copy link
Author

Ok, looks like no more restarts without webhooks. What exactly is affected by disabling webhooks, is the funcionality somehow affected?

@bdraco
Copy link
Member

bdraco commented Jun 16, 2023

You won't get motion events if the camera doesn't support pull point.

@Dehumanizer77
Copy link
Author

Well, it seems that with the latest core/HASSos version the problem is partially back. It's not that often, but the camera hangs at least once per day. Sometimes it dies completely and cannot be even pinged, so I have to restart it, and sometimes it's alive but the stream is not working and restarting HA helps.

@Dehumanizer77
Copy link
Author

And sometimes, as right now for example, when I restart the camera, it works for a minute but then hangs and I have to restart HA (without restarting camera), otherwise it's stuck in the usual reboot loop again. After restarting HA, everything back to normal. Websockets are still off.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Dehumanizer77
Copy link
Author

Just for the record, I have been able to somehow work around the issue this way:
When I detect the camera is down, I power cycle it (it's connected to a Sonoff remotely controlled power plug) and also reload the onvif camera integration, just for that one camera, by integration ID, like this:

service: homeassistant.reload_config_entry
data:
  entry_id: fbc08179999aeeed31ca883e8a6be267

Without the integration reload, it ends up in a restart loop, otherwise it's ok for at least another few hours. However it's still not ideal.

@github-actions github-actions bot removed the stale label Sep 26, 2023
@Dehumanizer77
Copy link
Author

Ok so the new version of onvif in home assistant core 2023.11.3 once again broke something. This time it's one of my wired cameras, it refuses to operate when it's added in Home assistant. It does not restart, but it refuses any connection, aparently HA tries to connect to it and triggers some bug.
I had to downgrade. It is perfectly working in 2023.11.2

@Dehumanizer77
Copy link
Author

seems that 2023.12.0 fixed it, now after upgrade to 2023.12.1 the camera has disconnected, but after a while it came back up and seems to be OK so far.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integration: onvif problem in device Issue lies within the device, such firmware, software, or user customization/config stale
Projects
None yet
7 participants