⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reame.txt

📁 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without ev
💻 TXT
字号:
--------------------------------------------------------------------------------Copyright (c) 2003, Tony CureingtonThis is Free Software with ABSOLUTELY NO WARRANTY. You are welcome toredistribute it under the terms of the GNU General Public License, see thefile COPYING for details.--------------------------------------------------------------------------------Waldo V1.0Table of Contents=================What is Waldo?Parts UsedSoftware UsedInstalling & Configuring WaldoConfiguration File ChangesServo ConnectionsDownloading Board FirmwareConnecting the CameraUp and RunningGetting HelpWhat is Waldo?--------------This example was used at LinuxWorld (New York 2003) as part of anHP ProLiant Gigabit network teaming demonstration using the Linux Bondingdriver.This is an end-to-end example using a DeVaSys I2C/IO (www.devasys.com/usbi2cio.htm) board. The USB board controls two servos, one for horizontal movement and the other for vertical movement. A web interface allows horizontal, vertical, and diagonal camera movement - remotely. Thats right, the USB board and camera can be connected to a machine at another location and be controlled remotely. All the source code is there for you to review and modify.You can find step-by-step pictures of how the device was built athttp://ezusb2131.sourceforge.net/waldo.html.Parts Used----------     DeVaSys I2C/IO USB board     Lego MindStorms Vision Command     Lego Creator set (model 4120)     JB Weld epoxy     SuperLock (velcro) (Radio Shack Cat# 64-2360)     Crochet needle (aluminum size US:7)     Two Futaba FP-S148 servos     Five volt power supply (to power servos)and of course a static strap.Software Used-------------The software below must be installed on your system before continuing.Refer to each packages documentation for instructions. Specific changesto configuration files will be provided later in this document.     Apache v2.0.40     Camserv v0.5.1, http://cserv.sourceforge.net     QuickCam Express v0.40c, http://qce-ga.sourceforge.net     SDCC v2.3.0, http://sdcc.sourceforge.net     And of course Ezusb2131 v1.0, http://ezusb2131.sourceforge.net     Mozilla, v5.0     Mozilla is required for the web interface, Netscape will not work - or atleast the version I had didn't because it didn't support "mouse up". A distribution with a 2.4.18 kernel was used.Installing & Configuring Waldo------------------------------Download the Ezusb2131 source from http://ezusb2131.sourceforge.net.Extract it in your home directory (all steps below will assume thesource has been extracted in your home directory).      cp /usr/local/share/camserv/camserv.cfg ~/.camserv     cd ~/Ezusb2131/Examples/Waldo     make     ln -s ~/Ezusb2131/Examples/Waldo/Gui ~/public_html You may want to adjust the permissions below depending on secure/privateyou want to keep your directory from others...     chmod go+x ~/.     chmod go+x ~/Ezusb2131     chmod go+x ~/Ezusb2131/Examples     chmod go+x ~/Ezusb2131/Examples/Waldo     chmod go+rx ~/Ezusb2131/Examples/Waldo/Gui     chmod go+r  ~/Ezusb2131/Examples/Waldo/Gui/index.php     chmod go+r  ~/Ezusb2131/Examples/Waldo/Gui/cam_box.png     chmod go+rx ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin     chmod ugo+rx ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/move_cam.plIf Perl is not located at /usr/bin/perl, you must change the locationin ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/move_cam.pl.The cam_control program must be able to write to /proc/bus/usb, soset the set user ID bit to allow this.     su     chown root   ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control     chmod 4711   ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control     exitConfiguration File Changes--------------------------Changes were made to the following files, your httpd.conf may be differentdepending on your distribution.     ~/Ezusb2131/Examples/Waldo/Gui/index.php     /etc/httpd/conf/httpd.conf     ~/.camservIn ~/Ezusb2131/Examples/Waldo/Gui/index.php change "flux" to the nameof the machine the camera is attached to. This could be "localhost"if you are running everything locally - otherwise it must be themachine name the camera is connected to.I made the following changes in /etc/httpd/conf/httpd.conf,     change          ServerName localhost     to          ServerName flux     where "flux" is the name of your machine     change          UserDir disable     to          UserDir public_html     find the "#<Directory /home/*/public_html>" config segment and      add the following lines after the commented section          <Directory /home/*/public_html>              AllowOverride FileInfo AuthConfig Limit              Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI              <Limit GET POST OPTIONS>                  Order allow,deny                  Allow from all              </Limit>              <LimitExcept GET POST OPTIONS>                  Order deny,allow                  Deny from all              </LimitExcept>          </Directory>     find the "DirectoryIndex" config segment and add the following     line after the commented section          DirectoryIndex index.php index.html index.html.var     find the "AddHandler" config segment and add the following lines     after the commented section          AddHandler cgi-script .cgi          AddHandler cgi-script .plI made the following changes in ~/.camserv,     change          device_path   /dev/video1     to          device_path   /dev/video0     change          quality               30     to          quality               80     change          num_filters           2          filter0_section       time_stamp          filter1_section       jpg_filter     to          num_filters           1          filter0_section       jpg_filter     change          video_section         video_basic     to          video_section         video_v4l_qcamServo Connections-----------------The PB3 port controls the horizontal servo and PB4 controls thevertical servo. Pin 1 of J1 is used as a common ground for theservos. Refer to http://ezusb2131.sourceforge.net/images/waldo_side.jpgand http://ezusb2131.sourceforge.net/images/waldo_complete.jpg forgood connection references. Futaba FP-S148 servos were used.Downloading Board Firmware--------------------------Download the ~/Ezusb2131/Examples/Waldo/cam_control_fw.ihx to theattached EZ-USB board. Refer to the ~/Ezusb2131/README file forinstructions on loading the ezusb2131 driver and downloading thefirmware.After the firmware is loaded issue the following command to getinformation from the board:     ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control -iYou should get something like:     :     X_Coord = 0     Y_Coord = 0     X_Coord_Final = 0     Y_Coord_Final = 0This info is from the board, you should notice the Status LED blinkwhen you run this command (if using DeVaSys board). If you don't get the info above, make sure that the cam_control program is owned by root and has permissions like the following (set user ID):     1831678 -rwsr-xr-x    1 root     tony    25242 Feb 18 00:38 cam_controlIf that checks out, look at the last few lines in /var/log/messagesto see if the board was downloaded. You should see something like:     ezusb2131: found ezusb venid 0x547, prodid 0x2131 interface_num:0     ezusb2131: ready for download from /proc/ezusb/dev0     /etc/hotplug/usb.agent: Setup ezusb2131 for USB product 547/2131/4     ezusb2131: download started for /proc/ezusb/dev0     ezusb2131: downloaded 5005 bytes to /proc/ezusb/dev0, re-enumerating     usb.c: USB disconnect on device 12     ezusb2131: /proc/ezusb/dev0 disconnected     hub.c: USB new device connect on bus1/1/1, assigned device number 13     usb.c: USB device 13 (vend/prod 0x547/0xcccc) is not claimed by any      active driver.     /etc/hotplug/usb.agent: ... no modules for USB product 547/cccc/1The product 547/cccc is Waldo (CamControl), it won't be claimed byany driver.You can move the camera using cam_control from the command line as follows     ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control -y 10     ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control -x -15     ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control -c     ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control -iThe above is a good way to debug and track down problems in the setup. Let me repeat that, the above is a good way to debug and track down problems in the setup. ;-)Connecting the Camera---------------------Here is what I did to get the camera (QuickCam Express) going.Download Quickcam Express from http://qce-ga.sourceforge.net andextract the source.The makefile expects /usr/src/linux to point to the current kernelsource. if /usr/src/linux does not exist, create a link as shownbelow.   su   ln -s /usr/src/linux-2.4 /usr/src/linux   exitBuild and install the QuickCam Express Driver per the instructionsin the README that comes with the driver. NOTE: the "make install" may give a "depmod" error, that is OK just      run it from the command line "/sbin/depmod -a" as root.Run the script to load the driver ./quickcam.sh. You'll probablywant to put this in a startup script, or you'll need to run itby hand every time the machine is rebooted.     su     ./quickcam.sh     exitNow attach USB camera and you should see the following messages in/var/log/message - I usually start another window and, as root,enter "tail -f /var/log/messages" to see what is going on.     Linux video capture interface: v1.00     usb-uhci.c: $Revision: 1.1 $ time 22:59:22 Feb 11 2003     usb-uhci.c: High bandwidth mode enabled     usb-uhci.c: v1.275:USB Universal Host Controller Interface driver     uhci.c: USB Universal Host Controller Interface driver v1.1     usb.c: registered new driver quickcam     hub.c: USB new device connect on bus1/2/4, assigned device number 7     USB Quickcam Class ff SubClass ff idVendor 46d idProduct 840     USB Quickcam camera found using: $Id: quickcam.c,v                   1.102 2002/03/25 22:22:34 jfclere Exp $     quickcam: probe of HDCS1000 sensor = 08 02 id: 08     quickcam: HDCS1000 sensor detected     /etc/hotplug/usb.agent: ... no modules for USB product 46d/840/100     quickcam: warning -> frame overflow (21)Up and Running--------------Start httpd, or restart it if it is already running     su     /etc/init.d/httpd restart     exitNOTE: You will need to start httpd each time you reboot if it is not      configured to start automatically.NOTE: If you remove ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control      (or run "make clean"), you will need to change the owner to root       and set the user ID bit as previously done using:           su           chown root   ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control           chmod 4711   ~/Ezusb2131/Examples/Waldo/Gui/cgi-bin/cam_control           exitBring up Mozilla     mozilla &In the URL box type http://localhost/~your_usr_id, where localhost isthe name of your machine and your_user_id is your user id. For example,I would enter http://flux/~tonycu on my machine to bring up the interface.Put the mouse pointer over a section of the box below the camera image, andpress the left mouse button down continuously (hold the mouse button down) to move in the direction. Press the upper right corner and the camera should move diagonally. Press the center (blue box) and the camera should move to the center location.The firmware limits the movement plus or minus twenty degrees vertical andplus or minus forty-five degrees horizontal. This can be changed in thecam_common.h header file - I put the limit there due to the lengthof the cables and weight of the camera.You should always return the camera to the center position before turningthe power to the servos off or re-downloading the board, otherwise the servoswill snap the camera back to center when it is downloaded or powered up.Getting Help------------First go to http://sourceforge.net/mailarchive/forum.php?forum_id=9578and see if the question has been previously asked - and possiblyanswered.If you don't see a solution, go to http://lists.sourceforge.net/lists/listinfo/ezusb2131-usersand follow the steps for posting a question to the list. Toreduce spam, you must subscribe to the list first - you canalways un-subscribe after you've gotten your answer.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -