Frequent "Camera not detected" error

On some of my cameras I frequently get a “Camera not detected” error (running hub application). I need to manually restart the zed box to get it working again. Any nice fix for this? Full error:

[2023/10/10, 07:10:47] [custom_edge_body_tracking_service_1] [ERROR] Camera initialization error : CAMERA NOT DETECTED
[Error] [2023/10/10, 07:11:14] Application Custom Edge Body Tracking execution was interrupted.

Hi,

The solution would be to catch this error in the code and use sl::Camera::reboot to restart the camera.

Know that this function sometimes lack reliability depending on your USB controller, but it will get a great improvement in the next patch (4.0.8).

Hi,

Not sure if that would help, as even if I stop the application and reboot the camera through the hub, I still get the error.

It will. Stopping the application does not reset your USB capabilities. For that you need to power cycle the device (unplug / replug), or run sl::Camera::reboot()

Won’t sl::Camera::reboot do the same as hitting the reboot button in the hub? Because that does not help unfortunately.

No, it’s not the same. And sl::rebootCamera will be even better in 4.0.8.

You can also connect to the device with the remote console and run the app on /usr/local/sl_hub/bin/sl_reboot_camera

1 Like

When I run /usr/local/sl_hub/bin/sl_reboot_camera I get:

./sl_reboot_camera: symbol lookup error: ./sl_reboot_camera: undefined symbol: _ZN2sl6ZEDmcuC1EbttbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

Hi,

This is a mismatch of version between ZED SDK and Hub.
Anyway, if you use ZED SDK >= 4.0.8, you can use sl::rebootCamera instead, or it’s python equivalent. Also you should not need like you did with previous versions.

@alassagne

Okay, please provide step-by-step instructions on how to run sl::rebootCamera or the python equivalent. Running get_python_api.py resulted in error:

Processing ./pyzed-4.1-cp38-cp38-linux_aarch64.whl
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 357, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python3/dist-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
    local_path = unpack_url(
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 278, in unpack_url
    return unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/usr/lib/python3/dist-packages/pip/_internal/operations/prepare.py", line 251, in unpack_file_url
    unpack_file(from_path, location, content_type)
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/unpacking.py", line 249, in unpack_file
    unzip_file(
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/unpacking.py", line 114, in unzip_file
    zip = zipfile.ZipFile(zipfp, allowZip64=True)
  File "/usr/lib/python3.8/zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.8/zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

This may be due to installing on ZED SDK 4.1? In any case, please provide step-by-step on how to run the command. Thank you

Hi,

Indeed the python wrapper is not released for 4.1 yet.
You can only use the early-access 4.1 that I sent you with C++.

Hi,

I got /usr/local/sl_hub/bin/sl_reboot_camera working. Thanks