IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.53k stars 4.81k forks source link

d455 camera dropped while using,prompt no device connect #10727

Closed ssshello closed 2 years ago

ssshello commented 2 years ago
Required Info
Camera Model d455
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version Ubuntu 18.04
Kernel Version (Linux Only) Linux tx2-nx 4.9.201-tegra
Platform NVIDIA Jetson tx2
SDK Version 2.50.0
Language python
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

I used an docker to build a container to use the camera, but the camera drops during use, and the camera device cannot be queried, but the host can recognize the device. image The situation is that it happens during the use process. It can be used normally in the docker at the beginning, and the disconnection occurs after a period of time. Running the python program directly in the host computer will also cause the camera to drop. It can be used normally at first, but after a period of time, it will prompt "No device connected", reboot does not work, reinserting the type-c header does not work, only reinserting usb plug to continue normal use.

MartyG-RealSense commented 2 years ago

Hi @ssshello It does not sound as though there is a problem with the camera hardware if it can run correctly for a period of time and can re-connect when reset with a USB unplug-replug when a connection drop occurs.

Does the camera's casing feel hot to the touch if you touch it a few minutes after you begin streaming from a cold start, please?

ssshello commented 2 years ago

Hi @ssshello It does not sound as though there is a problem with the camera hardware if it can run correctly for a period of time and can re-connect when reset with a USB unplug-replug when a connection drop occurs.

Does the camera's casing feel hot to the touch if you touch it a few minutes after you begin streaming from a cold start, please?

Hello, the camera feels a little hot to the touch after using it for a while, but is there a way to make the host re-read the camera device without re-inserting the usb? Is there any python code or shell script available? or something like that?

MartyG-RealSense commented 2 years ago

If the camera is taking a while to heat up instead of within the first few minutes then it is likely not experiencing overheating (which can occur due to a bad USB cable, a glitch on the USB port or overheating of a single-board computer that the camera is attached to).

A camera can be reset without an unplug-replug using the SDK instruction hardware_reset(). A simple Python example of code to initiate this is below:

ctx = rs.context()
devices = ctx.query_devices()
for dev in devices:
dev.hardware_reset()

If a specific camera in a set of multiple cameras needs to be reset then https://github.com/IntelRealSense/librealsense/issues/5428 describes how to perform this in Python using a camera serial number.

Another way to reset is to use a Linux bash script to reset the entire USB port instead of just the camera, like the script at https://github.com/IntelRealSense/librealsense/issues/8393

ssshello commented 2 years ago

If the camera is taking a while to heat up instead of within the first few minutes then it is likely not experiencing overheating (which can occur due to a bad USB cable, a glitch on the USB port or overheating of a single-board computer that the camera is attached to).

A camera can be reset without an unplug-replug using the SDK instruction hardware_reset(). A simple Python example of code to initiate this is below:

ctx = rs.context()
devices = ctx.query_devices()
for dev in devices:
dev.hardware_reset()

If a specific camera in a set of multiple cameras needs to be reset then #5428 describes how to perform this in Python using a camera serial number.

Another way to reset is to use a Linux bash script to reset the entire USB port instead of just the camera, like the script at #8393 hi,@MartyG-RealSense ,thanks for the reply Usually the result returned by query_devices() when the camera is offline is an empty list so hardware_reset() cannot be used, and the bash script in the referenced link doesn't seem to work for my device because calling the lspci command can't find the usb controller, I tried Similar commands such as: echo 2-2.3 > /sys/bus/usb/drivers/usb/unbind echo 2-2.3 > /sys/bus/usb/drivers/usb/bind But this method doesn't work Use the command ls /sys/bus/usb/drivers/usb/ to see the device number that exists in usb3, such as 2-2.x(the serial number type of the usb3 device on the industrial computer I am using), but the lsusb command cannot query the device The actual operation is to re-insert the camera so that lsusb can rediscover the camera. So I try to search for some bash command or code that can replace this operation.Because I think the camera is connected to the machine, but the machine does not re-read the camera device.

MartyG-RealSense commented 2 years ago

The SDK may sometimes experience issues on an industrial computer with a more exotic hardware / software configuration than a typical consumer PC. In that situation, building the SDK with the RSUSB backend = true installation method can resolve problems.

This is because an RSUSB-based build of the SDK bypasses the Linux kernel. It is therefore not dependent on Linux versions or kernel versions and does not require patching.

Instructions for installing the SDK from source code in RSUSB = true mode on Jetson can be found at https://github.com/IntelRealSense/librealsense/issues/6964#issuecomment-707501049


Having said that, the issues that you are experiencing seem more typical of an issue related to instability of power on the USB port than a kernel related glitch. Would it be possible to test the camera with a mains electricity powered USB hub if you have not done so already in order to help to eliminate a USB port power instability as the cause?

A camera that is connected directly to the computer's USB port will draw its power from the computer's power supply unit, whereas a powered USB hub delivers power more stably because its power comes from the mains power-point.

MartyG-RealSense commented 2 years ago

Hi @ssshello Do you require further assistance with this case, please? Thanks!

MartyG-RealSense commented 2 years ago

Case closed due to no further comments received.