-
11Step 11
-
12Step 12
Next we will install the MPEG-Streamer. Mpeg streamer is a one stop solution
to stream your camera video on internet (Credits: I referred this link to learn how to install it)Open a terminal window and type the following command
$sudo apt-get install libjpeg8-dev
Once the install is complete type
$sudo apt-get install imagemagick
Next we need to do a bit of configuration. In the terminal type the following with an ENTER/RETURN after every line.
$cd ~
$mkdir tmp
$cd tmp
$svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg... mjpg-streamer
$cd mjpg-streamer/mjpg-streamer
$make
After it compiles you can run mjpeg-streamer by typing the following command
$ cd /home/pi/code/mjpg-streamer
$ ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -p 8080 -w ./www"
If you want to now view the stream open a web browser type the below in the web browser "http://[host-name or IP-address of the Pi]:8080"
You will be able to see the mjpg-streamer on the webpage with a small window showing the picture from your pi's camera
It you want to directly see the video stream type the following url in your web-browser
"http://[host-name or IP-address of the Pi]:8080/?action=stream"
-
13Step 13
Step 3: Programming the Pi and MPEG-streamer interfacing
-
14Step 14
-
15Step 15
Next we will need to do a bit of programming for the Pi to interface smoothly between the Pi cam and the webpage. We will be passing some values to a python file from the PHP instructions to trigger the GPIO pins on the Pi (before you do this however, you will need to install WiringPi to make it work - please see the instructions to do this on their website).And I have used some part of this
http://hackaholic.info/raspberry-pi-controlling-led-over-network/
for the basic code development.
Once you have installed WiringPi all you need to do is place the below files
control.html
control.php
control.py
in the "/var/www/server/ " folder
Next you need to edit a line in the control.html file. Use nano to do this:
$sudo nano /var/www/server/control.html
Look for "img src" and edit it to:
img src= http://[Pi ip address]:8080/?action=stream
Then just open web browser on your computer and type the below in the url.
http://[host-name or IP-address of the Pi]/server/control.html
Now, if you already have the mjpeg-server running you should be able to see
the video stream on the webpageIf you are not able to see a video then open a terminal and type the following:
$ ./mjpg_streamer -i "./input_uvc.so" -o"./output_http.so -p 8080 -w ./www"
Now you should be able to see all the buttons and video on the webpage. If you trigger the front back left or right button the GPIOs will turn on/off.
-
16Step 16
Step 4: Hardware connections (Pi and Bridge Shield) to get your robot up and running:
-
17Step 17
-
18Step 18
-
19Step 19
We have used the bridge shield motor driver to connect to the raspberry pi instead of a separate motor driver. If you have a separate board or have made one then you can use pin numbers 4,17,22,23 from the raspberry pi GPIO header to connect to the motor driver pin numbers 2,7,15,10 .These connections have to be made as shown in pic
Finally, all of these have to be mounted onto a robot chassis (See picture to help you arrange the parts). Place the wifi dongle in the designated slot. Fix the bridge shield on the Pi and connect the two cell lithium ion battery to the bridge shield and your mechanical buddy is ready to roll!!
-
20Step 20
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.