blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.77k stars 1.7k forks source link

[Camera Support]: ONVIF error tapo c210 #7893

Closed ehn closed 1 year ago

ehn commented 1 year ago

Describe the problem you are having

I'm trying to enable PTZ controls for a TP-Link Tapo C210 camera. The camera supports ONVIF on port 2020 according to its documentation.

However, on the camera page in Frigate, the control panel is only showing a spinner. There are plenty of ONVIF-related exceptions in the logs.

Version

0.13.0-9185753

Frigate config file

basement_office:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://127.0.0.1:8554/basement_office
        input_args: preset-rtsp-restream
        roles:
        - record
        - audio
      - path: rtsp://127.0.0.1:8554/basement_office_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
    onvif:
      host: 10.0.6.4
      port: 2020
      user: redacted
      password: redacted
    detect:
      width: 640
      height: 360

Relevant log output

2023-09-20 13:56:23.569170917  [2023-09-20 13:56:23] frigate.http                   ERROR   : Exception on /basement_office/ptz/info [GET]
2023-09-20 13:56:23.569174174  Traceback (most recent call last):
2023-09-20 13:56:23.569175516    File "/usr/local/lib/python3.9/dist-packages/onvif/client.py", line 23, in wrapped
2023-09-20 13:56:23.569176565      return func(*args, **kwargs)
2023-09-20 13:56:23.569177787    File "/usr/local/lib/python3.9/dist-packages/onvif/client.py", line 153, in wrapped
2023-09-20 13:56:23.569178777      return call(params, callback)
2023-09-20 13:56:23.569179906    File "/usr/local/lib/python3.9/dist-packages/onvif/client.py", line 140, in call
2023-09-20 13:56:23.569180861      ret = func(**params)
2023-09-20 13:56:23.569181929    File "/usr/local/lib/python3.9/dist-packages/zeep/proxy.py", line 46, in __call__
2023-09-20 13:56:23.569182871      return self._proxy._binding.send(
2023-09-20 13:56:23.569184011    File "/usr/local/lib/python3.9/dist-packages/zeep/wsdl/bindings/soap.py", line 135, in send
2023-09-20 13:56:23.569185036      return self.process_reply(client, operation_obj, response)
2023-09-20 13:56:23.569186197    File "/usr/local/lib/python3.9/dist-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
2023-09-20 13:56:23.569187200      return self.process_error(doc, operation)
2023-09-20 13:56:23.569188387    File "/usr/local/lib/python3.9/dist-packages/zeep/wsdl/bindings/soap.py", line 391, in process_error
2023-09-20 13:56:23.569189266      raise Fault(
2023-09-20 13:56:23.569190194  zeep.exceptions.Fault
2023-09-20 13:56:23.569191015  
2023-09-20 13:56:23.569192079  During handling of the above exception, another exception occurred:
2023-09-20 13:56:23.569192928  
2023-09-20 13:56:23.569193873  Traceback (most recent call last):
2023-09-20 13:56:23.569194989    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-09-20 13:56:23.569195960      response = self.full_dispatch_request()
2023-09-20 13:56:23.569197156    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-09-20 13:56:23.569198096      rv = self.handle_user_exception(e)
2023-09-20 13:56:23.569199215    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-09-20 13:56:23.569200120      rv = self.dispatch_request()
2023-09-20 13:56:23.569201241    File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-09-20 13:56:23.569202298      return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-09-20 13:56:23.569203336    File "/opt/frigate/frigate/http.py", line 1154, in camera_ptz_info
2023-09-20 13:56:23.569204338      return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-09-20 13:56:23.569205380    File "/opt/frigate/frigate/ptz/onvif.py", line 339, in get_camera_info
2023-09-20 13:56:23.569206319      self._init_onvif(camera_name)
2023-09-20 13:56:23.569207350    File "/opt/frigate/frigate/ptz/onvif.py", line 117, in _init_onvif
2023-09-20 13:56:23.569208430      move_request.Speed = ptz.GetStatus({"ProfileToken": profile.token}).Position
2023-09-20 13:56:23.569209493    File "/usr/local/lib/python3.9/dist-packages/onvif/client.py", line 26, in wrapped
2023-09-20 13:56:23.569210374      raise ONVIFError(err)
2023-09-20 13:56:23.569211305  onvif.exceptions.ONVIFError: Unknown error:

FFprobe output from your camera

N/A

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wireless

Camera make and model

TP-Link Tapo C210

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

This has been discussed at https://github.com/blakeblackshear/frigate/discussions/7799#discussioncomment-7021766

It appears something is wrong with tapo c210 onvif implementation causing it to be incompatible

ehn commented 1 year ago

Thanks for the fast reply! Not much to do at this point, it seems.

Which ONVIF implementation is Frigate using?

NickM-27 commented 1 year ago

Frigate uses the onvif-zeep python3 library. It has been compatible with reolink, dahua, loryta cameras I've tried.

Seems some cheaper and knockoff cameras have issues, it is unclear to me if this is just an unsupported onvif protocol or a bug on the camera side that the onvif library doesn't handle.

Either way, we will add a note in the docs for 0.13 that not all cameras are supported and which ones are known working.

danielvandenberg95 commented 1 year ago

See https://github.com/blakeblackshear/frigate/pull/8010

JohnKim91 commented 2 months ago

Frigate uses the onvif-zeep python3 library. It has been compatible with reolink, dahua, loryta cameras I've tried.

Seems some cheaper and knockoff cameras have issues, it is unclear to me if this is just an unsupported onvif protocol or a bug on the camera side that the onvif library doesn't handle.

Either way, we will add a note in the docs for 0.13 that not all cameras are supported and which ones are known working.

Hi Nick, Can you please share which model you tried to control PTZ? I really looking for it.