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

Yi Dome Guard add support for PTZ RelativeMove with FOV #767

Closed
ErliPan opened this issue Dec 3, 2023 · 32 comments
Closed

Yi Dome Guard add support for PTZ RelativeMove with FOV #767

ErliPan opened this issue Dec 3, 2023 · 32 comments

Comments

@ErliPan
Copy link

ErliPan commented Dec 3, 2023

Frigate NVR released a new beta with support of autotracking but currently the Yi Dome Guard doesn't support "RelativeMove with FOV" but only "RelativePanTiltTranslationSpace" Script to verify the camera support. Are there any interest to add the feature?

@roleoroleo
Copy link
Owner

roleoroleo commented Dec 6, 2023

This is not just a "Space" problem.
Actually the relative move command moves the cam with a fixed value:

  • start the movement
  • wait 0.3 seconds
  • stop the movement

So, probably it's a complicated task.

But, if you want to try "manually", edit the file
yi-hack/www/onvif/ptz_service_files/GetConfigurationOptions.xml
and add this part

					<tt:RelativePanTiltTranslationSpace>
						<tt:URI>http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov</tt:URI>
						<tt:XRange>
							<tt:Min>-1.000000</tt:Min>
							<tt:Max>1.000000</tt:Max>
						</tt:XRange>
						<tt:YRange>
							<tt:Min>-1.000000</tt:Min>
							<tt:Max>1.000000</tt:Max>
						</tt:YRange>
					</tt:RelativePanTiltTranslationSpace>

below the </tt:RelativePanTiltTranslationSpace> line.

@ErliPan
Copy link
Author

ErliPan commented Dec 11, 2023

I can't get it to work. I give up for now and I will try again with later betas. Thanks anyway

@ErliPan ErliPan closed this as completed Dec 11, 2023
@roleoroleo
Copy link
Owner

I'm working on this task.
I will send a new beta asap.

@ErliPan ErliPan reopened this Dec 19, 2023
@ErliPan
Copy link
Author

ErliPan commented Dec 19, 2023

Cool, looking forward for it. I reopened the issue because it looks like further development will happen.

@roleoroleo
Copy link
Owner

@ErliPan
What's your model suffix?

@ErliPan
Copy link
Author

ErliPan commented Dec 28, 2023

@roleoroleo Yi Dome Guard RFUS using r35gb. Some on 9.0.46.00 and a few on 12.1.47.2.

@roleoroleo
Copy link
Owner

Here it is:
r35gb_0.3.0.tar.gz

Let me know if it works.

@ErliPan
Copy link
Author

ErliPan commented Dec 29, 2023

@roleoroleo I tried the new firmware but after examining through the logs it looks like that ONVIF MoveStatus is also needed.

Here's the relevant log snippet.

Click here
frigate    | 2023-12-30 00:08:03.424716287  [2023-12-30 00:08:03] frigate.app                    INFO    : Starting Frigate (0.13.0-614a36a)
frigate    | 2023-12-30 00:08:03.440406553  [2023-12-30 00:08:03] peewee_migrate.logs            INFO    : Starting migrations
frigate    | 2023-12-30 00:08:03.444753048  [2023-12-30 00:08:03] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate    | 2023-12-30 00:08:03.673663034  [2023-12-30 00:08:03] frigate.app                    INFO    : Recording process started: 426
frigate    | 2023-12-30 00:08:03.678094074  [2023-12-30 00:08:03] frigate.app                    INFO    : go2rtc process pid: 91
frigate    | 2023-12-30 00:08:03.713483446  [2023-12-30 00:08:03] frigate.app                    INFO    : Output process started: 437
frigate    | 2023-12-30 00:08:03.714039159  [2023-12-30 00:08:03] frigate.ptz.autotrack          DEBUG   : TESTCAM: Autotracker init
frigate    | 2023-12-30 00:08:03.757020124  [2023-12-30 00:08:03] detector.coral                 INFO    : Starting detection process: 436
frigate    | 2023-12-30 00:08:03.757023220  [2023-12-30 00:08:03] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as pci
frigate    | 2023-12-30 00:08:03.760929135  [2023-12-30 00:08:03] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
frigate    | 2023-12-30 00:08:04.124352014  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : Onvif configs for TESTCAM: {
frigate    | 2023-12-30 00:08:04.124354989      'Name': 'PTZCfg',
frigate    | 2023-12-30 00:08:04.124356219      'UseCount': 0,
frigate    | 2023-12-30 00:08:04.124357317      'NodeToken': 'PTZNodeToken',
frigate    | 2023-12-30 00:08:04.124358557      'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.124376271      'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.124378436      'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 00:08:04.124380248      'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 00:08:04.124381652      'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 00:08:04.124397828      'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 00:08:04.124399258      'DefaultPTZSpeed': {
frigate    | 2023-12-30 00:08:04.124400188          'PanTilt': {
frigate    | 2023-12-30 00:08:04.124401061              'x': 1.0,
frigate    | 2023-12-30 00:08:04.124409634              'y': 1.0,
frigate    | 2023-12-30 00:08:04.124410852              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2023-12-30 00:08:04.124411727          },
frigate    | 2023-12-30 00:08:04.124412741          'Zoom': {
frigate    | 2023-12-30 00:08:04.124413692              'x': 0.0,
frigate    | 2023-12-30 00:08:04.124414789              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2023-12-30 00:08:04.124415833          }
frigate    | 2023-12-30 00:08:04.124416763      },
frigate    | 2023-12-30 00:08:04.124417825      'DefaultPTZTimeout': datetime.timedelta(seconds=5),
frigate    | 2023-12-30 00:08:04.124418741      'PanTiltLimits': {
frigate    | 2023-12-30 00:08:04.124419643          'Range': {
frigate    | 2023-12-30 00:08:04.124428522              'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.124429478              'XRange': {
frigate    | 2023-12-30 00:08:04.124430365                  'Min': 0.0,
frigate    | 2023-12-30 00:08:04.124431252                  'Max': 360.0
frigate    | 2023-12-30 00:08:04.124432226              },
frigate    | 2023-12-30 00:08:04.124433118              'YRange': {
frigate    | 2023-12-30 00:08:04.124434052                  'Min': 0.0,
frigate    | 2023-12-30 00:08:04.124434997                  'Max': 180.0
frigate    | 2023-12-30 00:08:04.124435873              }
frigate    | 2023-12-30 00:08:04.124436730          }
frigate    | 2023-12-30 00:08:04.124447064      },
frigate    | 2023-12-30 00:08:04.124448069      'ZoomLimits': {
frigate    | 2023-12-30 00:08:04.124448939          'Range': {
frigate    | 2023-12-30 00:08:04.124450035              'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.124450919              'XRange': {
frigate    | 2023-12-30 00:08:04.124451823                  'Min': 1.0,
frigate    | 2023-12-30 00:08:04.124452877                  'Max': 1.0
frigate    | 2023-12-30 00:08:04.124453740              }
frigate    | 2023-12-30 00:08:04.124454590          }
frigate    | 2023-12-30 00:08:04.124455442      },
frigate    | 2023-12-30 00:08:04.124456323      'Extension': {
frigate    | 2023-12-30 00:08:04.124457203          '_value_1': [
frigate    | 2023-12-30 00:08:04.124458304              <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7f1b1258e440>
frigate    | 2023-12-30 00:08:04.124459198          ],
frigate    | 2023-12-30 00:08:04.124460165          'PTControlDirection': None,
frigate    | 2023-12-30 00:08:04.124461059          'Extension': None
frigate    | 2023-12-30 00:08:04.124461885      },
frigate    | 2023-12-30 00:08:04.124462784      'token': 'PTZCfgToken',
frigate    | 2023-12-30 00:08:04.124463659      '_attr_1': {
frigate    | 2023-12-30 00:08:04.124464557          'MoveRamp': '0',
frigate    | 2023-12-30 00:08:04.124465433          'PresetRamp': '0',
frigate    | 2023-12-30 00:08:04.124466370          'PresetTourRamp': '0'
frigate    | 2023-12-30 00:08:04.124480036      }
frigate    | 2023-12-30 00:08:04.124481019  }
frigate    | 2023-12-30 00:08:04.175737499  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : Onvif config for TESTCAM: {
frigate    | 2023-12-30 00:08:04.175740227      'Spaces': {
frigate    | 2023-12-30 00:08:04.175741471          'AbsolutePanTiltPositionSpace': [
frigate    | 2023-12-30 00:08:04.175742395              {
frigate    | 2023-12-30 00:08:04.175743609                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.175744580                  'XRange': {
frigate    | 2023-12-30 00:08:04.175745564                      'Min': 0.0,
frigate    | 2023-12-30 00:08:04.175746503                      'Max': 360.0
frigate    | 2023-12-30 00:08:04.175747390                  },
frigate    | 2023-12-30 00:08:04.175748277                  'YRange': {
frigate    | 2023-12-30 00:08:04.175749225                      'Min': 0.0,
frigate    | 2023-12-30 00:08:04.175750154                      'Max': 180.0
frigate    | 2023-12-30 00:08:04.175750979                  }
frigate    | 2023-12-30 00:08:04.175751824              }
frigate    | 2023-12-30 00:08:04.175752692          ],
frigate    | 2023-12-30 00:08:04.175753628          'AbsoluteZoomPositionSpace': [
frigate    | 2023-12-30 00:08:04.175754472              {
frigate    | 2023-12-30 00:08:04.175755580                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 00:08:04.175756514                  'XRange': {
frigate    | 2023-12-30 00:08:04.175757447                      'Min': 1.0,
frigate    | 2023-12-30 00:08:04.175758412                      'Max': 1.0
frigate    | 2023-12-30 00:08:04.175759283                  }
frigate    | 2023-12-30 00:08:04.175760143              }
frigate    | 2023-12-30 00:08:04.175760980          ],
frigate    | 2023-12-30 00:08:04.175761984          'RelativePanTiltTranslationSpace': [
frigate    | 2023-12-30 00:08:04.175762829              {
frigate    | 2023-12-30 00:08:04.175763924                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 00:08:04.175764835                  'XRange': {
frigate    | 2023-12-30 00:08:04.175765763                      'Min': -360.0,
frigate    | 2023-12-30 00:08:04.175766682                      'Max': 360.0
frigate    | 2023-12-30 00:08:04.175767579                  },
frigate    | 2023-12-30 00:08:04.175768472                  'YRange': {
frigate    | 2023-12-30 00:08:04.175769409                      'Min': -180.0,
frigate    | 2023-12-30 00:08:04.175770288                      'Max': 180.0
frigate    | 2023-12-30 00:08:04.175771131                  }
frigate    | 2023-12-30 00:08:04.175771963              },
frigate    | 2023-12-30 00:08:04.175772846              {
frigate    | 2023-12-30 00:08:04.175773957                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov',
frigate    | 2023-12-30 00:08:04.175774838                  'XRange': {
frigate    | 2023-12-30 00:08:04.175775754                      'Min': -100.0,
frigate    | 2023-12-30 00:08:04.175776655                      'Max': 100.0
frigate    | 2023-12-30 00:08:04.175777515                  },
frigate    | 2023-12-30 00:08:04.175778417                  'YRange': {
frigate    | 2023-12-30 00:08:04.175779320                      'Min': -100.0,
frigate    | 2023-12-30 00:08:04.175780236                      'Max': 100.0
frigate    | 2023-12-30 00:08:04.175781099                  }
frigate    | 2023-12-30 00:08:04.175781984              }
frigate    | 2023-12-30 00:08:04.175782814          ],
frigate    | 2023-12-30 00:08:04.175783756          'RelativeZoomTranslationSpace': [
frigate    | 2023-12-30 00:08:04.175784587              {
frigate    | 2023-12-30 00:08:04.175785681                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 00:08:04.175786603                  'XRange': {
frigate    | 2023-12-30 00:08:04.175787486                      'Min': 0.0,
frigate    | 2023-12-30 00:08:04.175788423                      'Max': 0.0
frigate    | 2023-12-30 00:08:04.175789295                  }
frigate    | 2023-12-30 00:08:04.175790168              }
frigate    | 2023-12-30 00:08:04.175791017          ],
frigate    | 2023-12-30 00:08:04.175791996          'ContinuousPanTiltVelocitySpace': [
frigate    | 2023-12-30 00:08:04.175792836              {
frigate    | 2023-12-30 00:08:04.175793947                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 00:08:04.175794847                  'XRange': {
frigate    | 2023-12-30 00:08:04.175795775                      'Min': -1.0,
frigate    | 2023-12-30 00:08:04.175796704                      'Max': 1.0
frigate    | 2023-12-30 00:08:04.175797561                  },
frigate    | 2023-12-30 00:08:04.175798456                  'YRange': {
frigate    | 2023-12-30 00:08:04.175799385                      'Min': -1.0,
frigate    | 2023-12-30 00:08:04.175800300                      'Max': 1.0
frigate    | 2023-12-30 00:08:04.175801145                  }
frigate    | 2023-12-30 00:08:04.175801987              }
frigate    | 2023-12-30 00:08:04.175802812          ],
frigate    | 2023-12-30 00:08:04.175804497          'ContinuousZoomVelocitySpace': [
frigate    | 2023-12-30 00:08:04.175805379              {
frigate    | 2023-12-30 00:08:04.175806484                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 00:08:04.175807378                  'XRange': {
frigate    | 2023-12-30 00:08:04.175808299                      'Min': 0.0,
frigate    | 2023-12-30 00:08:04.175809217                      'Max': 0.0
frigate    | 2023-12-30 00:08:04.175810069                  }
frigate    | 2023-12-30 00:08:04.175810920              }
frigate    | 2023-12-30 00:08:04.175811746          ],
frigate    | 2023-12-30 00:08:04.175842155          'PanTiltSpeedSpace': [
frigate    | 2023-12-30 00:08:04.175843202              {
frigate    | 2023-12-30 00:08:04.175844350                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
frigate    | 2023-12-30 00:08:04.175845243                  'XRange': {
frigate    | 2023-12-30 00:08:04.175846132                      'Min': 1.0,
frigate    | 2023-12-30 00:08:04.175847059                      'Max': 1.0
frigate    | 2023-12-30 00:08:04.175847927                  }
frigate    | 2023-12-30 00:08:04.175848787              }
frigate    | 2023-12-30 00:08:04.175849611          ],
frigate    | 2023-12-30 00:08:04.175850544          'ZoomSpeedSpace': [
frigate    | 2023-12-30 00:08:04.175851373              {
frigate    | 2023-12-30 00:08:04.175852675                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
frigate    | 2023-12-30 00:08:04.175853563                  'XRange': {
frigate    | 2023-12-30 00:08:04.175854458                      'Min': 0.0,
frigate    | 2023-12-30 00:08:04.175855392                      'Max': 0.0
frigate    | 2023-12-30 00:08:04.175856247                  }
frigate    | 2023-12-30 00:08:04.175857123              }
frigate    | 2023-12-30 00:08:04.175858014          ],
frigate    | 2023-12-30 00:08:04.175858905          'Extension': None,
frigate    | 2023-12-30 00:08:04.175859800          '_attr_1': None
frigate    | 2023-12-30 00:08:04.175860683      },
frigate    | 2023-12-30 00:08:04.175861600      'PTZTimeout': {
frigate    | 2023-12-30 00:08:04.175862537          'Min': datetime.timedelta(seconds=1),
frigate    | 2023-12-30 00:08:04.175863565          'Max': datetime.timedelta(seconds=100)
frigate    | 2023-12-30 00:08:04.175864421      },
frigate    | 2023-12-30 00:08:04.175865321      '_value_1': [
frigate    | 2023-12-30 00:08:04.175866421          <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7f1b1257ad40>
frigate    | 2023-12-30 00:08:04.175867261      ],
frigate    | 2023-12-30 00:08:04.175868166      'PTControlDirection': None,
frigate    | 2023-12-30 00:08:04.175869048      'Extension': None,
frigate    | 2023-12-30 00:08:04.175869917      '_attr_1': None
frigate    | 2023-12-30 00:08:04.175870740  }
frigate    | 2023-12-30 00:08:04.248692245  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : Onvif status config for TESTCAM: {
frigate    | 2023-12-30 00:08:04.248696464      'Position': {
frigate    | 2023-12-30 00:08:04.248698362          'PanTilt': {
frigate    | 2023-12-30 00:08:04.248700148              'x': 6.7,
frigate    | 2023-12-30 00:08:04.248701779              'y': 69.1,
frigate    | 2023-12-30 00:08:04.248703716              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
frigate    | 2023-12-30 00:08:04.248705150          },
frigate    | 2023-12-30 00:08:04.248706674          'Zoom': {
frigate    | 2023-12-30 00:08:04.248708246              'x': 1.0,
frigate    | 2023-12-30 00:08:04.248710154              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
frigate    | 2023-12-30 00:08:04.248711695          }
frigate    | 2023-12-30 00:08:04.248713130      },
frigate    | 2023-12-30 00:08:04.248714718      'MoveStatus': None,
frigate    | 2023-12-30 00:08:04.248716218      'Error': None,
frigate    | 2023-12-30 00:08:04.248718267      'UtcTime': datetime.datetime(2023, 12, 29, 23, 8, 4, tzinfo=<isodate.tzinfo.Utc object at 0x7f1b201e6820>),
frigate    | 2023-12-30 00:08:04.248719799      '_value_1': None,
frigate    | 2023-12-30 00:08:04.248721284      '_attr_1': None
frigate    | 2023-12-30 00:08:04.248722776  }
frigate    | 2023-12-30 00:08:04.249545188  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request: {
frigate    | 2023-12-30 00:08:04.249549199      'ProfileToken': 'Profile_0',
frigate    | 2023-12-30 00:08:04.249551586      'Translation': None,
frigate    | 2023-12-30 00:08:04.249553750      'Speed': None
frigate    | 2023-12-30 00:08:04.249555645  }
frigate    | 2023-12-30 00:08:04.249558772  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request after setup: {
frigate    | 2023-12-30 00:08:04.249561251      'ProfileToken': 'Profile_0',
frigate    | 2023-12-30 00:08:04.249562904      'Translation': {
frigate    | 2023-12-30 00:08:04.249564421          'PanTilt': {
frigate    | 2023-12-30 00:08:04.249565919              'x': 6.7,
frigate    | 2023-12-30 00:08:04.249567406              'y': 69.1,
frigate    | 2023-12-30 00:08:04.249569330              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov'
frigate    | 2023-12-30 00:08:04.249570878          },
frigate    | 2023-12-30 00:08:04.249572740          'Zoom': {
frigate    | 2023-12-30 00:08:04.249574962              'x': 1.0,
frigate    | 2023-12-30 00:08:04.249577742              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
frigate    | 2023-12-30 00:08:04.249579735          }
frigate    | 2023-12-30 00:08:04.249581863      },
frigate    | 2023-12-30 00:08:04.249584079      'Speed': {
frigate    | 2023-12-30 00:08:04.249586450          'PanTilt': {
frigate    | 2023-12-30 00:08:04.249588747              'x': 1.0,
frigate    | 2023-12-30 00:08:04.249590813              'y': 1.0,
frigate    | 2023-12-30 00:08:04.249593656              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2023-12-30 00:08:04.249595905          },
frigate    | 2023-12-30 00:08:04.249598113          'Zoom': {
frigate    | 2023-12-30 00:08:04.249600380              'x': 0.0,
frigate    | 2023-12-30 00:08:04.249602299              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2023-12-30 00:08:04.249603759          }
frigate    | 2023-12-30 00:08:04.249605232      }
frigate    | 2023-12-30 00:08:04.249606699  }
frigate    | 2023-12-30 00:08:04.437013719  [2023-12-30 00:08:04] frigate.ptz.onvif              DEBUG   : Onvif service capabilities for TESTCAM: {
frigate    | 2023-12-30 00:08:04.437019247      '_value_1': None,
frigate    | 2023-12-30 00:08:04.437021808      'EFlip': False,
frigate    | 2023-12-30 00:08:04.437024334      'Reverse': False,
frigate    | 2023-12-30 00:08:04.437026580      'GetCompatibleConfigurations': False,
frigate    | 2023-12-30 00:08:04.437028606      '_attr_1': {
frigate    | 2023-12-30 00:08:04.437030830          'MoveStatus': 'false',
frigate    | 2023-12-30 00:08:04.437032922          'StatusPosition': 'true'
frigate    | 2023-12-30 00:08:04.437035065      }
frigate    | 2023-12-30 00:08:04.437037042  }
frigate    | 2023-12-30 00:08:04.437925731  [2023-12-30 00:08:04] frigate.ptz.autotrack          WARNING : Disabling autotracking for TESTCAM: ONVIF MoveStatus not supported

@roleoroleo
Copy link
Owner

Another try please:
r35gb_0.3.0.tar.gz

@ErliPan
Copy link
Author

ErliPan commented Dec 30, 2023

Unfortunately it still doesn't work, looks like the camera doesn't respond as the Python code expects.
Looks like it's more involved than satisfying the checks. I have no clue how to fix it...

Here's the log snippet

Click here
frigate    | 2023-12-30 23:51:13.732894812  [2023-12-30 23:51:13] frigate.app                    INFO    : Starting Frigate (0.13.0-614a36a)
frigate    | 2023-12-30 23:51:13.748010503  [2023-12-30 23:51:13] peewee_migrate.logs            INFO    : Starting migrations
frigate    | 2023-12-30 23:51:13.751819343  [2023-12-30 23:51:13] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate    | 2023-12-30 23:51:14.034832749  [2023-12-30 23:51:14] frigate.app                    INFO    : Recording process started: 425
frigate    | 2023-12-30 23:51:14.037084927  [2023-12-30 23:51:14] frigate.app                    INFO    : go2rtc process pid: 98
frigate    | 2023-12-30 23:51:14.055000007  [2023-12-30 23:51:14] frigate.app                    INFO    : Output process started: 436
frigate    | 2023-12-30 23:51:14.055003265  [2023-12-30 23:51:14] frigate.ptz.autotrack          DEBUG   : TESTCAM: Autotracker init
frigate    | 2023-12-30 23:51:14.101060721  [2023-12-30 23:51:14] detector.coral                 INFO    : Starting detection process: 435
frigate    | 2023-12-30 23:51:14.101063647  [2023-12-30 23:51:14] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as pci
frigate    | 2023-12-30 23:51:14.104640041  [2023-12-30 23:51:14] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
frigate    | 2023-12-30 23:51:14.298993239  [2023-12-30 23:51:14] frigate.ptz.onvif              DEBUG   : Onvif configs for TESTCAM: {
frigate    | 2023-12-30 23:51:14.298998143      'Name': 'PTZCfg',
frigate    | 2023-12-30 23:51:14.299000630      'UseCount': 0,
frigate    | 2023-12-30 23:51:14.299002828      'NodeToken': 'PTZNodeToken',
frigate    | 2023-12-30 23:51:14.299008450      'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.299036130      'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.299040294      'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 23:51:14.299043697      'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 23:51:14.299046488      'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 23:51:14.299074416      'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 23:51:14.299077252      'DefaultPTZSpeed': {
frigate    | 2023-12-30 23:51:14.299079180          'PanTilt': {
frigate    | 2023-12-30 23:51:14.299081017              'x': 1.0,
frigate    | 2023-12-30 23:51:14.299097410              'y': 1.0,
frigate    | 2023-12-30 23:51:14.299099991              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2023-12-30 23:51:14.299101748          },
frigate    | 2023-12-30 23:51:14.299103778          'Zoom': {
frigate    | 2023-12-30 23:51:14.299105600              'x': 0.0,
frigate    | 2023-12-30 23:51:14.299107838              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2023-12-30 23:51:14.299109988          }
frigate    | 2023-12-30 23:51:14.299111889      },
frigate    | 2023-12-30 23:51:14.299114028      'DefaultPTZTimeout': datetime.timedelta(seconds=5),
frigate    | 2023-12-30 23:51:14.299115905      'PanTiltLimits': {
frigate    | 2023-12-30 23:51:14.299117733          'Range': {
frigate    | 2023-12-30 23:51:14.299134305              'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.299136264              'XRange': {
frigate    | 2023-12-30 23:51:14.299138133                  'Min': 0.0,
frigate    | 2023-12-30 23:51:14.299139998                  'Max': 360.0
frigate    | 2023-12-30 23:51:14.299141986              },
frigate    | 2023-12-30 23:51:14.299143829              'YRange': {
frigate    | 2023-12-30 23:51:14.299145760                  'Min': 0.0,
frigate    | 2023-12-30 23:51:14.299147716                  'Max': 180.0
frigate    | 2023-12-30 23:51:14.299149502              }
frigate    | 2023-12-30 23:51:14.299151231          }
frigate    | 2023-12-30 23:51:14.299173240      },
frigate    | 2023-12-30 23:51:14.299175262      'ZoomLimits': {
frigate    | 2023-12-30 23:51:14.299177041          'Range': {
frigate    | 2023-12-30 23:51:14.299179257              'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.299181069              'XRange': {
frigate    | 2023-12-30 23:51:14.299182926                  'Min': 1.0,
frigate    | 2023-12-30 23:51:14.299184980                  'Max': 1.0
frigate    | 2023-12-30 23:51:14.299186808              }
frigate    | 2023-12-30 23:51:14.299188543          }
frigate    | 2023-12-30 23:51:14.299190316      },
frigate    | 2023-12-30 23:51:14.299192144      'Extension': {
frigate    | 2023-12-30 23:51:14.299193981          '_value_1': [
frigate    | 2023-12-30 23:51:14.299196238              <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7fd830453c00>
frigate    | 2023-12-30 23:51:14.299198064          ],
frigate    | 2023-12-30 23:51:14.299200023          'PTControlDirection': None,
frigate    | 2023-12-30 23:51:14.299201832          'Extension': None
frigate    | 2023-12-30 23:51:14.299203514      },
frigate    | 2023-12-30 23:51:14.299205406      'token': 'PTZCfgToken',
frigate    | 2023-12-30 23:51:14.299207220      '_attr_1': {
frigate    | 2023-12-30 23:51:14.299209041          'MoveRamp': '0',
frigate    | 2023-12-30 23:51:14.299210849          'PresetRamp': '0',
frigate    | 2023-12-30 23:51:14.299212752          'PresetTourRamp': '0'
frigate    | 2023-12-30 23:51:14.299237293      }
frigate    | 2023-12-30 23:51:14.299239308  }
frigate    | 2023-12-30 23:51:14.348679923  [2023-12-30 23:51:14] frigate.ptz.onvif              DEBUG   : Onvif config for TESTCAM: {
frigate    | 2023-12-30 23:51:14.348685018      'Spaces': {
frigate    | 2023-12-30 23:51:14.348687486          'AbsolutePanTiltPositionSpace': [
frigate    | 2023-12-30 23:51:14.348689627              {
frigate    | 2023-12-30 23:51:14.348692201                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.348694280                  'XRange': {
frigate    | 2023-12-30 23:51:14.348696419                      'Min': 0.0,
frigate    | 2023-12-30 23:51:14.348698389                      'Max': 360.0
frigate    | 2023-12-30 23:51:14.348700227                  },
frigate    | 2023-12-30 23:51:14.348702047                  'YRange': {
frigate    | 2023-12-30 23:51:14.348704003                      'Min': 0.0,
frigate    | 2023-12-30 23:51:14.348705951                      'Max': 180.0
frigate    | 2023-12-30 23:51:14.348707738                  }
frigate    | 2023-12-30 23:51:14.348709490              }
frigate    | 2023-12-30 23:51:14.348711313          ],
frigate    | 2023-12-30 23:51:14.348713274          'AbsoluteZoomPositionSpace': [
frigate    | 2023-12-30 23:51:14.348715042              {
frigate    | 2023-12-30 23:51:14.348717297                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2023-12-30 23:51:14.348719193                  'XRange': {
frigate    | 2023-12-30 23:51:14.348721099                      'Min': 1.0,
frigate    | 2023-12-30 23:51:14.348723039                      'Max': 1.0
frigate    | 2023-12-30 23:51:14.348724873                  }
frigate    | 2023-12-30 23:51:14.348726629              }
frigate    | 2023-12-30 23:51:14.348728350          ],
frigate    | 2023-12-30 23:51:14.348730427          'RelativePanTiltTranslationSpace': [
frigate    | 2023-12-30 23:51:14.348732190              {
frigate    | 2023-12-30 23:51:14.348734486                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 23:51:14.348736312                  'XRange': {
frigate    | 2023-12-30 23:51:14.348738204                      'Min': -360.0,
frigate    | 2023-12-30 23:51:14.348740037                      'Max': 360.0
frigate    | 2023-12-30 23:51:14.348741853                  },
frigate    | 2023-12-30 23:51:14.348743722                  'YRange': {
frigate    | 2023-12-30 23:51:14.348745645                      'Min': -180.0,
frigate    | 2023-12-30 23:51:14.348747457                      'Max': 180.0
frigate    | 2023-12-30 23:51:14.348749218                  }
frigate    | 2023-12-30 23:51:14.348750953              },
frigate    | 2023-12-30 23:51:14.348752778              {
frigate    | 2023-12-30 23:51:14.348755040                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov',
frigate    | 2023-12-30 23:51:14.348756907                  'XRange': {
frigate    | 2023-12-30 23:51:14.348758815                      'Min': -100.0,
frigate    | 2023-12-30 23:51:14.348760670                      'Max': 100.0
frigate    | 2023-12-30 23:51:14.348762478                  },
frigate    | 2023-12-30 23:51:14.348764322                  'YRange': {
frigate    | 2023-12-30 23:51:14.348766164                      'Min': -100.0,
frigate    | 2023-12-30 23:51:14.348768026                      'Max': 100.0
frigate    | 2023-12-30 23:51:14.348769795                  }
frigate    | 2023-12-30 23:51:14.348771612              }
frigate    | 2023-12-30 23:51:14.348773346          ],
frigate    | 2023-12-30 23:51:14.348775274          'RelativeZoomTranslationSpace': [
frigate    | 2023-12-30 23:51:14.348776994              {
frigate    | 2023-12-30 23:51:14.348779186                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2023-12-30 23:51:14.348781048                  'XRange': {
frigate    | 2023-12-30 23:51:14.348782904                      'Min': 0.0,
frigate    | 2023-12-30 23:51:14.348784779                      'Max': 0.0
frigate    | 2023-12-30 23:51:14.348786590                  }
frigate    | 2023-12-30 23:51:14.348788380              }
frigate    | 2023-12-30 23:51:14.348790112          ],
frigate    | 2023-12-30 23:51:14.348792092          'ContinuousPanTiltVelocitySpace': [
frigate    | 2023-12-30 23:51:14.348793829              {
frigate    | 2023-12-30 23:51:14.348796065                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 23:51:14.348797943                  'XRange': {
frigate    | 2023-12-30 23:51:14.348799819                      'Min': -1.0,
frigate    | 2023-12-30 23:51:14.348801691                      'Max': 1.0
frigate    | 2023-12-30 23:51:14.348803493                  },
frigate    | 2023-12-30 23:51:14.348805305                  'YRange': {
frigate    | 2023-12-30 23:51:14.348807191                      'Min': -1.0,
frigate    | 2023-12-30 23:51:14.348809093                      'Max': 1.0
frigate    | 2023-12-30 23:51:14.348810834                  }
frigate    | 2023-12-30 23:51:14.348812593              }
frigate    | 2023-12-30 23:51:14.348814278          ],
frigate    | 2023-12-30 23:51:14.348817277          'ContinuousZoomVelocitySpace': [
frigate    | 2023-12-30 23:51:14.348819070              {
frigate    | 2023-12-30 23:51:14.348821304                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2023-12-30 23:51:14.348823164                  'XRange': {
frigate    | 2023-12-30 23:51:14.348825065                      'Min': 0.0,
frigate    | 2023-12-30 23:51:14.348826972                      'Max': 0.0
frigate    | 2023-12-30 23:51:14.348828751                  }
frigate    | 2023-12-30 23:51:14.348830493              }
frigate    | 2023-12-30 23:51:14.348832194          ],
frigate    | 2023-12-30 23:51:14.348883208          'PanTiltSpeedSpace': [
frigate    | 2023-12-30 23:51:14.348885306              {
frigate    | 2023-12-30 23:51:14.348887686                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
frigate    | 2023-12-30 23:51:14.348889557                  'XRange': {
frigate    | 2023-12-30 23:51:14.348891401                      'Min': 1.0,
frigate    | 2023-12-30 23:51:14.348893283                      'Max': 1.0
frigate    | 2023-12-30 23:51:14.348895108                  }
frigate    | 2023-12-30 23:51:14.348896866              }
frigate    | 2023-12-30 23:51:14.348898560          ],
frigate    | 2023-12-30 23:51:14.348900484          'ZoomSpeedSpace': [
frigate    | 2023-12-30 23:51:14.348902214              {
frigate    | 2023-12-30 23:51:14.348904945                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
frigate    | 2023-12-30 23:51:14.348906804                  'XRange': {
frigate    | 2023-12-30 23:51:14.348908662                      'Min': 0.0,
frigate    | 2023-12-30 23:51:14.348910572                      'Max': 0.0
frigate    | 2023-12-30 23:51:14.348912304                  }
frigate    | 2023-12-30 23:51:14.348914080              }
frigate    | 2023-12-30 23:51:14.348915901          ],
frigate    | 2023-12-30 23:51:14.348917700          'Extension': None,
frigate    | 2023-12-30 23:51:14.348919499          '_attr_1': None
frigate    | 2023-12-30 23:51:14.348921276      },
frigate    | 2023-12-30 23:51:14.348923131      'PTZTimeout': {
frigate    | 2023-12-30 23:51:14.348925042          'Min': datetime.timedelta(seconds=1),
frigate    | 2023-12-30 23:51:14.348927159          'Max': datetime.timedelta(seconds=100)
frigate    | 2023-12-30 23:51:14.348928917      },
frigate    | 2023-12-30 23:51:14.348930804      '_value_1': [
frigate    | 2023-12-30 23:51:14.348933082          <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7fd830428300>
frigate    | 2023-12-30 23:51:14.348934810      ],
frigate    | 2023-12-30 23:51:14.348936681      'PTControlDirection': None,
frigate    | 2023-12-30 23:51:14.348938481      'Extension': None,
frigate    | 2023-12-30 23:51:14.348940252      '_attr_1': None
frigate    | 2023-12-30 23:51:14.348941940  }
frigate    | 2023-12-30 23:51:14.419573854  Traceback (most recent call last):
frigate    | 2023-12-30 23:51:14.420888811  [2023-12-30 23:51:14] frigate.ptz.onvif              WARNING : Unable to get status from camera: TESTCAM: Unknown error: No status
frigate    | 2023-12-30 23:51:14.421836520  [2023-12-30 23:51:14] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request: {
frigate    | 2023-12-30 23:51:14.421846807      'ProfileToken': 'Profile_0',
frigate    | 2023-12-30 23:51:14.421853556      'Translation': None,
frigate    | 2023-12-30 23:51:14.421860263      'Speed': None
frigate    | 2023-12-30 23:51:14.421866044  }
frigate    | 2023-12-30 23:51:14.421873437    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
frigate    | 2023-12-30 23:51:14.422943939      return _run_code(code, main_globals, None,
frigate    | 2023-12-30 23:51:14.422952435    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
frigate    | 2023-12-30 23:51:14.422957589      exec(code, run_globals)
frigate    | 2023-12-30 23:51:14.422962875    File "/opt/frigate/frigate/__main__.py", line 17, in <module>
frigate    | 2023-12-30 23:51:14.422997899      frigate_app.start()
frigate    | 2023-12-30 23:51:14.423004780    File "/opt/frigate/frigate/app.py", line 684, in start
frigate    | 2023-12-30 23:51:14.424073369      self.start_ptz_autotracker()
frigate    | 2023-12-30 23:51:14.424123327    File "/opt/frigate/frigate/app.py", line 460, in start_ptz_autotracker
frigate    | 2023-12-30 23:51:14.424131167      self.ptz_autotracker_thread = PtzAutoTrackerThread(
frigate    | 2023-12-30 23:51:14.424138160    File "/opt/frigate/frigate/ptz/autotrack.py", line 153, in __init__
frigate    | 2023-12-30 23:51:14.424143100      self.ptz_autotracker = PtzAutoTracker(
frigate    | 2023-12-30 23:51:14.424148572    File "/opt/frigate/frigate/ptz/autotrack.py", line 215, in __init__
frigate    | 2023-12-30 23:51:14.425249455      self._autotracker_setup(camera_config, camera)
frigate    | 2023-12-30 23:51:14.425258446    File "/opt/frigate/frigate/ptz/autotrack.py", line 242, in _autotracker_setup
frigate    | 2023-12-30 23:51:14.425263413      if not self.onvif._init_onvif(camera):
frigate    | 2023-12-30 23:51:14.425268504    File "/opt/frigate/frigate/ptz/onvif.py", line 138, in _init_onvif
frigate    | 2023-12-30 23:51:14.425306152      move_request.Translation = status.Position
frigate    | 2023-12-30 23:51:14.425313419  AttributeError: 'NoneType' object has no attribute 'Position'

and here's the Python scripts that throws the exceptions.

Btw happy new year.

@roleoroleo
Copy link
Owner

I will try the script.
It seems that GetStatus fails.

Thanks and Happy New Year to you too.

@roleoroleo
Copy link
Owner

roleoroleo commented Dec 31, 2023

I tried to install Frigate as a docker container but it doesn't start properly.
I need to restart from scratch.
Are you able to capture the network traffic between frigate and the cam?
You could use tcp dump from here:
https://github.com/roleoroleo/yi-hack-utils/tree/main/Allwinner-v2

@ErliPan
Copy link
Author

ErliPan commented Dec 31, 2023

Mine doesn't load the web ui too after enabling autotracking. I don't know if you have the same issue but I will leave both docker compose and the config.yml here:

Here's the docker-compose

I'm using the PCIE Coral TPU and Intel QSV hardware accelleration
Not much interesting here.


version: "3.9"
services:
  frigate:
    container_name: frigate
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:0.13.0-beta6
    shm_size: "256mb" # update for your cameras based on calculation above
    devices:
      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /container/frigate/config:/config
      - /container/frigate/efficient.tflite:/efficient.tflite
      - /container/frigate/storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp

And here's the config.yml
mqtt:
  host: mqtt.<mydomain>
  topic_prefix: frigate
  user: MQTT
  password: <mypw>

detectors:
  coral:
    type: edgetpu
    device: pci

cameras:

  TESTCAM:
    ffmpeg:
      inputs:
      - path: rtsp://192.168.1.58/ch0_0.h264
        roles:
        - record
        - detect
      hwaccel_args: preset-intel-qsv-h264
    detect:
      width: 1280
      height: 720
      enabled: true
    record:
      enabled: false
    snapshots:
      enabled: false
    
    zones:
      zone_0:
        coordinates: 
          866,613,1033,495,1065,343,1047,258,967,146,781,119,688,114,416,119,220,263,238,567,480,630,746,640

    onvif:
      # Required: host of the camera being connected to.
      host: 192.168.1.58
      # Optional: ONVIF port for device (default: shown below).
      port: 80
      # Optional: username for login.
      # NOTE: Some devices require admin to access ONVIF.
      user: admin
      # Optional: password for login.
      password: admin
      # Optional: PTZ camera object autotracking. Keeps a moving object in
      # the center of the frame by automatically moving the PTZ camera.
      autotracking:
        # Optional: enable/disable object autotracking. (default: shown below)
        enabled: true
        zooming: disabled
        # Required: Begin automatically tracking an object when it enters any of the listed zones.
        required_zones:
        - zone_0
        # Required: Name of ONVIF preset in camera's firmware to return to when tracking is over. (default: shown below)
        return_preset: home

objects:
  track:
  - person
  - car
  - bird


logger:
  default: info
  logs:
    frigate.ptz.autotrack: debug
    frigate.ptz.onvif: debug

I got the error log by adding the logger parameters at the end of config.yml and starting the container without the detach parameter.

EDIT: I'm currently a bit busy, I need to finish deploying and configure HA + Frigate + Notifications in 2 places and I will soon look into capturing needed network traffic.

@roleoroleo
Copy link
Owner

I tested the last release with the fov script and it works.
I didn't install Frigate, just the python script.

root@debian:/home/user/fovtest# python3 ./fovtest.py
Connected to ONVIF camera
Created media service object
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
    'Name': 'PTZCfg',
    'UseCount': 0,
    'NodeToken': 'PTZNodeToken',
    'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
    'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
    'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
    'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
    'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
    'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
    'DefaultPTZSpeed': {
        'PanTilt': {
            'x': 1.0,
            'y': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
        },
        'Zoom': {
            'x': 0.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
        }
    },
    'DefaultPTZTimeout': datetime.timedelta(seconds=5),
    'PanTiltLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
            'XRange': {
                'Min': 0.0,
                'Max': 360.0
            },
            'YRange': {
                'Min': 0.0,
                'Max': 180.0
            }
        }
    },
    'ZoomLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
            'XRange': {
                'Min': 1.0,
                'Max': 1.0
            }
        }
    },
    'Extension': {
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7f5a3518ea00>
        ],
        'PTControlDirection': None,
        'Extension': None
    },
    'token': 'PTZCfgToken',
    'MoveRamp': 0,
    'PresetRamp': 0,
    'PresetTourRamp': 0,
    '_attr_1': {
}
}

PTZ configuration options:
{
    'Spaces': {
        'AbsolutePanTiltPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 360.0
                },
                'YRange': {
                    'Min': 0.0,
                    'Max': 180.0
                }
            }
        ],
        'AbsoluteZoomPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 1.0,
                    'Max': 1.0
                }
            }
        ],
        'RelativePanTiltTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -360.0,
                    'Max': 360.0
                },
                'YRange': {
                    'Min': -180.0,
                    'Max': 180.0
                }
            },
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov',
                'XRange': {
                    'Min': -100.0,
                    'Max': 100.0
                },
                'YRange': {
                    'Min': -100.0,
                    'Max': 100.0
                }
            }
        ],
        'RelativeZoomTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'ContinuousPanTiltVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'ContinuousZoomVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'PanTiltSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': 1.0,
                    'Max': 1.0
                }
            }
        ],
        'ZoomSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'Extension': None,
        '_attr_1': None
    },
    'PTZTimeout': {
        'Min': datetime.timedelta(seconds=1),
        'Max': datetime.timedelta(seconds=100)
    },
    '_value_1': [
        <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7f5a352fe840>
    ],
    'PTControlDirection': None,
    'Extension': None,
    'PTZRamps': None,
    '_attr_1': None
}

PTZ service capabilities:
{
    '_value_1': None,
    'EFlip': False,
    'Reverse': False,
    'GetCompatibleConfigurations': False,
    'MoveStatus': True,
    'StatusPosition': True,
    'MoveAndTrack': None,
    '_attr_1': {
}
}

PTZ status:
{
    'Position': {
        'PanTilt': {
            'x': 171.9,
            'y': 63.2,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace'
        },
        'Zoom': {
            'x': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace'
        }
    },
    'MoveStatus': {
        'PanTilt': 'IDLE',
        'Zoom': 'IDLE'
    },
    'Error': None,
    'UtcTime': datetime.datetime(2024, 2, 14, 8, 9, 14, tzinfo=<isodate.tzinfo.Utc object at 0x7f5a35cb2f70>),
    '_value_1': None,
    '_attr_1': None
}
YES - MoveStatus is reporting IDLE.
YES - RelativeMove Pan/Tilt (FOV) is supported.
YES - RelativeMove Zoom is supported.

@ErliPan
Copy link
Author

ErliPan commented Feb 14, 2024

@roleoroleo thanks for the heads up. I'm still unable to test it for now because I'm in another continent but by early march I should be home. I will try to report back the results asap.

@ErliPan
Copy link
Author

ErliPan commented Mar 8, 2024

I'm back finalmente, so I took a fresh install of YiHack 0.3.1 and the latest Frigate version. Unfortunately it still crashes on boot.

Here's the logs

Expand
frigate    | 2024-03-08 23:39:12.588517818  [2024-03-08 23:39:12] frigate.app                    INFO    : Starting Frigate (0.13.2-6476f8a)
frigate    | 2024-03-08 23:39:12.613145480  [2024-03-08 23:39:12] peewee_migrate.logs            INFO    : Starting migrations
frigate    | 2024-03-08 23:39:12.618207383  [2024-03-08 23:39:12] peewee_migrate.logs            INFO    : There is nothing to migrate
frigate    | 2024-03-08 23:39:12.967481741  [2024-03-08 23:39:12] frigate.app                    INFO    : Recording process started: 419
frigate    | 2024-03-08 23:39:12.984409595  [2024-03-08 23:39:12] frigate.app                    INFO    : go2rtc process pid: 94
frigate    | 2024-03-08 23:39:13.020824497  [2024-03-08 23:39:13] frigate.app                    INFO    : Output process started: 430
frigate    | 2024-03-08 23:39:13.020828689  [2024-03-08 23:39:13] frigate.ptz.autotrack          DEBUG   : TESTCAM: Autotracker init
frigate    | 2024-03-08 23:39:13.080448688  [2024-03-08 23:39:13] detector.coral                 INFO    : Starting detection process: 429
frigate    | 2024-03-08 23:39:13.081107251  [2024-03-08 23:39:13] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as pci
frigate    | 2024-03-08 23:39:13.085962986  [2024-03-08 23:39:13] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
frigate    | 2024-03-08 23:39:13.226151493  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : Onvif media xaddr for TESTCAM: http://192.168.1.58/onvif/media_service
frigate    | 2024-03-08 23:39:13.227330611  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : Onvif capabilities for TESTCAM: ('http://192.168.1.58/onvif/ptz_service', '/usr/local/lib/python3.9/site-packages/wsdl/ptz.wsdl', '{http://www.onvif.org/ver20/ptz/wsdl}PTZBinding')
frigate    | 2024-03-08 23:39:13.315297538  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : Selected Onvif profile for TESTCAM: {
frigate    | 2024-03-08 23:39:13.315308403      'Name': 'Profile_0',
frigate    | 2024-03-08 23:39:13.315314149      'VideoSourceConfiguration': {
frigate    | 2024-03-08 23:39:13.315319496          'Name': 'Profile_0_VideoSourceConfig',
frigate    | 2024-03-08 23:39:13.315330916          'UseCount': 1,
frigate    | 2024-03-08 23:39:13.315336340          'SourceToken': 'VideoSourceToken',
frigate    | 2024-03-08 23:39:13.315343342          'Bounds': {
frigate    | 2024-03-08 23:39:13.315347769              'x': 0,
frigate    | 2024-03-08 23:39:13.315352308              'y': 0,
frigate    | 2024-03-08 23:39:13.315356751              'width': 1920,
frigate    | 2024-03-08 23:39:13.315402824              'height': 1080
frigate    | 2024-03-08 23:39:13.315407357          },
frigate    | 2024-03-08 23:39:13.315412062          '_value_1': None,
frigate    | 2024-03-08 23:39:13.315416602          'Extension': None,
frigate    | 2024-03-08 23:39:13.315422356          'token': 'Profile_0_VideoSourceConfigToken',
frigate    | 2024-03-08 23:39:13.315426711          '_attr_1': {
frigate    | 2024-03-08 23:39:13.315487415      }
frigate    | 2024-03-08 23:39:13.315492251      },
frigate    | 2024-03-08 23:39:13.315496870      'AudioSourceConfiguration': None,
frigate    | 2024-03-08 23:39:13.315503092      'VideoEncoderConfiguration': {
frigate    | 2024-03-08 23:39:13.315507726          'Name': 'Profile_0_VideoEncoder',
frigate    | 2024-03-08 23:39:13.315512163          'UseCount': 1,
frigate    | 2024-03-08 23:39:13.315550101          'Encoding': 'H264',
frigate    | 2024-03-08 23:39:13.315554782          'Resolution': {
frigate    | 2024-03-08 23:39:13.315559055              'Width': 1920,
frigate    | 2024-03-08 23:39:13.315585415              'Height': 1080
frigate    | 2024-03-08 23:39:13.315590397          },
frigate    | 2024-03-08 23:39:13.315594736          'Quality': 0.0,
frigate    | 2024-03-08 23:39:13.315599143          'RateControl': {
frigate    | 2024-03-08 23:39:13.315603471              'FrameRateLimit': 0,
frigate    | 2024-03-08 23:39:13.315649986              'EncodingInterval': 0,
frigate    | 2024-03-08 23:39:13.315654792              'BitrateLimit': 0
frigate    | 2024-03-08 23:39:13.315658721          },
frigate    | 2024-03-08 23:39:13.315662902          'MPEG4': None,
frigate    | 2024-03-08 23:39:13.315666981          'H264': {
frigate    | 2024-03-08 23:39:13.315671777              'GovLength': 40,
frigate    | 2024-03-08 23:39:13.315676157              'H264Profile': 'High'
frigate    | 2024-03-08 23:39:13.315680179          },
frigate    | 2024-03-08 23:39:13.315684402          'Multicast': {
frigate    | 2024-03-08 23:39:13.315688726              'Address': {
frigate    | 2024-03-08 23:39:13.315694812                  'Type': 'IPv4',
frigate    | 2024-03-08 23:39:13.315699341                  'IPv4Address': None,
frigate    | 2024-03-08 23:39:13.315703804                  'IPv6Address': None
frigate    | 2024-03-08 23:39:13.315707963              },
frigate    | 2024-03-08 23:39:13.315712179              'Port': 0,
frigate    | 2024-03-08 23:39:13.315716187              'TTL': 0,
frigate    | 2024-03-08 23:39:13.315766817              'AutoStart': False,
frigate    | 2024-03-08 23:39:13.315771496              '_value_1': None,
frigate    | 2024-03-08 23:39:13.315775721              '_attr_1': None
frigate    | 2024-03-08 23:39:13.315779661          },
frigate    | 2024-03-08 23:39:13.315784162          'SessionTimeout': datetime.timedelta(0),
frigate    | 2024-03-08 23:39:13.315788341          '_value_1': None,
frigate    | 2024-03-08 23:39:13.315793647          'token': 'Profile_0_VideoEncoderToken',
frigate    | 2024-03-08 23:39:13.315797860          '_attr_1': {
frigate    | 2024-03-08 23:39:13.315801841      }
frigate    | 2024-03-08 23:39:13.315806012      },
frigate    | 2024-03-08 23:39:13.315810549      'AudioEncoderConfiguration': None,
frigate    | 2024-03-08 23:39:13.315814954      'VideoAnalyticsConfiguration': None,
frigate    | 2024-03-08 23:39:13.315819211      'PTZConfiguration': {
frigate    | 2024-03-08 23:39:13.315823748          'Name': 'PTZCfg',
frigate    | 2024-03-08 23:39:13.315827942          'UseCount': 0,
frigate    | 2024-03-08 23:39:13.315832286          'NodeToken': 'PTZNodeToken',
frigate    | 2024-03-08 23:39:13.315837823          'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.315843687          'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.315907137          'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.315913210          'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.315918840          'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.315924402          'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.315929281          'DefaultPTZSpeed': {
frigate    | 2024-03-08 23:39:13.315933632              'PanTilt': {
frigate    | 2024-03-08 23:39:13.315937854                  'x': 1.0,
frigate    | 2024-03-08 23:39:13.315942124                  'y': 1.0,
frigate    | 2024-03-08 23:39:13.315947286                  'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2024-03-08 23:39:13.315951220              },
frigate    | 2024-03-08 23:39:13.315955504              'Zoom': {
frigate    | 2024-03-08 23:39:13.315959632                  'x': 0.0,
frigate    | 2024-03-08 23:39:13.315964817                  'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2024-03-08 23:39:13.316031511              }
frigate    | 2024-03-08 23:39:13.316035896          },
frigate    | 2024-03-08 23:39:13.316040749          'DefaultPTZTimeout': datetime.timedelta(seconds=5),
frigate    | 2024-03-08 23:39:13.316045031          'PanTiltLimits': {
frigate    | 2024-03-08 23:39:13.316049234              'Range': {
frigate    | 2024-03-08 23:39:13.316054423                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316058776                  'XRange': {
frigate    | 2024-03-08 23:39:13.316063060                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.316067271                      'Max': 360.0
frigate    | 2024-03-08 23:39:13.316071303                  },
frigate    | 2024-03-08 23:39:13.316075442                  'YRange': {
frigate    | 2024-03-08 23:39:13.316080337                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.316084725                      'Max': 180.0
frigate    | 2024-03-08 23:39:13.316088878                  }
frigate    | 2024-03-08 23:39:13.316092874              }
frigate    | 2024-03-08 23:39:13.316096692          },
frigate    | 2024-03-08 23:39:13.316100878          'ZoomLimits': {
frigate    | 2024-03-08 23:39:13.316105163              'Range': {
frigate    | 2024-03-08 23:39:13.316110215                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316114441                  'XRange': {
frigate    | 2024-03-08 23:39:13.316118715                      'Min': 1.0,
frigate    | 2024-03-08 23:39:13.316122923                      'Max': 1.0
frigate    | 2024-03-08 23:39:13.316126886                  }
frigate    | 2024-03-08 23:39:13.316130949              }
frigate    | 2024-03-08 23:39:13.316135179          },
frigate    | 2024-03-08 23:39:13.316139155          'Extension': {
frigate    | 2024-03-08 23:39:13.316143364              '_value_1': [
frigate    | 2024-03-08 23:39:13.316148479                  <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7849ee4dbd40>
frigate    | 2024-03-08 23:39:13.316152405              ],
frigate    | 2024-03-08 23:39:13.316156665              'PTControlDirection': None,
frigate    | 2024-03-08 23:39:13.316160845              'Extension': None
frigate    | 2024-03-08 23:39:13.316164854          },
frigate    | 2024-03-08 23:39:13.316169203          'token': 'PTZCfgToken',
frigate    | 2024-03-08 23:39:13.316173316          '_attr_1': {
frigate    | 2024-03-08 23:39:13.316177511              'MoveRamp': '0',
frigate    | 2024-03-08 23:39:13.316181854              'PresetRamp': '0',
frigate    | 2024-03-08 23:39:13.316186094              'PresetTourRamp': '0'
frigate    | 2024-03-08 23:39:13.316190053          }
frigate    | 2024-03-08 23:39:13.316261266      },
frigate    | 2024-03-08 23:39:13.316266233      'MetadataConfiguration': None,
frigate    | 2024-03-08 23:39:13.316270462      'Extension': None,
frigate    | 2024-03-08 23:39:13.316274565      'token': 'Profile_0',
frigate    | 2024-03-08 23:39:13.316278604      'fixed': True,
frigate    | 2024-03-08 23:39:13.316282583      '_attr_1': {
frigate    | 2024-03-08 23:39:13.316286525  }
frigate    | 2024-03-08 23:39:13.316290436  }
frigate    | 2024-03-08 23:39:13.316295820  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : Onvif ptz config for media profile in TESTCAM: {
frigate    | 2024-03-08 23:39:13.316300048      'Name': 'PTZCfg',
frigate    | 2024-03-08 23:39:13.316304178      'UseCount': 0,
frigate    | 2024-03-08 23:39:13.316308445      'NodeToken': 'PTZNodeToken',
frigate    | 2024-03-08 23:39:13.316313744      'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316319136      'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316381339      'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.316387309      'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.316393011      'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.316398453      'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.316402709      'DefaultPTZSpeed': {
frigate    | 2024-03-08 23:39:13.316406922          'PanTilt': {
frigate    | 2024-03-08 23:39:13.316411040              'x': 1.0,
frigate    | 2024-03-08 23:39:13.316415184              'y': 1.0,
frigate    | 2024-03-08 23:39:13.316420208              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2024-03-08 23:39:13.316424029          },
frigate    | 2024-03-08 23:39:13.316428073          'Zoom': {
frigate    | 2024-03-08 23:39:13.316432190              'x': 0.0,
frigate    | 2024-03-08 23:39:13.316437211              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2024-03-08 23:39:13.316453659          }
frigate    | 2024-03-08 23:39:13.316457711      },
frigate    | 2024-03-08 23:39:13.316462390      'DefaultPTZTimeout': datetime.timedelta(seconds=5),
frigate    | 2024-03-08 23:39:13.316466598      'PanTiltLimits': {
frigate    | 2024-03-08 23:39:13.316470649          'Range': {
frigate    | 2024-03-08 23:39:13.316475696              'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316479833              'XRange': {
frigate    | 2024-03-08 23:39:13.316483964                  'Min': 0.0,
frigate    | 2024-03-08 23:39:13.316488248                  'Max': 360.0
frigate    | 2024-03-08 23:39:13.316492242              },
frigate    | 2024-03-08 23:39:13.316496280              'YRange': {
frigate    | 2024-03-08 23:39:13.316500702                  'Min': 0.0,
frigate    | 2024-03-08 23:39:13.316505077                  'Max': 180.0
frigate    | 2024-03-08 23:39:13.316509094              }
frigate    | 2024-03-08 23:39:13.316512964          }
frigate    | 2024-03-08 23:39:13.316517019      },
frigate    | 2024-03-08 23:39:13.316521353      'ZoomLimits': {
frigate    | 2024-03-08 23:39:13.316525473          'Range': {
frigate    | 2024-03-08 23:39:13.316530478              'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.316534618              'XRange': {
frigate    | 2024-03-08 23:39:13.316538821                  'Min': 1.0,
frigate    | 2024-03-08 23:39:13.316608463                  'Max': 1.0
frigate    | 2024-03-08 23:39:13.316612779              }
frigate    | 2024-03-08 23:39:13.316616957          }
frigate    | 2024-03-08 23:39:13.316620852      },
frigate    | 2024-03-08 23:39:13.316625149      'Extension': {
frigate    | 2024-03-08 23:39:13.316629228          '_value_1': [
frigate    | 2024-03-08 23:39:13.316634448              <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7849ee4dbd40>
frigate    | 2024-03-08 23:39:13.316638509          ],
frigate    | 2024-03-08 23:39:13.316642977          'PTControlDirection': None,
frigate    | 2024-03-08 23:39:13.316647149          'Extension': None
frigate    | 2024-03-08 23:39:13.316650948      },
frigate    | 2024-03-08 23:39:13.316655118      'token': 'PTZCfgToken',
frigate    | 2024-03-08 23:39:13.316659029      '_attr_1': {
frigate    | 2024-03-08 23:39:13.316663144          'MoveRamp': '0',
frigate    | 2024-03-08 23:39:13.316667274          'PresetRamp': '0',
frigate    | 2024-03-08 23:39:13.316671493          'PresetTourRamp': '0'
frigate    | 2024-03-08 23:39:13.316675529      }
frigate    | 2024-03-08 23:39:13.316679482  }
frigate    | 2024-03-08 23:39:13.457746876  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : Onvif config for TESTCAM: {
frigate    | 2024-03-08 23:39:13.457751121      'Spaces': {
frigate    | 2024-03-08 23:39:13.457753039          'AbsolutePanTiltPositionSpace': [
frigate    | 2024-03-08 23:39:13.457754763              {
frigate    | 2024-03-08 23:39:13.457756894                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.457758491                  'XRange': {
frigate    | 2024-03-08 23:39:13.457760114                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.457761777                      'Max': 360.0
frigate    | 2024-03-08 23:39:13.457763407                  },
frigate    | 2024-03-08 23:39:13.457764953                  'YRange': {
frigate    | 2024-03-08 23:39:13.457766524                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.457768110                      'Max': 180.0
frigate    | 2024-03-08 23:39:13.457769572                  }
frigate    | 2024-03-08 23:39:13.457771029              }
frigate    | 2024-03-08 23:39:13.457772501          ],
frigate    | 2024-03-08 23:39:13.457774097          'AbsoluteZoomPositionSpace': [
frigate    | 2024-03-08 23:39:13.457775552              {
frigate    | 2024-03-08 23:39:13.457777545                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
frigate    | 2024-03-08 23:39:13.457779279                  'XRange': {
frigate    | 2024-03-08 23:39:13.457780907                      'Min': 1.0,
frigate    | 2024-03-08 23:39:13.457782565                      'Max': 1.0
frigate    | 2024-03-08 23:39:13.457784111                  }
frigate    | 2024-03-08 23:39:13.457785621              }
frigate    | 2024-03-08 23:39:13.457787149          ],
frigate    | 2024-03-08 23:39:13.457788853          'RelativePanTiltTranslationSpace': [
frigate    | 2024-03-08 23:39:13.457790340              {
frigate    | 2024-03-08 23:39:13.457792251                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.457793798                  'XRange': {
frigate    | 2024-03-08 23:39:13.457795395                      'Min': -360.0,
frigate    | 2024-03-08 23:39:13.457796919                      'Max': 360.0
frigate    | 2024-03-08 23:39:13.457798468                  },
frigate    | 2024-03-08 23:39:13.457800032                  'YRange': {
frigate    | 2024-03-08 23:39:13.457801667                      'Min': -180.0,
frigate    | 2024-03-08 23:39:13.457803178                      'Max': 180.0
frigate    | 2024-03-08 23:39:13.457804627                  }
frigate    | 2024-03-08 23:39:13.457806051              },
frigate    | 2024-03-08 23:39:13.457807562              {
frigate    | 2024-03-08 23:39:13.457809502                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov',
frigate    | 2024-03-08 23:39:13.457811027                  'XRange': {
frigate    | 2024-03-08 23:39:13.457812603                      'Min': -100.0,
frigate    | 2024-03-08 23:39:13.457814169                      'Max': 100.0
frigate    | 2024-03-08 23:39:13.457815649                  },
frigate    | 2024-03-08 23:39:13.457817170                  'YRange': {
frigate    | 2024-03-08 23:39:13.457818701                      'Min': -100.0,
frigate    | 2024-03-08 23:39:13.457820244                      'Max': 100.0
frigate    | 2024-03-08 23:39:13.457821706                  }
frigate    | 2024-03-08 23:39:13.457823187              }
frigate    | 2024-03-08 23:39:13.457824629          ],
frigate    | 2024-03-08 23:39:13.457826247          'RelativeZoomTranslationSpace': [
frigate    | 2024-03-08 23:39:13.457827687              {
frigate    | 2024-03-08 23:39:13.457829538                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
frigate    | 2024-03-08 23:39:13.457831105                  'XRange': {
frigate    | 2024-03-08 23:39:13.457832661                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.457834196                      'Max': 0.0
frigate    | 2024-03-08 23:39:13.457835715                  }
frigate    | 2024-03-08 23:39:13.457837183              }
frigate    | 2024-03-08 23:39:13.457838599          ],
frigate    | 2024-03-08 23:39:13.457840276          'ContinuousPanTiltVelocitySpace': [
frigate    | 2024-03-08 23:39:13.457841686              {
frigate    | 2024-03-08 23:39:13.457843559                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.457845104                  'XRange': {
frigate    | 2024-03-08 23:39:13.457846651                      'Min': -1.0,
frigate    | 2024-03-08 23:39:13.457848193                      'Max': 1.0
frigate    | 2024-03-08 23:39:13.457849674                  },
frigate    | 2024-03-08 23:39:13.457851191                  'YRange': {
frigate    | 2024-03-08 23:39:13.457852772                      'Min': -1.0,
frigate    | 2024-03-08 23:39:13.457854373                      'Max': 1.0
frigate    | 2024-03-08 23:39:13.457855849                  }
frigate    | 2024-03-08 23:39:13.457857326              }
frigate    | 2024-03-08 23:39:13.457858699          ],
frigate    | 2024-03-08 23:39:13.457860303          'ContinuousZoomVelocitySpace': [
frigate    | 2024-03-08 23:39:13.457861772              {
frigate    | 2024-03-08 23:39:13.457863623                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
frigate    | 2024-03-08 23:39:13.457865126                  'XRange': {
frigate    | 2024-03-08 23:39:13.457866665                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.457868237                      'Max': 0.0
frigate    | 2024-03-08 23:39:13.457869686                  }
frigate    | 2024-03-08 23:39:13.457871123              }
frigate    | 2024-03-08 23:39:13.457872520          ],
frigate    | 2024-03-08 23:39:13.457874077          'PanTiltSpeedSpace': [
frigate    | 2024-03-08 23:39:13.457875531              {
frigate    | 2024-03-08 23:39:13.457877463                  'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
frigate    | 2024-03-08 23:39:13.457879030                  'XRange': {
frigate    | 2024-03-08 23:39:13.457880534                      'Min': 1.0,
frigate    | 2024-03-08 23:39:13.457882095                      'Max': 1.0
frigate    | 2024-03-08 23:39:13.457883607                  }
frigate    | 2024-03-08 23:39:13.457885062              }
frigate    | 2024-03-08 23:39:13.457886487          ],
frigate    | 2024-03-08 23:39:13.457888081          'ZoomSpeedSpace': [
frigate    | 2024-03-08 23:39:13.457889505              {
frigate    | 2024-03-08 23:39:13.457891504                  'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
frigate    | 2024-03-08 23:39:13.457893008                  'XRange': {
frigate    | 2024-03-08 23:39:13.457894540                      'Min': 0.0,
frigate    | 2024-03-08 23:39:13.457896112                      'Max': 0.0
frigate    | 2024-03-08 23:39:13.457897535                  }
frigate    | 2024-03-08 23:39:13.457898988              }
frigate    | 2024-03-08 23:39:13.457900440          ],
frigate    | 2024-03-08 23:39:13.457901908          'Extension': None,
frigate    | 2024-03-08 23:39:13.457903418          '_attr_1': None
frigate    | 2024-03-08 23:39:13.457904926      },
frigate    | 2024-03-08 23:39:13.457906438      'PTZTimeout': {
frigate    | 2024-03-08 23:39:13.457908017          'Min': datetime.timedelta(seconds=1),
frigate    | 2024-03-08 23:39:13.457909666          'Max': datetime.timedelta(seconds=100)
frigate    | 2024-03-08 23:39:13.457911115      },
frigate    | 2024-03-08 23:39:13.457912647      '_value_1': [
frigate    | 2024-03-08 23:39:13.457914525          <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x7849ee4a4340>
frigate    | 2024-03-08 23:39:13.457915947      ],
frigate    | 2024-03-08 23:39:13.457917479      'PTControlDirection': None,
frigate    | 2024-03-08 23:39:13.457918953      'Extension': None,
frigate    | 2024-03-08 23:39:13.457920467      '_attr_1': None
frigate    | 2024-03-08 23:39:13.457921904  }
frigate    | 2024-03-08 23:39:13.522412545  [2024-03-08 23:39:13] frigate.ptz.onvif              WARNING : Unable to get status from camera: TESTCAM: Unknown error: No status
frigate    | 2024-03-08 23:39:13.522424918  [2024-03-08 23:39:13] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request: {
frigate    | 2024-03-08 23:39:13.522430507      'ProfileToken': 'Profile_0',
frigate    | 2024-03-08 23:39:13.522435218      'Translation': None,
frigate    | 2024-03-08 23:39:13.522439384      'Speed': None
frigate    | 2024-03-08 23:39:13.522443330  }
frigate    | 2024-03-08 23:39:13.523784441  Traceback (most recent call last):
frigate    | 2024-03-08 23:39:13.524707016    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
frigate    | 2024-03-08 23:39:13.526239906      return _run_code(code, main_globals, None,
frigate    | 2024-03-08 23:39:13.526988747    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
frigate    | 2024-03-08 23:39:13.528295817      exec(code, run_globals)
frigate    | 2024-03-08 23:39:13.529088193    File "/opt/frigate/frigate/__main__.py", line 17, in <module>
frigate    | 2024-03-08 23:39:13.530344486      frigate_app.start()
frigate    | 2024-03-08 23:39:13.530599503    File "/opt/frigate/frigate/app.py", line 685, in start
frigate    | 2024-03-08 23:39:13.531085148      self.start_ptz_autotracker()
frigate    | 2024-03-08 23:39:13.531347442    File "/opt/frigate/frigate/app.py", line 461, in start_ptz_autotracker
frigate    | 2024-03-08 23:39:13.531827809      self.ptz_autotracker_thread = PtzAutoTrackerThread(
frigate    | 2024-03-08 23:39:13.532053662    File "/opt/frigate/frigate/ptz/autotrack.py", line 153, in __init__
frigate    | 2024-03-08 23:39:13.532453641      self.ptz_autotracker = PtzAutoTracker(
frigate    | 2024-03-08 23:39:13.532693414    File "/opt/frigate/frigate/ptz/autotrack.py", line 215, in __init__
frigate    | 2024-03-08 23:39:13.533113324      self._autotracker_setup(camera_config, camera)
frigate    | 2024-03-08 23:39:13.533345110    File "/opt/frigate/frigate/ptz/autotrack.py", line 251, in _autotracker_setup
frigate    | 2024-03-08 23:39:13.533778155      if not self.onvif._init_onvif(camera):
frigate    | 2024-03-08 23:39:13.534025439    File "/opt/frigate/frigate/ptz/onvif.py", line 179, in _init_onvif
frigate    | 2024-03-08 23:39:13.534440700      move_request.Translation = status.Position
frigate    | 2024-03-08 23:39:13.534713429  AttributeError: 'NoneType' object has no attribute 'Position'
^CGracefully stopping... (press Ctrl+C again to force)

@roleoroleo
Copy link
Owner

This log is not enough.
Are you able to capture the network traffic between frigate and the cam?

@ErliPan
Copy link
Author

ErliPan commented Mar 10, 2024

I don't typically do packet captures so I'm sure it this helps but I sent the tcpdump utils binary to the camera and started capturing excluding the ssh stuff.

192.168.1.58 is the camera
192.168.1.209 is the Frigate container

The http port I changed to 8080 in an attempt to see if anything changes and I didn't revert back yet.
Also I'm currently running the 0.3.0 firmware you sent.

Senza nome.txt

Also weird thing. The last time I tried I remember at least managing to get the Frigate PTZ control to work. This time it simply didn't load. I think I'm missing something here.

One big suspect is that "http:///onvif/ptz_service" is not giving the right response. I tried opening it from my browser and I got "Empty response" same with wget. Not sure what went wrong

@roleoroleo
Copy link
Owner

I need the content of the frames. Use this command with tcpdump:
tcpdump -i wlan0 -w /tmp/capture_01.pcap
Then download the file using ftp.
And send it to me.

Please, try 0.3.1. There are a lot of new fixes about onvif services.

One big suspect is that "http:///onvif/ptz_service" is not giving the right response. I tried opening it from my browser and I got "Empty response" same with wget. Not sure what went wrong

This is the normal behavior. The service needs to be called with a post request and a specific content.

@ErliPan
Copy link
Author

ErliPan commented Mar 12, 2024

So I swapped back to 0.3.1 and captured the content and here's the files:

https://mega.nz/file/5klDzQbQ#dPA6VCrz3FsiDQ6HFYayjaa4yJwcoYW33xktX8BjEP8

@roleoroleo
Copy link
Owner

GetStatus request returns "NoStatus" error.
This means that the command executed to get the position info doesn't work.
Please, run it manually and check the output:

ipc_cmd -g
ipc_cmd -u

After that, check if the system.sh contains the line
echo "is_running=/tmp/sd/yi-hack/bin/ipc_cmd -u" >> $ONVIF_SRVD_CONF
or
echo "is_moving=/tmp/sd/yi-hack/bin/ipc_cmd -u" >> $ONVIF_SRVD_CONF

In case, the second line is correct one. This is not a problem but fix it and restart.

@ErliPan
Copy link
Author

ErliPan commented Mar 15, 2024

So that was the issue as neither of them is in the script

if [[ $MODEL_SUFFIX == "r30gb" ]] || [[ $MODEL_SUFFIX == "r35gb" ]] || [[ $MODEL_SUFFIX == "r40ga" ]] || [[ $MODEL_SUFFIX == "h51ga" ]] || [[ $MODEL_SUFFIX == "h52ga" ]] || [[ $MODEL_SUFFIX == "h60ga" ]] || [[ $MODEL_SUFFIX == "q321br_lsx" ]] || [[ $MODEL_SUFFIX == "qg311r" ]] || [[ $MODEL_SUFFIX == "b091qp" ]] ; then
        echo "#PTZ" >> $ONVIF_SRVD_CONF
        echo "ptz=1" >> $ONVIF_SRVD_CONF
        echo "get_position=/tmp/sd/yi-hack/bin/ipc_cmd -g" >> $ONVIF_SRVD_CONF
        echo "move_left=/tmp/sd/yi-hack/bin/ipc_cmd -m left" >> $ONVIF_SRVD_CONF
        echo "move_right=/tmp/sd/yi-hack/bin/ipc_cmd -m right" >> $ONVIF_SRVD_CONF
        echo "move_up=/tmp/sd/yi-hack/bin/ipc_cmd -m up" >> $ONVIF_SRVD_CONF
        echo "move_down=/tmp/sd/yi-hack/bin/ipc_cmd -m down" >> $ONVIF_SRVD_CONF
        echo "move_stop=/tmp/sd/yi-hack/bin/ipc_cmd -m stop" >> $ONVIF_SRVD_CONF
        echo "move_preset=/tmp/sd/yi-hack/bin/ipc_cmd -p %d" >> $ONVIF_SRVD_CONF
        echo "set_preset=/tmp/sd/yi-hack/script/ptz_presets.sh -a add_preset -m %s" >> $ONVIF_SRVD_CONF
        echo "set_home_position=/tmp/sd/yi-hack/script/ptz_presets.sh -a set_home_position" >> $ONVIF_SRVD_CONF
        echo "remove_preset=/tmp/sd/yi-hack/script/ptz_presets.sh -a del_preset -n %d" >> $ONVIF_SRVD_CONF
        echo "jump_to_abs=/tmp/sd/yi-hack/bin/ipc_cmd -j %f,%f" >> $ONVIF_SRVD_CONF
        echo "jump_to_rel=/tmp/sd/yi-hack/bin/ipc_cmd -J %f,%f" >> $ONVIF_SRVD_CONF
        echo "get_presets=/tmp/sd/yi-hack/script/ptz_presets.sh -a get_presets" >> $ONVIF_SRVD_CONF
        echo "" >> $ONVIF_SRVD_CONF
    fi

The error is fixed after adding the line but now there's a new error.

frigate    | 2024-03-15 20:03:09.906698842  [2024-03-15 20:03:09] frigate.ptz.onvif              ERROR   : Unable to get Onvif media profiles for camera: TESTCAM: Unknown error: Invalid URL 'http:///onvif/media_service': No host supplied

Maybe related to this:
roleoroleo/yi-hack-MStar#537

@ErliPan
Copy link
Author

ErliPan commented Mar 15, 2024

So reading that thread the user mentions a failure of running the test script. I remember being able to run that script so I tried again and it gave the same error.
As a sanity check I formatted the SD card and installed 0.2.9 and the script ran fine.

This is the log of Frigate when running 0.2.9

frigate    | 2024-03-15 20:24:06.314386656  [2024-03-15 20:24:06] frigate.ptz.onvif              DEBUG   : Onvif status config for TESTCAM: {
frigate    | 2024-03-15 20:24:06.314397682      'Position': None,
frigate    | 2024-03-15 20:24:06.314403600      'MoveStatus': None,
frigate    | 2024-03-15 20:24:06.314409265      'Error': None,
frigate    | 2024-03-15 20:24:06.314416489      'UtcTime': datetime.datetime(2024, 3, 15, 19, 24, 6, tzinfo=<isodate.tzinfo.Utc object at 0x78a6ae02c3a0>),
frigate    | 2024-03-15 20:24:06.314421932      '_value_1': None,
frigate    | 2024-03-15 20:24:06.314427321      '_attr_1': None
frigate    | 2024-03-15 20:24:06.314432134  }
frigate    | 2024-03-15 20:24:06.315956291  [2024-03-15 20:24:06] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request: {
frigate    | 2024-03-15 20:24:06.315963856      'ProfileToken': 'Profile_0',
frigate    | 2024-03-15 20:24:06.315967761      'Translation': None,
frigate    | 2024-03-15 20:24:06.315971025      'Speed': None
frigate    | 2024-03-15 20:24:06.315974312  }
frigate    | 2024-03-15 20:24:06.315979427  [2024-03-15 20:24:06] frigate.ptz.onvif              WARNING : Disabling autotracking zooming for TESTCAM: Relative zoom not supported
frigate    | 2024-03-15 20:24:06.315984071  [2024-03-15 20:24:06] frigate.ptz.onvif              DEBUG   : TESTCAM: Relative move request after setup: {
frigate    | 2024-03-15 20:24:06.315987669      'ProfileToken': 'Profile_0',
frigate    | 2024-03-15 20:24:06.315991204      'Translation': None,
frigate    | 2024-03-15 20:24:06.315994354      'Speed': {
frigate    | 2024-03-15 20:24:06.315997775          'PanTilt': {
frigate    | 2024-03-15 20:24:06.316001192              'x': 0.5,
frigate    | 2024-03-15 20:24:06.316004594              'y': 0.5,
frigate    | 2024-03-15 20:24:06.316008872              'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
frigate    | 2024-03-15 20:24:06.316012112          },
frigate    | 2024-03-15 20:24:06.316015473          'Zoom': {
frigate    | 2024-03-15 20:24:06.316018775              'x': 0.5,
frigate    | 2024-03-15 20:24:06.316023015              'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
frigate    | 2024-03-15 20:24:06.316026188          }
frigate    | 2024-03-15 20:24:06.316029561      }
frigate    | 2024-03-15 20:24:06.316032735  }

UPDATE:
With 0.2.9 autotracking doesn't work, but the PTZ control page works. In the control page the preset selection works, the move up-down works but the move left-right doesn't.

Moving left-right gives me this error:

frigate    | 2024-03-15 20:32:23.369039019  [2024-03-15 20:32:23] ws4py                          ERROR   : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:45762] due to exception: ONVIFError(Fault('ActionNotSupported')) in once method

UPDATE 2:
I formatted again and with 0.3.0 Autotracking still doesn't work but now the entire PTZ control page works.
It's still giving me
Disabling autotracking zooming for TESTCAM: Relative zoom not supported
but that's expected at least with this firmware

So I guess there's a bug introduced in 0.3.1

Anyway this is the best I can do for now. There's something between 0.3.0 and 0.3.1 that makes the python test script fail and one of the line you mentioned is not present on system.sh

@roleoroleo
Copy link
Owner

I will try again to install frigate...

@ErliPan
Copy link
Author

ErliPan commented Mar 16, 2024

I will try again to install frigate...

This script https://gist.github.com/hawkeye217/152a1d4ba80760dac95d46e143d37112 runs fine on 0.2.9 and 0.3.0 fails with 0.3.1 giving the same exception as Frigate. I think you should try that.

@roleoroleo
Copy link
Owner

I already tested this script and this is the output with my 0.3.1:
#767 (comment)

@ErliPan
Copy link
Author

ErliPan commented Mar 16, 2024

I formatted everything and reinstalled and is the output from 0.3.1 now. I'm so confused

root@TestServer:~# python3 testcamera2.py 
Connected to ONVIF camera
Created media service object
Media profiles
[{
    'Name': 'Profile_0',
    'VideoSourceConfiguration': {
        'Name': 'Profile_0_VideoSourceConfig',
        'UseCount': 1,
        'SourceToken': 'VideoSourceToken',
        'Bounds': {
            'x': 0,
            'y': 0,
            'width': 1920,
            'height': 1080
        },
        '_value_1': None,
        'Extension': None,
        'token': 'Profile_0_VideoSourceConfigToken',
        '_attr_1': {
    }
    },
    'AudioSourceConfiguration': None,
    'VideoEncoderConfiguration': {
        'Name': 'Profile_0_VideoEncoder',
        'UseCount': 1,
        'Encoding': 'H264',
        'Resolution': {
            'Width': 1920,
            'Height': 1080
        },
        'Quality': 0.0,
        'RateControl': {
            'FrameRateLimit': 0,
            'EncodingInterval': 0,
            'BitrateLimit': 0
        },
        'MPEG4': None,
        'H264': {
            'GovLength': 40,
            'H264Profile': 'High'
        },
        'Multicast': {
            'Address': {
                'Type': 'IPv4',
                'IPv4Address': None,
                'IPv6Address': None
            },
            'Port': 0,
            'TTL': 0,
            'AutoStart': False,
            '_value_1': None,
            '_attr_1': None
        },
        'SessionTimeout': datetime.timedelta(0),
        '_value_1': None,
        'token': 'Profile_0_VideoEncoderToken',
        '_attr_1': {
    }
    },
    'AudioEncoderConfiguration': None,
    'VideoAnalyticsConfiguration': None,
    'PTZConfiguration': {
        'Name': 'PTZCfg',
        'UseCount': 0,
        'NodeToken': 'PTZNodeToken',
        'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
        'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
        'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
        'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
        'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
        'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
        'DefaultPTZSpeed': {
            'PanTilt': {
                'x': 1.0,
                'y': 1.0,
                'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
            },
            'Zoom': {
                'x': 0.0,
                'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
            }
        },
        'DefaultPTZTimeout': datetime.timedelta(seconds=5),
        'PanTiltLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 360.0
                },
                'YRange': {
                    'Min': 0.0,
                    'Max': 180.0
                }
            }
        },
        'ZoomLimits': {
            'Range': {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 1.0,
                    'Max': 1.0
                }
            }
        },
        'Extension': {
            '_value_1': [
                <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x72976efa36c0>
            ],
            'PTControlDirection': None,
            'Extension': None
        },
        'token': 'PTZCfgToken',
        '_attr_1': {
            'MoveRamp': '0',
            'PresetRamp': '0',
            'PresetTourRamp': '0'
        }
    },
    'MetadataConfiguration': None,
    'Extension': None,
    'token': 'Profile_0',
    'fixed': True,
    '_attr_1': {
}
}]
Chosen token
Profile_0
Creating PTZ object
Created PTZ service object
PTZ configurations:
{
    'Name': 'PTZCfg',
    'UseCount': 0,
    'NodeToken': 'PTZNodeToken',
    'DefaultAbsolutePantTiltPositionSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
    'DefaultAbsoluteZoomPositionSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
    'DefaultRelativePanTiltTranslationSpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
    'DefaultRelativeZoomTranslationSpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
    'DefaultContinuousPanTiltVelocitySpace': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
    'DefaultContinuousZoomVelocitySpace': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
    'DefaultPTZSpeed': {
        'PanTilt': {
            'x': 1.0,
            'y': 1.0,
            'space': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace'
        },
        'Zoom': {
            'x': 0.0,
            'space': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace'
        }
    },
    'DefaultPTZTimeout': datetime.timedelta(seconds=5),
    'PanTiltLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
            'XRange': {
                'Min': 0.0,
                'Max': 360.0
            },
            'YRange': {
                'Min': 0.0,
                'Max': 180.0
            }
        }
    },
    'ZoomLimits': {
        'Range': {
            'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
            'XRange': {
                'Min': 1.0,
                'Max': 1.0
            }
        }
    },
    'Extension': {
        '_value_1': [
            <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x72976edf2900>
        ],
        'PTControlDirection': None,
        'Extension': None
    },
    'token': 'PTZCfgToken',
    '_attr_1': {
        'MoveRamp': '0',
        'PresetRamp': '0',
        'PresetTourRamp': '0'
    }
}

PTZ configuration options:
{
    'Spaces': {
        'AbsolutePanTiltPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 360.0
                },
                'YRange': {
                    'Min': 0.0,
                    'Max': 180.0
                }
            }
        ],
        'AbsoluteZoomPositionSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace',
                'XRange': {
                    'Min': 1.0,
                    'Max': 1.0
                }
            }
        ],
        'RelativePanTiltTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': -360.0,
                    'Max': 360.0
                },
                'YRange': {
                    'Min': -180.0,
                    'Max': 180.0
                }
            },
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov',
                'XRange': {
                    'Min': -100.0,
                    'Max': 100.0
                },
                'YRange': {
                    'Min': -100.0,
                    'Max': 100.0
                }
            }
        ],
        'RelativeZoomTranslationSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'ContinuousPanTiltVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': -1.0,
                    'Max': 1.0
                },
                'YRange': {
                    'Min': -1.0,
                    'Max': 1.0
                }
            }
        ],
        'ContinuousZoomVelocitySpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'PanTiltSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace',
                'XRange': {
                    'Min': 1.0,
                    'Max': 1.0
                }
            }
        ],
        'ZoomSpeedSpace': [
            {
                'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace',
                'XRange': {
                    'Min': 0.0,
                    'Max': 0.0
                }
            }
        ],
        'Extension': None,
        '_attr_1': None
    },
    'PTZTimeout': {
        'Min': datetime.timedelta(seconds=1),
        'Max': datetime.timedelta(seconds=100)
    },
    '_value_1': [
        <Element {http://www.onvif.org/ver10/schema}PTControlDirection at 0x72976eddaac0>
    ],
    'PTControlDirection': None,
    'Extension': None,
    '_attr_1': None
}

PTZ service capabilities:
{
    '_value_1': None,
    'EFlip': False,
    'Reverse': False,
    'GetCompatibleConfigurations': False,
    '_attr_1': {
        'MoveStatus': 'true',
        'StatusPosition': 'true'
    }
}

PTZ status:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/onvif/client.py", line 23, in wrapped
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/onvif/client.py", line 153, in wrapped
    return call(params, callback)
  File "/usr/local/lib/python3.8/dist-packages/onvif/client.py", line 140, in call
    ret = func(**params)
  File "/usr/local/lib/python3.8/dist-packages/zeep/proxy.py", line 46, in __call__
    return self._proxy._binding.send(
  File "/usr/local/lib/python3.8/dist-packages/zeep/wsdl/bindings/soap.py", line 135, in send
    return self.process_reply(client, operation_obj, response)
  File "/usr/local/lib/python3.8/dist-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
    return self.process_error(doc, operation)
  File "/usr/local/lib/python3.8/dist-packages/zeep/wsdl/bindings/soap.py", line 391, in process_error
    raise Fault(
zeep.exceptions.Fault: No status

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "testcamera2.py", line 71, in <module>
    status = ptz.GetStatus(request)
  File "/usr/local/lib/python3.8/dist-packages/onvif/client.py", line 26, in wrapped
    raise ONVIFError(err)
onvif.exceptions.ONVIFError: Unknown error: No status

@roleoroleo
Copy link
Owner

Let me check if my cam is really on 0.3.1

@ErliPan
Copy link
Author

ErliPan commented Mar 16, 2024

So with the fresh install i'm not getting the Invalid URL 'http:///onvif/media_service': No host supplied anymore. I think that was caused by some settings I messed up... I think... I need further testing.

Also my camera is currently connected via Wi-Fi, this evening I will take a ethernet cable to connect the camera and check if anything changes.

@roleoroleo
Copy link
Owner

I successfully installed frigate and configured with onvif support.
The problem was "is_moving" configuration.
The warning in the log is fixed but I don't know if autotracking works.
Please, try this beta:
r35gb_0.3.1.tar.gz

@ErliPan
Copy link
Author

ErliPan commented Mar 16, 2024

Good news it looks like to be working. There's no more errors.

I still need to figure out the movement_weights and why it only works sometimes.

mqtt:
  host: mqtt.<domain>
  topic_prefix: frigate
  user: MQTT
  password: <pw>

detectors:
  coral:
    type: edgetpu
    device: pci

cameras:

  TESTCAM:
    ffmpeg:
      inputs:
      - path: rtsp://192.168.1.58/ch0_0.h264
        roles:
        - record
        - detect
      hwaccel_args: preset-intel-qsv-h264
    detect:
      width: 1280
      height: 720
      enabled: true
    record:
      enabled: false
    snapshots:
      enabled: false

    zones:
      zone_0:
        coordinates: 
          866,613,1033,495,1065,343,1047,258,967,146,781,119,688,114,416,119,220,263,238,567,480,630,746,640

    onvif:
      host: 192.168.1.58
      port: 80
      user: admin
      password: admin

      autotracking:
        calibrate_on_startup: false
        # Optional: enable/disable object autotracking. (default: shown below)
        enabled: true
        zooming: disabled
        track:
        - person
        # Required: Begin automatically tracking an object when it enters any of the listed zones.
        required_zones:
        - zone_0
        # Required: Name of ONVIF preset in camera's firmware to return to when tracking is over. (default: shown below)
        return_preset: home
        #movement_weights: 0.0, 1.0, 0.13565969467163086, 0.14995758918023874, 0.05161041828893848
        #movement_weights: 0.0, 1.0, 0.2214038372039795, 0.297745349843015, -0.0014536011603570433
        movement_weights: 0.0, 1.0, 0.15508723258972168, 0.2883783109726445, 0.0009348861632808843
objects:
  track:
  - person
  - car


logger:
  default: info
  logs:
    frigate.ptz.autotrack: debug
    frigate.ptz.onvif: debug

@ErliPan
Copy link
Author

ErliPan commented Mar 19, 2024

I'm going to close the issue for now because it looks like it's solved. Still need to figure out why sometimes it turns in the wrong direction but I think it's a config issue. Thank you for the help. Will patiently wait for the stable release.

@ErliPan ErliPan closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants