Security camera - Yooru6/Urbanfarmlab GitHub Wiki
Step-by-Step guide to make remote security camera from raspberry pi and usb-camera by using motion library.
Making new user enabling Wifi connection
- Download raspberry pi imager from https://www.raspberrypi.org/software/ to your computer and install it
- Install Raspberry Pi OS Lite on memorycard with imager
- Start up your raspberry pi device and run commands:
- "sudo passwd root" | enable root user
- "logout" | logout from username pi
- login with root user
- "usermod -l newname pi" | renames username pi. you can replace "newname" part with desired username.
- "usermod -m -d /home/newname newname" | changes name of home directory to reflect new username.
- "logout" | logout from the root user
- login with newname
- "passwd" | change new password for newname for security reasons
- "sudo raspi-config" | enter configure mode
- Choose "System Options" and after that "Wireless LAN"
- Choose your country and enter your network information:
- SSID = name of network
- passphrase = password
- Finish and reboot
Updating raspberry pi and installing Motion library
- "sudo apt-get update" | update system
- "sudo apt-get upgrade" | upgrade system | This might take a while
- "sudo systemctl enable ssh" | enables ssh service
- "sudo systemctl start ssh" | starts ssh service
- After restart you pi
- Install motion library by running command:
- "sudo apt-get install motion"
- Configure motion(you can use cntrl+ w to search):
- "sudo nano /etc/motion/motion.conf" | opens motion configure file -> Now you need changes values in file to respond values in below:
- Daemon on
- Framerate 5
- Stream_quality 80
- Stream_localhost off
- Webcontrol_localhost off
- Quality 80
- Width & height 1080x720
- post_capture 5
- "sudo nano /etc/motion/motion.conf" | opens motion configure file -> Now you need changes values in file to respond values in below:
- hold cntrl+x and save changes
- "sudo nano /etc/default/motion" | opens other configure file | Set:
- start_motion_daemon yes
- hold ctrl+x and save changes
- "sudo service motion restart" | restarts motion
Now you can connect to your security camera with browser http://IP-ADDRESS:8081