Fig. 1: Image of the webcam connected to the Beaglebone Black
The webcam is required for image capture and video streaming applications. You can interface web cam with Beaglebone Black and capture photos and videos as well. In this tutorial I will interface the Logitech web camera with BBB. I explained step by step the configuration of the web cam interface with BBB. Before connecting the webcam, I will explain about Beaglebone Black VNC remote connection. If you get SSH access from BBB, it will not display image or video due to insufficient GUI. So you need to have virtual remote access from BBB on the desktop.
Fig. 2: Security camera prototype based on Beaglebone Black
BBB VNC Remote Access on Desktop
Step 1: Connect to the Internet and turn on BBB. Access BBB with SSH via PC.
Fig.3: Screenshot of accessing Beaglebone Black (BBB) with SSH via PC
Step 2: First of all, update your kernel version. (Ignore if already done)
Step 3: Once the update is complete, restart your system.
Step 4: We need to install a VNC server (i.e. x11VNC) on BBB by typing the following command:
sudo apt-get install x11vnc
Step 5: We need the VNC viewer on the desktop for remote access from BBB. Open another command prompt and install the VNC viewer (here I installed vinegar) by following the command:
sudo apt-get install vinegar
Step 6: Now go back to the command prompt that has SSH access from BBB and start the VNC server by typing the following command:
x11vnc -auth /var/run/lightdm/root/:0 -forever
Figure 4: Screenshot of Linux console root login on Beaglebone Black
It will start on port 5900.
Step 7: Go back to your local desktop command prompt (which was opened earlier to install vinegar) and run the following command:
vinegar 192.168.7.2::5900
Figure 5: Screenshot of Desktop Command Prompt on PC
You now have remote access to Beaglebone black on your local desktop. You can open the tool's command prompt and operate the same way as on the desktop.
Figure 6: Linux Screenshot on Beaglebone Black (BBB)
Webcam configuration on BBB
Step 1: Now, disconnect the power cable from the BBB. Plug the web cam (i.e. Logitech in this tutorial) into the USB port and turn the BBB back on. Access BBB with SSH via PC.
Step 2: Remotely access the Beaglebone black as explained above. Open the command prompt on the BBB desktop.
Fig. 7: Screenshot of webcam configuration on Beaglebone Black
Step 3: Check whether the web cam is detected by BBB or not by entering the following command
ls /dev/video0
Step 4: Now, to capture the image or video, install an image viewer (i.e. guvcview) on BBB using the following line:
sudo apt-get install guvcview
Figure 8: Screenshot of Guvcview installation on Beaglebone Black
Step 5: After installation, run the following command in the terminal:
guvcview
Figure 9: Screenshot of the Command Terminal on the PC
Step 6: Now your webcam is ready to capture images and videos.
Fig. 10: Screenshot of image captured on PC by Beaglebone Black-based security camera
Circuit diagrams
Circuit-Diagram-Beaglebone-Black-Security-Camera_0 |