User Manual

This section describes the new function: camera, since the RPi can be connected with a camera. If you
application do not need this function, please jump to the next section.
a﴿ Run the command raspi‐config to start up the camera before using it:
sudoraspi‐config
Then, select the option Enable Camera.
b﴿ For the camera with CSI interface, the system may be unable to find out the device under the directory
of /dev/video0. In this case, you should add a line, bcm2835‐v4l2, into the file /etc/modules.
sudonano/etc/modules
Add the line:
bcm2835‐v4l2
c﴿ After reboot, the system will load the module name stored in this file, and find out the device video0
under the directory of /dev. ﴾Please take a notice that the letter l in the command bcm2835‐v4l2 is the
lower case of L.﴿
d﴿ Install dependent libraries:
sudoapt‐getinstalllibv4l‐devlibjpeg8‐dev
sudoapt‐getinstallsubversion
e﴿ Compile the example:
cd~/RPi‐Motor‐Driver‐Board‐Demo‐Code/mjpg‐streamer/
makeUSE_LIBV4L2=trueclearall
During the make command running, you may see a warning: make: *** No rule to make target 'clear'. Stop.
This warning can be ignored.
f﴿ If there is any error occurred, you can try to modify the content of the file mjpg‐
streamer/plugins/input_uvc/input_uvc.c, changing V4L2_PIX_FMT_MJPEG to V4L2_PIX_FMT_YUYV
g﴿ Start up mjpg‐streamer:
sudo./start.sh
Then, open the browser, and enter the IP address of RPi and the port number: 8080 into the address bar.
﴾Notices: the port number here is 8080, other than 8000 what we used before.﴿ The website will show the
information about the M‐JPEG streamer. Click the option Stream, it will real‐time display the image
captured by the camera.