Closed exalented closed 1 year ago
The onvif library doesn't like something about the network setup or the camera, the error doesn't really give much to go off of
I've been looking for a sort of command line tool for a while to further debug since the error is too ambiguous. Do you have a suggestion as to what might work to see which line causes the error?
If the failure doesn't occur until you press a button then the failure will be when the move action is sent.
This is not the case. The buttons don't show and I get an infinite spinner under the control panel.
Okay, that seems inconsistent with what was said previously
Frigate hangs the webui when I try to use ptz buttons and throws this weird error from the docker container regarding OnvifVersion?
In any case, the onvif zeep library could be used in python to follow the code in ptz/coordinator.py
I apologize. I was trying to convey the msg that the buttons don't yet exist.
Sorry, but where is coordinator.py?
Here's some evidence of the camera responding correctly event though it's on a different network.
zeep.transports DEBUG : HTTP Post to http://10.0.0.5:8999/onvif/device_service:
zeep.transports DEBUG : HTTP Response from http://10.0.0.5:8999/onvif/device_service (status: 200):
Here's what I've gathered so far following frigate/ptz/onvif.py
using this tool (installed through AUR) https://github.com/FalkTannhaeuser/python-onvif-zeep:
$ onvif-cli --user 'admin' --password 'password' --host '10.0.0.5' --port 8999 --wsdl /usr/lib/python3.11/site-packages/wsdl/ devicemgmt GetWsdlUrl
True: www.onvif.org
$ onvif-cli ... devicemgmt GetHostname
True: OrderedDict([('FromDHCP', False), ('Name', None), ('Extension', None), ('_attr_1', None)])
$ onvif-cli ... devicemgmt GetDeviceInformation
True: OrderedDict([('Manufacturer', None), ('Model', 'IPD-E2A5L18'), ('FirmwareVersion', 'V1.04.11-190722'), ('SerialNumber', '071D3E46F324'), ('HardwareId', '1.0')])
$ onvif-cli ... devicemgmt GetCapabilities
True: OrderedDict([('Analytics', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/analytics_service'), ('RuleSupport', True), ('AnalyticsModuleSupport', True), ('_value_1', None), ('_attr_1', None)])), ('Device', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/device_service'), ('Network', OrderedDict([('IPFilter', False), ('ZeroConfiguration', False), ('IPVersion6', False), ('DynDNS', False), ('Extension', None), ('_attr_1', None)])), ('System', OrderedDict([('DiscoveryResolve', True), ('DiscoveryBye', True), ('RemoteDiscovery', False), ('SystemBackup', False), ('SystemLogging', True), ('FirmwareUpgrade', True), ('SupportedVersions', [OrderedDict([('Major', 2), ('Minor', 40)]), OrderedDict([('Major', 2), ('Minor', 20)]), OrderedDict([('Major', 2), ('Minor', 10)]), OrderedDict([('Major', 2), ('Minor', 0)])]), ('Extension', None), ('_attr_1', None)])), ('IO', OrderedDict([('InputConnectors', 1), ('RelayOutputs', 1), ('Extension', None), ('_attr_1', None)])), ('Security', OrderedDict([('TLS1.1', False), ('TLS1.2', False), ('OnboardKeyGeneration', False), ('AccessPolicyConfig', False), ('X.509Token', False), ('SAMLToken', False), ('KerberosToken', False), ('RELToken', False), ('_value_1', None), ('Extension', None), ('_attr_1', None)])), ('Extension', None), ('_attr_1', None)])), ('Events', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/event_service'), ('WSSubscriptionPolicySupport', True), ('WSPullPointSupport', True), ('WSPausableSubscriptionManagerInterfaceSupport', False), ('_value_1', None), ('_attr_1', None)])), ('Imaging', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/image_service'), ('_attr_1', None)])), ('Media', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/media_service'), ('StreamingCapabilities', OrderedDict([('RTPMulticast', True), ('RTP_TCP', True), ('RTP_RTSP_TCP', True), ('Extension', None), ('_attr_1', None)])), ('_value_1', [<Element {http://www.onvif.org/ver10/schema}Extension at 0x7fa0a4231000>]), ('Extension', None), ('_attr_1', None)])), ('PTZ', OrderedDict([('XAddr', 'http://192.168.0.254:8999/onvif/ptz_service'), ('_value_1', None), ('_attr_1', None)])), ('Extension', OrderedDict([('_value_1', [<Element {http://www.onvif.org/ver10/schema}DeviceIO at 0x7fa0a4233940>, <Element {http://www.onvif.org/ver10/schema}AnalyticsDevice at 0x7fa0a4233900>]), ('DeviceIO', None), ('Display', None), ('Recording', None), ('Search', None), ('Replay', None), ('Receiver', None), ('AnalyticsDevice', None), ('Extensions', None)])), ('_attr_1', None)])
", object_pairs_hook=OrderedDict
https://stackoverflow.com/questions/6921699/can-i-get-json-to-load-into-an-ordereddict
Ok frigate is hanging here expecting information from :8999/onvif/media_service
: https://github.com/blakeblackshear/frigate/blob/ab50d0b00623297f6d2e32b9add16925b670d85e/frigate/ptz.py#L216C60-L216C60
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/opt/frigate/frigate/http.py", line 1003, in camera_ptz_info
return jsonify(current_app.onvif.get_camera_info(camera_name))
File "/opt/frigate/frigate/ptz.py", line 217, in get_camera_info
"features": self.cams[camera_name]["features"],
KeyError: 'features'
The camera responds with Document Error: site or page not found ... Cannot open URL
(404). Not sure what kind of information is supposed to be provided here that would end up in features
Onvier confirms that http://www.onvif.org/onvif/ver20/ptz/wsdl/ptz.wsdl#op.GetPresets is working properly
The media service provides the token needed to request PTZ and other information. It sounds like your camera does not correctly conform to the Onvif standard
Tokens like the following seem to be exposed here http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl#op.GetProfiles: VIDEO_CH0 AUDIOSRC_CH0 H264_MAJOR_CH0 H264_MINOR_CH0 AUDIOENC_CH0 VideoAnalyticsToken PTZCFG_CH0 METADATA_CH0 MainStream SubStream
Do you see a way of this being implemented? Instead of breaking the Onvif standard could frigate make it possible to control PTZ with a 'different service' (example: hikvison)
Tokens like the following seem to be exposed here
No, those are not the tokens I am referring to. The camera returns a specific token that it knows. For example my amcrest camera returns 00000
as the token for PTZConfiguration.token.
Do you see a way of this being implemented? Instead of breaking the Onvif standard could frigate make it possible to control PTZ with a 'different service' (example: hikvison)
I don't think it is worth the effort to support proprietary standards. also not sure what you mean about hikvision, their cameras implement onvif per the standard from what I have seen.
not sure what you mean about hikvision
Forgive me. I'm not as knowledgeable as you when it comes to these standards. What I meant is some sort of way to exec a command from the command line. I understand this is a pretty hacky solution. I made this pan.sh because that was the intended direction of Zoneminder. I would understand if you disagreed with this direction for the project.
7228
I'll give this a test drive.
Not sure where to put this. I built the handle-ptz-error branch into a docker image. Seems like dev branch work still needs attending. Perhaps I'll wait for CI to build an image?
docker/rootfs/usr/local/go2rtc/create_config.py
frigate-handle-ptz-error | [INFO] Preparing go2rtc config...
frigate-handle-ptz-error | Traceback (most recent call last):
frigate-handle-ptz-error | File "/usr/local/go2rtc/create_config.py", line 10, in <module>
frigate-handle-ptz-error | from frigate.const import BIRDSEYE_PIPE # noqa: E402
frigate-handle-ptz-error | ModuleNotFoundError: No module named 'frigate'
frigate-handle-ptz-error | time [INFO] The go2rtc service exited with code 1 (by signal 0)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I tried the 0.13 Beta 1 with the docker image. The webui no longer hangs and I can click a different camera and whatnot, but PTZ is still not working.
Frigate api:
$ curl -sL "http://10.0.0.10:5000/api/meme/ptz/info"
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.25.2</center>
</body>
</html>
Here is how the camera is responding:
frigate | ~~~ ~~ zeep.transports DEBUG : HTTP Post to http://10.66.66.20:8999/onvif/device_service:
frigate | ~~~ ~~ <?xml version='1.0' encoding='utf-8'?>
frigate | ~~~ ~~ <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Usern
ameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">jZyyIoZC7YwKMBf6SN+tyI3qq5c=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-ope
n.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ox6Rg7TbuyM4XsC9Jia4Ew==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-09-15T01:33:52+00:00</wsu:Creat
ed></wsse:UsernameToken></wsse:Security></soap-env:Header><soap-env:Body><ns0:GetCapabilities xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"><ns0:Category>All</ns0:Category></ns0:GetCapabilities></soap-env:Body></soap-env:Envelope>
frigate | ~~~ ~~ urllib3.connectionpool DEBUG : Starting new HTTP connection (1): 10.66.66.20:8999
frigate | ~~~ ~~ urllib3.connectionpool DEBUG : http://10.66.66.20:8999 "POST /onvif/device_service HTTP/1.1" 200 5404
frigate | ~~~ ~~ zeep.transports DEBUG : HTTP Response from http://10.66.66.20:8999/onvif/device_service (status: 200):
frigate | ~~~ ~~ <?xml version="1.0" encoding="UTF-8"?>
frigate | ~~~ ~~ <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.or
g/2001/XMLSchema" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:c14n="http://www.w3.org/20
01/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/incl
ude" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsrf="http://docs.oasis-open.org/wsrf/r-
2" xmlns:cpp="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:dl="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:eve="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:nc="http://www.onvif.org/ver10/even
ts/wsdl/NotificationConsumerBinding" xmlns:np="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:pp="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:pps="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBin
ding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:psm="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:rd="http://www.onvif.org/ver10/network/wsdl/RemoteDiscovery
Binding" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:sm="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tmd="http
://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:bf2="http://docs.oasis-open.org/wsrf/bf-2" xmlns:ter="http://www.o
nvif.org/ver10/error" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Analytics><tt:XAddr>http://192.168.0.254:8999/onvif/analytics_service</tt:XAddr
><tt:RuleSupport>true</tt:RuleSupport><tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport></tt:Analytics><tt:Device><tt:XAddr>http://192.168.0.254:8999/onvif/device_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:Network><tt:System><tt:DiscoveryResolve>true</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:Syst
emBackup>false</tt:SystemBackup><tt:SystemLogging>true</tt:SystemLogging><tt:FirmwareUpgrade>true</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:
Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>0</tt:Minor></tt:SupportedVersions></tt:System><tt:IO><tt:InputConnect
ors>1</tt:InputConnectors><tt:RelayOutputs>1</tt:RelayOutputs></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.509
Token>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://192.168.0.254:8999/onvif/event_service</tt:XAddr><tt:WSSubscription
PolicySupport>true</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>true</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://192.168
.0.254:8999/onvif/image_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://192.168.0.254:8999/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>true</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_R
TSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>2</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:PTZ><tt:XAddr>http://192.168.0.254:8999/onvif/ptz_service</tt:XAddr></
tt:PTZ><tt:Extension><tt:DeviceIO><tt:XAddr>http://192.168.0.254:8999/onvif/deviceio_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>1</tt:AudioSources><tt:AudioOutputs>1</tt:AudioOutputs><tt:Relay
Outputs>1</tt:RelayOutputs></tt:DeviceIO><tt:AnalyticsDevice><tt:XAddr>http://192.168.0.254:8999/onvif/display_service</tt:XAddr><tt:RuleSupport>true</tt:RuleSupport></tt:AnalyticsDevice></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></SOA
P-ENV:Body></SOAP-ENV:Envelope>
..
frigate | ~~~ ~~ zeep.wsdl.wsdl DEBUG : Adding service: EventService
frigate | ~~~ ~~ zeep.transports DEBUG : HTTP Post to http://192.168.0.254:8999/onvif/event_service:
<?xml version='1.0' encoding='utf-8'?>
frigate | ~~~ ~~ <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:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/CreateP
ullPointSubscriptionRequest</wsa:Action><wsa:MessageID>urn:uuid:21623cd2-e4fc-4318-b104-34900ae5ba25</wsa:MessageID><wsa:To>http://192.168.0.254:8999/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:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">2FVcBYS2fUlwgX9qCTnuP1hRQ7I=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">A2wtOMsYHvif03+vIasnlw==</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2023-09-15T01:33:53+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"/></soap-env:Body></soap-env:Envelope>
frigate | ~~~ ~~ urllib3.connectionpool DEBUG : Starting new HTTP connection (1): 192.168.0.254:8999
..
<zeep.xsd.dynamic_types.OnvifVersion object at 0x7f7595c6b7c0>)
frigate.ptz.onvif ERROR : Unable to connect to camera: meme: Unknown error: HTTPConnectionPool(host='192.168.0.254', port=8999): Max retries exceeded with url: /onvif/media_service (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f51e00ac280>: Failed to establish a new connection: [Errno 110] Connection timed out'))
frigate | ~~~ ~~ [error] 549#549: *47 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.0.0.47, server: , request: "GET /api/meme/ptz/info HTTP/1.1", upstream: "http://127.0.0.1:5001/meme/ptz/info", host: "10.0.0.10:5000"
Continues to loop
but PTZ is still not working.
right, I did not expect this to fix that. Some cameras that don't fully follow the ONVIF standard won't be supported in this release. Once we have a more comprehensive of what cameras that includes, the docs will be updated to reflect that
Hey thanks so much Nick
Describe the problem you are having
'http://'$addr':'$port'/form/setPTZCfg'
in order to achieve PTZ.Version(s)
0.13.0-83006ee image: ghcr.io/blakeblackshear/frigate:dev-83006ee-tensorrt image: ghcr.io/blakeblackshear/frigate:0.13.0-beta1
Relevant Frigate config file keys
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Other Linux
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
Jidtech IPD-E2A5L18 PTZ POE 20X (don't buy this camera)
Any other information that may be helpful
No response