View my account

Intel RealSense D415 - Troubleshoot when several other serial devices are connected to rpi4

Comments

8 comments

  • MartyX Grover

    Hi Gabriel Brito  May I ask some initial questions, please.

    -  Is the problem occurring when the camera is inserted into a USB port and is detected by the Pi 4, or does it only occur when a script accesses the camera?

    -  Do the affected serial communication devices use IR signals?

    0
    Comment actions Permalink
  • Gabriel Brito
    1. If I only use the camera with rpi4, the camera works fine
    2.  If I only use the other sensors that communicate using serial protocol with rpi4, the sensors work fine.
    3. If I connect everything to rpi4 (camera + sensors) but only run the script that communicates with the sensors, the sensors work fine.
      The problem is now:
    4.  If I connect everything to rpi4 (camera + sensors) but run the script that communicates with the sensors + camera (using a different thread), everything stops working.

    PS: one of the sensors that communicate via serial protocol is a SONAR sensor, so I believe it uses an IR signal. Other devices are telemetry devices, analog sensors with serial communication, etc...

    0
    Comment actions Permalink
  • MartyX Grover

    Thanks very much for the information.  I asked about IR devices because RealSense 400 Series cameras can interfere with nearby non-RealSense infrared devices during use, though the 400 Series camera does not experience interference in return from those non-RealSense infrared devices.

    The IR Emitter of the camera (which is a separate component from the infrared sensor) can be disabled.  Doing so may reduce the detail of the depth image, though if the scene that the camera is in has strong lighting then the camera can use the ambient light in the scene instead to analyze surfaces for depth detail.

    Are the sensors and camera all being controlled from the same script, please?

    0
    Comment actions Permalink
  • Gabriel Brito

    The same script is communicating with the various sensors via the serial protocol (each device on a different serial port) and in that same script the camera is being initialized (which I think is creating a new thread).

    If I comment out a line of code that initializes the camera, the sensors work correctly. If I use that line of code, everything crashes because the camera code must be trying to interact with all the serial ports, making all the communications shut-down.

    As I understood the camera code does not specify a serial port. He runs all the serial ports looking for the camera. How can I solve this? I still think it does this all the time, because I tried to put the camera on serial port 0 and its initialization code right at the start, to ensure that after the first scan of all serial ports, I could start communicating with the others sensors, but that didn't work either.

    0
    Comment actions Permalink
  • MartyX Grover

    Does the problem still occur if you test one sensor at a time (commenting the others out) when the RealSense camera is enabled to see whether the problem is occurring with all serial devices or just one particular one?

    0
    Comment actions Permalink
  • Gabriel Brito

    all the serial devices works together when  the camera is not enabled. The problem here is that the camera APIs are scanning all the serial ports to find the camera, making the comunication with the devices crash. There is any way to define which serial port the camera are conected too, making sure that API will not scan all the serial ports?

    0
    Comment actions Permalink
  • MartyX Grover

    I am not familiar with how the Pi handles serial ports, so I apologize.  If you want to set up a static serial port for each device, is the information in the links below useful for that?

    https://www.raspberrypi.org/forums/viewtopic.php?t=300068

     

    https://www.freva.com/2019/06/20/assign-fixed-usb-port-names-to-your-raspberry-pi/

    0
    Comment actions Permalink
  • MartyX Grover

    This discussion is continued on the case posted on the RealSense GitHub forum at the link below.

    https://github.com/IntelRealSense/librealsense/issues/9413

    0
    Comment actions Permalink

Please sign in to leave a comment.