Note: This assumes you've already flashed an SD card. In this gist I used Jesse Stretch Lite.
-
After flashing the sd card, create and add a blank file named "ssh" to the /boot partition. This will turn on ssh when the Pi boots. Also create and add a file called "wpa_supplicant.conf" to the /boot partition as well. Configure the contents of the wpa_supplicant.conf file like this: {See This Gist}
-
Insert your sd card into the Pi and boot the Pi. From a remote machine find your Pi's IP address using a tool like Fing.
-
After logging in, run these commands:
$
sudo apt-get update
// update your apt repo$
sudo apt-get upgrade
// upgrade your pi$
sudo apt-get install git
// install git$
git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
// install PiCam software$
cd RPi_Cam_Web_Interface
//cd into the repo you just downloaded$
./install.sh
// install the PiCam software -
Complete the setup. When asked which subdirectory, the default is html, but you can use any name here you like. I shoce "camera". When asked to reboot choose "no".
-
Run: $
sudo raspi-config
and turn on the camera. While you're here you can change any other settings. -
Reboot.
-
Setup Motion:
Set motion to start as a daemon.
$ `sudo nano /etc/default/motion`
Change: start_motion_daemon=no
to start_motion_daemon=yes
and save.
set up a log folder somewhere where the "motion" user can write log files (because you'll likely get errors if the motion user tries to log files to /var/log/motion as is the default:
$ `cd` // change to your home directory
$ `sudo mkdir motion-logs` // make the motion logs directory
$ `sudo chown pi:motion motion-logs` // set pi as owner and motion as group
$ `sudo chmod -R 775 motion-logs` // make sure pi and motion can read/write/execute
-
Reboot
-
Use your web browser to brows to your PiCam interface, possibly http://192.168.0.x/camera and start motion detection. Note: If you are also ssh'd into the Pi you will likely see errors that Motion can't write to the log file.
-
In your browser interface, open motion settings and click "show all".
-
Change the motion log file path to folder you created in step 7 above. Likely: /home/pi/motion-logs
-
Save settings and restart the camera. You shouldn't get any errors writing logs and a new log file will appear in your logs directory.
This tutorial was created using the help of this Instructable made by FunguyPro.