Raspberry Pi Robot Logitech Camera Server – Part5

We are in part 6 of tutorial series of Building Raspberry Pi Line Follower Robot! If you want to jump back and forth or missed any of my previous tutorials – here is the consolidated list.

All Tutorials to Build IOT Raspberry Pi Robot

  1. Build Raspberry Pi Robot controlled by Internet – IOT Robot
  2. Setup Static IP Address on Raspberry Pi
  3. Installing Web Server on Raspberry Pi
  4. Controlling Raspberry Pi LED via internet
  5. Raspberry Pi LED controlled by Internet
  6. Build REST API using Python and Flask
  7. Raspberry Pi Robot Logitech Camera Server
  8. Create Web Dashboard for IOT Robot Control

Entire project Video Tutorial


Great progress! We have basic REST APIs also ready. Now, we also want to stream live video from Raspberry Pi Robot. I am going to plug Logitech C210 camera to the robot and use it for streaming. Let’s dig more!

I have below logitech c210 camera:

 

Here are the steps:

To begin, first update the Raspberry Pi so you’re running on the latest version.

sudo apt-get update
sudo apt-get upgrade

Next we need to install motion server.

sudo apt-get install motion

Now we should first check if the webcam is supported or not. Type below in terminal

lsusb

We should see the camera listed if it is compatible with Raspberry Pi.

Next is very important thing to configure motion:

sudo nano /etc/motion/motion.conf

Below is the configuration that we need to make:

  • daemon on
  • stream_localhost off
  • output_pictures off
  • ffmpeg_output_movies off
  • stream_maxrate 100 (This will allow for real-time streaming but requires more bandwidth & resources)
  • framerate 100 (This will allow for 100 frames to be captured per second allowing for smoother video)
  • width 640 (This changes the width of the image displayed)
  • height 480 (This changes the height of the image displayed)

We need to setup up the daemon, first we need to edit the motion file.

sudo nano /etc/default/motion

Find the following line and change it to the following:

start_motion_daemon=yes

Make sure the camera is connected and run the following line:

sudo service motion start

Now you should be able to check out the Webcam Stream at the IP address of our Pi so in your browser go to the following address:

http://192.168.1.100:8081

Now, you should see below output:

We can use Port Forwarding to configure and live stream over internet:

 

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *