This script initializes a camera preview on boot for a Raspberry Pi 4B with a connected camera module. It is designed to work with a clean Raspberry Pi OS Lite installation on an SD card. Follow the steps below to configure the camera preview:
-
Prepare Your Raspberry Pi:
- Install the Raspberry Pi Imager
- In the imager, begin with a clean Raspberry Pi OS Lite 64-bit installation to an SD card.
- Plug in your camera module and SD card to the Pi, then boot up the Pi.
- When prompted, setup the keyboard configuration to US-EN and set
pi
as the default username
-
Install Git:
-
Since Raspberry Pi OS Lite does NOT include Git by default, install it manually:
sudo apt install git
-
-
Clone the Git Repository:
-
Open a terminal on your Raspberry Pi.
-
Clone this git repository using the following command:
git clone https://github.com/bryantb2/Pi-Camera-Preview.git
-
-
Run the Setup Script:
-
Navigate to the cloned repository:
cd Pi-Camera-Preview
-
Make the setup script executable:
chmod +x setup.sh
-
Execute the setup script:
./setup.sh
The script will install the necessary packages, configure the camera startup behavior, and set the Pi into "kiosk mode," preventing users from tampering with the configuration. Once the setup completes, the device will reboot and the live camera feed will appear!
-
Note: Ensure that you have a basic understanding of the Raspberry Pi and its setup before proceeding with these steps.