Webcam and servo motor installation guide

Webcam and servo motor installation guide
Webcam and servo motor installation guide By Group MK2J, Fall 2014 CMPT 433 Environment pre­conditions ­ BeagleBone Black running version 3.8.13­bone68 ­ BeagleBone Black must have connected internet access to download the open source libraries ­ ie) Via Ethernet to Router Webcam how-to-setup
1.Building x264:
Install the following libraries for webcam: # git clone git:// # cd x264 # ./configure ­­enable­shared ­­prefix=/usr # make # make install 2.Building ffmpeg:
# git clone git:// # ./configure ­­enable­shared ­­enable­libx264 ­­enable­gpl # git remote set­url origin git:// # make # make install 3.Fixing library problem:
# vi /etc/ add “/usr/local/lib” to the file and then type: # ldconfig 4.v4l2-ctl libraries setup:
# sudo apt­get install v4l­utils 5. Install the imagemagick
# sudo apt­get install imagemagick 6.Run the script
After the library installed and set­up, In /Webcam_part/ folder, run the shell script and it will automatically start taking frames in the background. # cd Webcam_part/ # ./ The script is available for saving the frames for recording purpose. The build script is to make the compiled c code. 7.Run the server
After the webcam setup is finished, Go to /webServer_part/, and run “nodejs server.js” to start the server. After this, you can go to url of (ip_addr):3001 to view the webpage of our security system. # cd webServer_part/ # nodejs server.js Controlling Servo with BeagleBone Black 1.Equipment:
BeagleBone Black Pan/Tilt bracket 2x Micro servo Male to Male jumper wires 2.Connecting the Servos
1. Connect the ground wire to P9 pin 1 2. Connect the positive wire to P9 pin 3 3. Connect the PWM wire to P9 pin 14 ●
Refer to the “Cape Expansion Headers” image below if more than one servo is used Note that the ground wire is usually black or brown and the PWM wire is usually orange or yellow 3.Setting up the PWM pin
1. Backup the current Linux bootfile # cd /boot/uboot # cp uEnv.txt uEnv.bak 2. Edit uEnv.txt # nano uEnv.txt ● add the following line into the uEnv.txt
optargs=quiet drm.debug=7 capemgr.enable_partno=am33xx_pwm,bone_pwm_P9_14 ●
we could also manually do this by using the following commands(Will need to do it every reboot): # echo am33xx_pwm > /sys/devices/bone_capemgr.@/slots # echo bone_pwm_P9_14 > /sys/devices/bone_capemgr.@/slots ●
Note that the value for the @ sign is different for each user
4.Controlling the Servos
1. Initialize servo # cd /sys/devices/ocp.3/pwm_test_P9_14.@ # echo 0 > run # echo 0 > polarity # echo 20000000 > period # echo 1000000 > duty # echo 1 > run ●
Note that the value for the @ sign is different for each user 3. Move servo # echo 2000000 > duty 4. Turn off servo # echo 0 > run Troubleshooting
1. When trying to manually control the servo motor via CLI command in the user
space, it does not move!
- There is a minimum and maximum limit for the duty at which the servo motor
can move to.
If the number for the duty is currently set higher than the maximum limit
(2400000), or lower than (600000), then it does not move. (This applies to both
left/right, up/down)
Try setting the duty to be within the range of 600000 and 2400000
2. When we have the frames being taken in “.ppm” format, we spend a lot of
time converting the pictures formats so that we can pass it by and
display them on webpage.
image from:http://rabbit­­black­power­meter­hard/ 
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF