Closed tetele closed 1 year ago
Can you add this to your config, restart Frigate, and paste the first part of the log output?
logger:
logs:
frigate.ptz.onvif: debug
We've been noticing some others having trouble with ONVIF on Hikvision cameras lately. Can you make sure your camera's firmware is up to date and then try again?
Firmware is at the latest version, V5.5.803 build 210817
Here is the log:
2023-10-03 16:23:08.014968944 [2023-10-03 16:23:08] frigate.ptz.onvif DEBUG : Onvif config for karlas_room: {
2023-10-03 16:23:08.014972070 'Spaces': {
2023-10-03 16:23:08.014973292 'AbsolutePanTiltPositionSpace': [
2023-10-03 16:23:08.014974291 {
2023-10-03 16:23:08.014975470 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalPositionSpace',
2023-10-03 16:23:08.014976405 'XRange': {
2023-10-03 16:23:08.014985728 'Min': 0.0,
2023-10-03 16:23:08.014986729 'Max': 1.0
2023-10-03 16:23:08.014988077 },
2023-10-03 16:23:08.014988990 'YRange': {
2023-10-03 16:23:08.014989955 'Min': 0.0,
2023-10-03 16:23:08.014990908 'Max': 1.0
2023-10-03 16:23:08.014991793 }
2023-10-03 16:23:08.014992661 }
2023-10-03 16:23:08.014993517 ],
2023-10-03 16:23:08.015004422 'AbsoluteZoomPositionSpace': [
2023-10-03 16:23:08.015005293 {
2023-10-03 16:23:08.015006423 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalPosition',
2023-10-03 16:23:08.015013482 'XRange': {
2023-10-03 16:23:08.015014392 'Min': 1.0,
2023-10-03 16:23:08.015015314 'Max': inf
2023-10-03 16:23:08.015016227 }
2023-10-03 16:23:08.015017086 }
2023-10-03 16:23:08.015017938 ],
2023-10-03 16:23:08.015018907 'RelativePanTiltTranslationSpace': [
2023-10-03 16:23:08.015019793 {
2023-10-03 16:23:08.015020866 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalTranslationSpace',
2023-10-03 16:23:08.015021750 'XRange': {
2023-10-03 16:23:08.015029465 'Min': -1.0,
2023-10-03 16:23:08.015030409 'Max': 1.0
2023-10-03 16:23:08.015031264 },
2023-10-03 16:23:08.015032165 'YRange': {
2023-10-03 16:23:08.015033066 'Min': -1.0,
2023-10-03 16:23:08.015034078 'Max': 1.0
2023-10-03 16:23:08.015034922 }
2023-10-03 16:23:08.015035777 }
2023-10-03 16:23:08.015036553 ],
2023-10-03 16:23:08.015037535 'RelativeZoomTranslationSpace': [
2023-10-03 16:23:08.015038348 {
2023-10-03 16:23:08.015047955 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigital',
2023-10-03 16:23:08.015048834 'XRange': {
2023-10-03 16:23:08.015049736 'Min': -inf,
2023-10-03 16:23:08.015050620 'Max': inf
2023-10-03 16:23:08.015051461 }
2023-10-03 16:23:08.015052452 }
2023-10-03 16:23:08.015053273 ],
2023-10-03 16:23:08.015054205 'ContinuousPanTiltVelocitySpace': [
2023-10-03 16:23:08.015055052 {
2023-10-03 16:23:08.015056113 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
2023-10-03 16:23:08.015056995 'XRange': {
2023-10-03 16:23:08.015057927 'Min': -1.0,
2023-10-03 16:23:08.015058836 'Max': 1.0
2023-10-03 16:23:08.015059699 },
2023-10-03 16:23:08.015060559 'YRange': {
2023-10-03 16:23:08.015061426 'Min': -1.0,
2023-10-03 16:23:08.015062286 'Max': 1.0
2023-10-03 16:23:08.015063099 }
2023-10-03 16:23:08.015073663 },
2023-10-03 16:23:08.015074519 {
2023-10-03 16:23:08.015075600 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceFOV',
2023-10-03 16:23:08.015076482 'XRange': {
2023-10-03 16:23:08.015077354 'Min': -7.0,
2023-10-03 16:23:08.015078240 'Max': 7.0
2023-10-03 16:23:08.015079101 },
2023-10-03 16:23:08.015079940 'YRange': {
2023-10-03 16:23:08.015090764 'Min': -7.0,
2023-10-03 16:23:08.015091674 'Max': 7.0
2023-10-03 16:23:08.015092501 }
2023-10-03 16:23:08.015093356 }
2023-10-03 16:23:08.015094165 ],
2023-10-03 16:23:08.015095048 'ContinuousZoomVelocitySpace': [
2023-10-03 16:23:08.015095869 {
2023-10-03 16:23:08.015096961 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
2023-10-03 16:23:08.015097835 'XRange': {
2023-10-03 16:23:08.015098800 'Min': -1.0,
2023-10-03 16:23:08.015099734 'Max': 1.0
2023-10-03 16:23:08.015100539 }
2023-10-03 16:23:08.015101359 },
2023-10-03 16:23:08.015102181 {
2023-10-03 16:23:08.015103307 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocitySpaceMillimeter',
2023-10-03 16:23:08.015104164 'XRange': {
2023-10-03 16:23:08.015105049 'Min': -7.0,
2023-10-03 16:23:08.015105912 'Max': 7.0
2023-10-03 16:23:08.015106716 }
2023-10-03 16:23:08.015119004 }
2023-10-03 16:23:08.015119817 ],
2023-10-03 16:23:08.015120666 'PanTiltSpeedSpace': [],
2023-10-03 16:23:08.015121549 'ZoomSpeedSpace': [],
2023-10-03 16:23:08.015122413 'Extension': None,
2023-10-03 16:23:08.015123243 '_attr_1': None
2023-10-03 16:23:08.015124066 },
2023-10-03 16:23:08.015124965 'PTZTimeout': {
2023-10-03 16:23:08.015125849 'Min': datetime.timedelta(seconds=1),
2023-10-03 16:23:08.015126775 'Max': datetime.timedelta(seconds=600)
2023-10-03 16:23:08.015127589 },
2023-10-03 16:23:08.015128469 '_value_1': None,
2023-10-03 16:23:08.015129331 'PTControlDirection': None,
2023-10-03 16:23:08.015130324 'Extension': None,
2023-10-03 16:23:08.015131166 '_attr_1': None
2023-10-03 16:23:08.015131976 }
2023-10-03 16:23:08.075638802 [2023-10-03 16:23:08] frigate.http ERROR : Exception on /karlas_room/ptz/info [GET]
2023-10-03 16:23:08.075640993 Traceback (most recent call last):
2023-10-03 16:23:08.075642287 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-03 16:23:08.075643487 response = self.full_dispatch_request()
2023-10-03 16:23:08.075644799 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-03 16:23:08.075645901 rv = self.handle_user_exception(e)
2023-10-03 16:23:08.075647162 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-03 16:23:08.075648175 rv = self.dispatch_request()
2023-10-03 16:23:08.075649364 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-03 16:23:08.075650422 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-03 16:23:08.075651480 File "/opt/frigate/frigate/http.py", line 1155, in camera_ptz_info
2023-10-03 16:23:08.075652548 return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-03 16:23:08.075653585 File "/opt/frigate/frigate/ptz/onvif.py", line 339, in get_camera_info
2023-10-03 16:23:08.075654543 self._init_onvif(camera_name)
2023-10-03 16:23:08.075655604 File "/opt/frigate/frigate/ptz/onvif.py", line 138, in _init_onvif
2023-10-03 16:23:08.075656667 self.cams[camera_name]["presets"][preset["Name"].lower()] = preset["token"]
2023-10-03 16:23:08.075657733 AttributeError: 'NoneType' object has no attribute 'lower'
I've just updated to 0.13.0-FACD557
, which should have the fix included. Is this the same issue @hawkeye217 ?
2023-10-20 16:27:44.989283143 [2023-10-20 16:27:44] frigate.ptz.onvif DEBUG : Onvif config for karlas_room: {
2023-10-20 16:27:44.989286249 'Spaces': {
2023-10-20 16:27:44.989287495 'AbsolutePanTiltPositionSpace': [
2023-10-20 16:27:44.989288547 {
2023-10-20 16:27:44.989289784 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalPositionSpace',
2023-10-20 16:27:44.989290813 'XRange': {
2023-10-20 16:27:44.989291800 'Min': 0.0,
2023-10-20 16:27:44.989292778 'Max': 1.0
2023-10-20 16:27:44.989293670 },
2023-10-20 16:27:44.989296608 'YRange': {
2023-10-20 16:27:44.989297545 'Min': 0.0,
2023-10-20 16:27:44.989298904 'Max': 1.0
2023-10-20 16:27:44.989299839 }
2023-10-20 16:27:44.989300950 }
2023-10-20 16:27:44.989301907 ],
2023-10-20 16:27:44.989302870 'AbsoluteZoomPositionSpace': [
2023-10-20 16:27:44.989319582 {
2023-10-20 16:27:44.989320939 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalPosition',
2023-10-20 16:27:44.989328185 'XRange': {
2023-10-20 16:27:44.989329263 'Min': 1.0,
2023-10-20 16:27:44.989330219 'Max': inf
2023-10-20 16:27:44.989331233 }
2023-10-20 16:27:44.989332143 }
2023-10-20 16:27:44.989333041 ],
2023-10-20 16:27:44.989334059 'RelativePanTiltTranslationSpace': [
2023-10-20 16:27:44.989335028 {
2023-10-20 16:27:44.989336158 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalTranslationSpace',
2023-10-20 16:27:44.989337114 'XRange': {
2023-10-20 16:27:44.989345000 'Min': -1.0,
2023-10-20 16:27:44.989346055 'Max': 1.0
2023-10-20 16:27:44.989346930 },
2023-10-20 16:27:44.989347879 'YRange': {
2023-10-20 16:27:44.989348865 'Min': -1.0,
2023-10-20 16:27:44.989349915 'Max': 1.0
2023-10-20 16:27:44.989350811 }
2023-10-20 16:27:44.989351719 }
2023-10-20 16:27:44.989352551 ],
2023-10-20 16:27:44.989353567 'RelativeZoomTranslationSpace': [
2023-10-20 16:27:44.989354435 {
2023-10-20 16:27:44.989364157 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigital',
2023-10-20 16:27:44.989365204 'XRange': {
2023-10-20 16:27:44.989366144 'Min': -inf,
2023-10-20 16:27:44.989367077 'Max': inf
2023-10-20 16:27:44.989367958 }
2023-10-20 16:27:44.989368963 }
2023-10-20 16:27:44.989369845 ],
2023-10-20 16:27:44.989370801 'ContinuousPanTiltVelocitySpace': [
2023-10-20 16:27:44.989371697 {
2023-10-20 16:27:44.989372807 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace',
2023-10-20 16:27:44.989373723 'XRange': {
2023-10-20 16:27:44.989374700 'Min': -1.0,
2023-10-20 16:27:44.989375638 'Max': 1.0
2023-10-20 16:27:44.989376555 },
2023-10-20 16:27:44.989377477 'YRange': {
2023-10-20 16:27:44.989378404 'Min': -1.0,
2023-10-20 16:27:44.989379337 'Max': 1.0
2023-10-20 16:27:44.989380217 }
2023-10-20 16:27:44.989393904 },
2023-10-20 16:27:44.989394908 {
2023-10-20 16:27:44.989396082 'URI': 'http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceFOV',
2023-10-20 16:27:44.989397019 'XRange': {
2023-10-20 16:27:44.989397954 'Min': -7.0,
2023-10-20 16:27:44.989398902 'Max': 7.0
2023-10-20 16:27:44.989399819 },
2023-10-20 16:27:44.989400736 'YRange': {
2023-10-20 16:27:44.989412244 'Min': -7.0,
2023-10-20 16:27:44.989413311 'Max': 7.0
2023-10-20 16:27:44.989414196 }
2023-10-20 16:27:44.989415087 }
2023-10-20 16:27:44.989415953 ],
2023-10-20 16:27:44.989416885 'ContinuousZoomVelocitySpace': [
2023-10-20 16:27:44.989417762 {
2023-10-20 16:27:44.989418916 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace',
2023-10-20 16:27:44.989419823 'XRange': {
2023-10-20 16:27:44.989420886 'Min': -1.0,
2023-10-20 16:27:44.989421852 'Max': 1.0
2023-10-20 16:27:44.989422726 }
2023-10-20 16:27:44.989423604 },
2023-10-20 16:27:44.989424474 {
2023-10-20 16:27:44.989425621 'URI': 'http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocitySpaceMillimeter',
2023-10-20 16:27:44.989426549 'XRange': {
2023-10-20 16:27:44.989427490 'Min': -7.0,
2023-10-20 16:27:44.989428416 'Max': 7.0
2023-10-20 16:27:44.989429282 }
2023-10-20 16:27:44.989441952 }
2023-10-20 16:27:44.989442919 ],
2023-10-20 16:27:44.989443857 'PanTiltSpeedSpace': [],
2023-10-20 16:27:44.989444802 'ZoomSpeedSpace': [],
2023-10-20 16:27:44.989445728 'Extension': None,
2023-10-20 16:27:44.989446648 '_attr_1': None
2023-10-20 16:27:44.989447521 },
2023-10-20 16:27:44.989448455 'PTZTimeout': {
2023-10-20 16:27:44.989449398 'Min': datetime.timedelta(seconds=1),
2023-10-20 16:27:44.989450381 'Max': datetime.timedelta(seconds=600)
2023-10-20 16:27:44.989451254 },
2023-10-20 16:27:44.989452177 '_value_1': None,
2023-10-20 16:27:44.989453099 'PTControlDirection': None,
2023-10-20 16:27:44.989454130 'Extension': None,
2023-10-20 16:27:44.989455049 '_attr_1': None
2023-10-20 16:27:44.989455935 }
2023-10-20 16:27:45.034352408 [2023-10-20 16:27:45] frigate.ptz.onvif DEBUG : Onvif status config for karlas_room: {
2023-10-20 16:27:45.034355448 'Position': None,
2023-10-20 16:27:45.034356648 'MoveStatus': None,
2023-10-20 16:27:45.034357743 'Error': 'NO error',
2023-10-20 16:27:45.034359071 'UtcTime': datetime.datetime(2023, 10, 20, 13, 27, 44, tzinfo=<isodate.tzinfo.Utc object at 0x7fbe2f807b80>),
2023-10-20 16:27:45.034360104 '_value_1': None,
2023-10-20 16:27:45.034361124 '_attr_1': None
2023-10-20 16:27:45.034362083 }
2023-10-20 16:27:45.075154435 [2023-10-20 16:27:45] frigate.http ERROR : Exception on /karlas_room/ptz/info [GET]
2023-10-20 16:27:45.075156851 Traceback (most recent call last):
2023-10-20 16:27:45.075158186 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2190, in wsgi_app
2023-10-20 16:27:45.075159310 response = self.full_dispatch_request()
2023-10-20 16:27:45.075160609 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1486, in full_dispatch_request
2023-10-20 16:27:45.075161760 rv = self.handle_user_exception(e)
2023-10-20 16:27:45.075163024 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1484, in full_dispatch_request
2023-10-20 16:27:45.075164061 rv = self.dispatch_request()
2023-10-20 16:27:45.075165306 File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1469, in dispatch_request
2023-10-20 16:27:45.075166477 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-10-20 16:27:45.075167613 File "/opt/frigate/frigate/http.py", line 1274, in camera_ptz_info
2023-10-20 16:27:45.075168707 return jsonify(current_app.onvif.get_camera_info(camera_name))
2023-10-20 16:27:45.075169830 File "/opt/frigate/frigate/ptz/onvif.py", line 456, in get_camera_info
2023-10-20 16:27:45.075170858 self._init_onvif(camera_name)
2023-10-20 16:27:45.075171967 File "/opt/frigate/frigate/ptz/onvif.py", line 179, in _init_onvif
2023-10-20 16:27:45.075173018 getattr(preset, "Name", f"preset {preset['token']}").lower()
2023-10-20 16:27:45.075174110 AttributeError: 'NoneType' object has no attribute 'lower'
looks like there may be a bug with the logic of returning a default then, this can probably be fixed with
(getattr(preset, "Name") or f"preset {preset['token']}").lower()
Corrected in https://github.com/blakeblackshear/frigate/pull/8245
Describe the problem you are having
When I try to configure ONVIF for one my Hikvision DS-2CV2Q21FD-IW, I get an exception in the Frigate logs:
The Control panel loading icon in the camera page keeps spinning
Version
0.13.0-0858859
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Debian
Install method
Docker Compose
Coral version
PCIe
Network connection
Wired
Camera make and model
Hikvision DS-2CV2Q21FD-IW
Any other information that may be helpful
Frigate is running as a Docker container inside a Debian guest running on a Proxmox VM.