Skip to content

Instantly share code, notes, and snippets.

@jgarber
Last active December 19, 2015 03:49
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgarber/5893179 to your computer and use it in GitHub Desktop.
Save jgarber/5893179 to your computer and use it in GitHub Desktop.
Setting up motion with a raspberry pi camera
ssh-copy-id pi@192.168.X.X
# on the pi
sudo su -
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="Your SSID Here"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
psk="YourPresharedKeyHere"
}
EOF
vi /etc/wpa_supplicant/wpa_supplicant.conf
apt-get update
apt-get upgrade
apt-get install ca-certificates git-core
wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
chmod +x /usr/bin/rpi-update
rpi-update
ldconfig
rpi-update
reboot
raspi-config # Expand the fs, enable the camera
sudo su -
mkdir motion
cd motion
wget https://www.dropbox.com/s/xdfcxm5hu71s97d/motion-mmal.tar.gz
tar -zxvf motion-mmal.tar.gz
apt-get install -y libjpeg62 libjpeg62-dev libavformat53 libavformat-dev libavcodec53 libavcodec-dev libavutil51 libavutil-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev
./motion -n -c motion-mmalcam.conf
# When it works...
apt-get install motion
cp motion to /usr/bin/motion
rm -rf /etc/motion
cp motion-mmalcam.conf /etc/motion.conf
# Configure it with the right permissions and directories
echo "disable_camera_led=1" >> /boot/config.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment