Skip to main content

Configuring the Raspberry Pi with the USB camera

1

Install motion package

Run the following command:
sudo apt-get install motion
2

Check motion service status

Execute the command:
sudo service motion status
3

Create required directories

If you encounter an error about missing Motion folders, create them:
sudo mkdir /var/log/motion
sudo mkdir /var/lib/motion
Verify the folders were created:
ls -ld /var/log/motion
ls -ld /var/lib/motion
4

Set permissions

Grant necessary permissions:
sudo chmod -R 777 /var/log/motion
sudo chmod -R 777 /var/lib/motion
5

Recheck motion service status

Run the command again:
sudo service motion status
If you still encounter an “access denied” error, repeat the chmod commands from Step 4.
6

Backup and edit motion configuration

Make a backup of the configuration file:
sudo cp /etc/motion/motion.conf /etc/motion/motion.conf.bckp
Edit the configuration file:
sudo nano /etc/motion/motion.conf
7

Start motion service

Start the service and check its status:
sudo service motion start
sudo service motion status
8

Edit motion log (if enabled)

If enabled, edit the motion log:
sudo nano ~/.motion/motion.log
Modify the following parameters:

Camera Feed Examples

Camera Setup

Live feed from camera

Live Feed 1

Live feed from camera

Live Feed 2

Live feed from camera