Want to advertise here? Contact us!
by

Thank the author with a small contribution using PayPal.

0
Popularity: 372nd place
297 Views
3 Badges
Top 1% !
Popular
Specified
Created
Modified on Jun 30, 2013
This snippet is Public
None ... yet!
LanguageShell
SourceGithub

Setting up motion with a raspberry pi camera

Setting up motion with a raspberry pi camera: 
gistfile1.sh
post this code
<iframe id="embedFrame" style="width:600px; height:300px;" src="http://www.snip2code.com/Embed/2838/Setting-up-motion-with-a-raspberry-pi-ca"></iframe>
Click on the embed code to copy it into your clipboard Width:Height:
Leave empty to retrieve all the content First Line:Last Line:
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

If you want to be updated about similar snippets, Sign in and follow our Channels
Originally posted on https://gist.github.com/5893179