Raspberry Pi 4 Stereo Camera Headless Setup
A set of steps used to setup the Raspberry Pi 4 with the Arducam 5MP Camarray Hat (UC-512) in a headless manner using Pop!_OS-22.04.
Part A. Setup the Raspberry Pi
Step 1 : Get Raspberry Pi Imager from Pop Shop or through their website.
Step 2 : Choose the operating system and the storage.
Step 3 : Click on the gear icon (Advanced Options; can also be accessed by crtl+shift+x) and modify the following:
Step 4 : Write
Step 5 : Insert the memory card into the raspberry pi.
Part B. SSH into Raspberry Pi
Step 1 : Connect the computer and the raspberry pi to the same network.
Step 2 : Remove previously generated ssh keys: ssh-keygen -f "/home/rohan/.ssh/known_hosts" -R "raspberrypi.local"
Step 3 : SSh into the Raspberry Pi: ssh [email protected]
Step 4 : Type "yes", and enter the password
Step 5 : You should see this:
Part C. Configure the Raspberry Pi
This part takes quite some time.
Step 1 : sudo apt update && apt list --upgradable
Step 2 : sudo apt upgrade --fix-missing
Step 3 : sudo reboot
Step 4 : sudo rpi-update
Step 5 : sudo reboot
Step 6 : sudo raspi-config
Step 7 : Interface Options -> Toggle Legacy Camera, SSH, VNC, SPI, I2C
Part D: Install/ Modify packages
Step 1 : sudo apt-get update && apt list --upgradable
Step 2 : sudo apt-get install build-essential cmake pkg-config libjpeg-dev libtiff5-dev libjasper-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libfontconfig1-dev libcairo2-dev libgdk-pixbuf2.0-dev libpango1.0-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran libhdf5-dev libhdf5-serial-dev libhdf5-103 python3-pyqt5 python3-dev -y
Step 3 : pip3 install opencv-python
Step 4 : sudo apt install python3-opencv
Step 5 : sudo apt-get install libopencv-dev
Step 6 : sudo nano /boot/config.txt
Step 7 : Add line dtoverlay=arducam
at the end
Step 8 : sudo reboot
Step 9 : pip install -U numpy
Step 10 : pip install --upgrade pip
Step 11 : vcgencmd get_camera
should show detected = 1 (detected=0 means the camera is not detected).
Step 11 : raspistill -t 2000 -o image.jpg
Part E: Setup Remote Display
Step 1 : sudo apt update && apt list --upgradable
Step 2 : sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer -y
Step 3 : vncserver
Step 4 : Start VNCServer on your local machine.
Step 5 : Enter the IP address of the Raspberry Pi.
The stereo image should be saved in the /home/ folder.
References
- https://www.arducam.com/docs/cameras-for-raspberry-pi/synchronized-stereo-camera-hat/sync-stereo-camera-hat-user-manual/
- https://www.arducam.com/docs/cameras-for-raspberry-pi/synchronized-stereo-camera-hat/camarray-arducam-5mp-synchronized-stereo-camera-bundle-kit/
- https://www.arducam.com/docs/cameras-for-raspberry-pi/mipi-camera-modules/camera-userland-driver-sdk-and-examples/
- https://www.raspberrypi.com/documentation/accessories/camera.html#libcamera-and-libcamera-apps
- https://raspberrypi-guide.github.io/programming/install-opencv.html
- https://stackoverflow.com/questions/53347759/importerror-libcblas-so-3-cannot-open-shared-object-file-no-such-file-or-dire
- https://forums.raspberrypi.com/viewtopic.php?t=287068