Stereo hat wont put cameras on i2c bus

Published by Adam626 on

Home Forums Cameras Modules for Raspberry Pi Multi-Camera and Sync Stereo Camera HAT Stereo hat wont put cameras on i2c bus

  • This topic has 3 replies, 2 voices, and was last updated 1 month ago by bin.
Viewing 3 reply threads
  • Author
    Posts
    • #23529
      Adam626
      Participant

      Hi.

      I recently purchased a 5mp stereo hat. I connect it to my rpi4 and run a raspistill command and it appears to work fine. Cool.

      So I navigate to the stereo_depth_demo to emulate the coolness I saw on the web.

      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1 python3 1_test.py
      Open camera…
      Error: Could not open file /dev/i2c-0' or/dev/i2c/0′: No such file or directory
      I2C check functionality fail.
      init_camera: Unexpected result.

      Ok, that tells me the cameras aren’t on the i2c bus. So I check.

      [email protected]:~/MIPI_Camera/RPI/stereo_depth_demo $ sudo i2cdetect -y 1
      0 1 2 3 4 5 6 7 8 9 a b c d e f
      00: — — — — — — — — — — — — —
      10: — — — — — — — — — — — — — — — —
      20: — — — — — — — — — — — — — — — —
      30: — — — — — — — — — — — — — — — —
      40: — — — — — — — — — — — — — — — —
      50: — — — — — — — — — — — — — — — —
      60: — — — — — — — — — — — — — — — —
      70: — — — — — — — —

      Sure enough, no devices.

      So here is what I’ve done to ensure the issue isn’t on my end.

      1) I read through the read me and installed the wiringpi-latest.deb since I’m on a pi-4. Same result as above.

      2) I disconnect and reconnect both camera cables as well as the pi camera cable. Same result as above.

      3) I made my own connector as I don’t want the stereo hat on top of the pi. I removed my connector and disassembled my case and put the stereo hat directly on top of the pi and used the stereo hat connector directly. Same result as above.

      4) I connected some other i2c device to my pi in order to validate the i2c bus works. It shows up and functions just fine.

      Not sure what a next step would be? Please help.

      I did notice that the error printed says it is looking for i2c-0, which is what it would be looking for on an older pi model. I am running a pi-4, which is i2c-1. Is the error text just misleading? Can I set which bus I want? Where?

      Thanks in advance for your time and assistance.

    • #23543
      bin
      Keymaster

      Hello, You should open the /boot/config.txt file and add dtparam=i2c_vc=on to use the i2c0 bus.

    • #23546
      Adam626
      Participant

      Excellent. That worked. Thank you. I saw that in the manual, but assumed the line was meant for older versions of pis and I needed to enable the raspberry pi4’s master i2c. Since I thought I had enabled the only pi-4 i2c bus, it didn’t occur to me to add that line. My bad. Again, thank you for the help.

    • #23555
      bin
      Keymaster

      Hello,

      Great to hear you have solved your problems.

      Let me know if you need more help.

       

Viewing 3 reply threads
  • You must be logged in to reply to this topic.