This document describes the steps to setting up a new RaspberryPi device for motion detect.
I have done this to monitor activity in the birdhouse we have hanging from the awning just outside our sunroom windows.
Links:
Parts:
There are a number of parts needed for this project:
Basic Setup:
The Raspberry Pi has no hard disk - the microSD memory card serves as the "disk drive" for the machine.
You are required to install the operating system on the microSD card using your own computer via the SD card slot, then insert it into the Raspberry Pi before powering up.
Software Installer
Raspberry Pi has created a software installer that runs on all platforms which allows you to install the Raspberry Pi operating system onto the microSD card.
- Download the appropriate "Raspberry Pi Imager" for your computer's OS from here.
- Run the software once you've downloaded it.
- Click "CHOOSE OS" to select which operating system you wish to use on your Raspberry Pi
- The default full operating system is a full-fledged Unix-like desktop operating system with a graphical user interface you can use with an HDMI TV and USB keyboard and mouse.
- For my purposes, I want the smallest operating system without any bells and whistles which would take processor power, so I selected the "Raspberry Pi OS Lite"
- Insert the microSD card into your computer's SD card slot
- Click "CHOOSE STORAGE" and select the microSD card device
- Click "WRITE" to write the operating system to the microSD card
- When it completes, close the Imager window and remove the microSD card
WiFi and SSH (headless) Setup:
You can configure your Raspberry Pi by connecting it to a TV. To do this, you will need a micro-HDMI-to-HDMI converter (to connect to the TV)
and a microUSB-to-USB-female cable (to connect a USB keyboard).
A simpler method is the "headless" setup, meaning you configure the Raspberry Pi to connect to your WiFi network before you even connect to it, described
here and
here - point 3.
- Place the microSD card back in your computer's SD card slot.
- You may see error messages saying the card's partition cannot be read - you can dismiss these messages.
- There is a "boot" partition on the microSD card and it IS read/writeable from your computer. Find this device in your file explorer.
- Create two files in the boot partition device:
- wpa_supplicant.conf
- This file tells the Raspberry Pi how to connect to your WiFi network. It should look like this ("CA" is for Canada"):
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CA
network={
ssid="wifi network name"
psk="wifi password"
key_mgmt=WPA-PSK
}
- ssh
- This file simply tells the Raspberry Pi to allow remote access via SSH. It can be empty.
- NOTE: This file will be deleted on startup, so it will only enable SSH connections on the FIRST powerup. You must be sure to enable SSH permanently during the first session (see below).
First Powerup:
The first time you power up the Raspberry Pi, you will know if the device works, if your operating system install to the microSD card worked,
and if your WiFi setup was correct.
Further, there is at least one step you MUST complete during the first power up session, namely enabling SSH connectivity.
- Insert the microSD card into the SD card slot of the Raspberry Pi
- Plug the Raspberry Pi into a microUSB cable that is connected to either your computer or a phone charger
- Wait a minute or two for the Raspberry Pi to boot up
- On your computer (on the same WiFi network), run "ping raspberrypi.local"
- If your Raspberry Pi has booted successfully, "raspberrypi.local" will translate to your Raspberry Pi's IP address, and ping will work.
- If this fails, wait a few minutes and try again
- Once your Raspberry Pi is responding to ping, connect to it via "ssh pi@raspberrypi.local"
- Passowrd: raspberry
- There are a few things you need to configure during this session. Run "sudo raspi-config"
- Enable SSH remote access (MUST be done before you reboot the device):
- Select "Interface Options"
- Select "SSH"
- Select "Yes", then "Ok"
- Change the hostname (if you have multiple Raspberry Pis on your network):
- Select "System Options"
- Select "Hostname"
- Enter a new hostname, like "raspberrypi2"
- Change the default password for the user "pi":
- Select "System Options"
- Select "Password"
- Select "Ok"
- Enter a new password twice (remember your new password!)
- Setup the camera:
- Select "Interface Options"
- Select "Camera"
- Select "Camera Enabled?"
- Select "Yes"
- Change the GPU memory size (or the camera may not be found):
- Select "Performance Options"
- Select "GPU memory"
- Set it to "256"
- Exit from the raspi-config menu system
- When asked "Reboot now?", select "Yes"