Email: pacolinux arroba inicia punto es
Web: http://aldarias.es/pacodebian
Con Linux Debian. En Valencia (España)
Este documento es de libre reproducción siempre que se cite su fuente.
Realizado con: LATEX
Bajarse el fichero :
http://alpha.dyndns.org/ov511/download/2.xx/distros/ov511-2.21.tar.bz2
Aquí están todos las versiones:
http://alpha.dyndns.org/ov511/download.html
# lspci 00:00.0 Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev 04) 00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 1b) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586/B/686A/B PIPC Bus Master IDE (rev 06) 00:07.2 USB Controller: VIA Technologies, Inc. USB (rev 0e) 00:07.3 USB Controller: VIA Technologies, Inc. USB (rev 0e) 00:07.4 Host bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 20) 00:08.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo Banshee (rev 03) 00:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) 00:0a.0 Multimedia audio controller: Ensoniq 5880 AudioPCI (rev 02) 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
Como se puede ver detecta los usb, y son VIA Technologies
En USB support: <*> Support for USB [*] USB verbose debug messages [*] Preliminary USB device filesystem <M> UHCI Alternate Driver (JE) support <M> OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support <M> USB Audio support <M> USB OV511 Camera support <M> USB Philips Cameras
Contenido de .config
# cat /usr/src/linux-2.4.20/.config | grep USB CONFIG_USB=y CONFIG_USB_DEBUG=y CONFIG_USB_DEVICEFS=y CONFIG_USB_UHCI_ALT=m CONFIG_USB_OHCI=m CONFIG_USB_AUDIO=m CONFIG_USB_OV511=m CONFIG_USB_PWC=m
En Multimedia devices: <M> Video For Linux En Video For Linux ---> [*] V4L information in proc filesystem
Contenido de .config
#cat /usr/src/linux-2.4.20/.config | grep VIDEO CONFIG_VIDEO_DEV=m CONFIG_VIDEO_PROC_FS=y CONFIG_VIDEO_SELECT=y
En Character Devices - I2C support ---> <*> I2C support <M> I2C device interface <M> I2C /proc interface (required for hardware sensors)
Contenido de .config
cat /usr/src/linux-2.4.20/.config | grep CONFIG_I2C CONFIG_I2C=y CONFIG_I2C_CHARDEV=m CONFIG_I2C_PROC=m
En nuestro caso hemos elegido en el kernel q queremos módulos para trabajar con la cámara.
# lsmod Module Size Used by Not tainted uhci 25264 0 (unused) ovfx2 27444 0 (unused) pwc 40968 0 (unused) ovsensor 14376 1 ov511 81592 0 videodev 5728 1 [ovfx2 pwc ov511]
# dmesg | grep usb usb.c: registered new driver usbdevfs usb.c: registered new driver hub usb.c: registered new driver ov511 usb.c: registered new driver Philips webcam usb.c: registered new driver ovfx2 usb.c: new USB bus registered, assigned bus number 1 usb.c: kmalloc IF c68af3c0, numif 1 usb.c: new device strings: Mfr=0, Product=2, SerialNumber=1 usb.c: USB device number 1 default language ID 0x0 usb.c: hub driver claimed interface c68af3c0 usb.c: kusbd: /sbin/hotplug add 1 usb.c: kusbd policy returned 0xfffffffe usb.c: new USB bus registered, assigned bus number 2 usb.c: kmalloc IF c68af5a0, numif 1 usb.c: new device strings: Mfr=0, Product=2, SerialNumber=1 usb.c: USB device number 1 default language ID 0x0 usb.c: hub driver claimed interface c68af5a0 usb.c: kusbd: /sbin/hotplug add 1 usb.c: kusbd policy returned 0xfffffffe usb.c: kmalloc IF c68afa60, numif 1 usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0 usb.c: USB device number 2 default language ID 0x409 ov511.c: Device at usb-00:07.2-2 registered to minor 0 usb.c: ov511 driver claimed interface c68afa60 usb.c: kusbd: /sbin/hotplug add 2 usb.c: kusbd policy returned 0xfffffffe
# dmesg | grep video Linux video capture interface: v1.00 ov511.c: USB OV518 video device found
dmesg | grep cam ovsensor.c: v2.21 : OV camera chip I2C driver pwc Philips PCA645/646 + PCVC675/680/690 + PCVC730/740/750 webcam module version 8.6 loaded. pwc Also supports the Askey VC010, Logitech Quickcam 3000 Pro, Samsung MPC-C10 and MPC-C30, usb.c: registered new driver Philips webcam
cat /proc/bus/usb/devices T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI-alt Root Hub S: SerialNumber=d800 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI-alt Root Hub S: SerialNumber=d400 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=05a9 ProdID=0518 Rev= 1.01 S: Manufacturer=OmniVision Technologies, Inc. S: Product=USB Camera C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 0 Alt= 1 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 129 Ivl=1ms I: If#= 0 Alt= 2 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 257 Ivl=1ms I: If#= 0 Alt= 3 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 385 Ivl=1ms I: If#= 0 Alt= 4 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 513 Ivl=1ms I: If#= 0 Alt= 5 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 641 Ivl=1ms I: If#= 0 Alt= 6 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 769 Ivl=1ms I: If#= 0 Alt= 7 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511 E: Ad=81(I) Atr=01(Isoc) MxPS= 897 Ivl=1ms
#cat /proc/bus/usb/drivers usbdevfs hub ov511 Philips webcam ovfx2
Si no existe crealo con:
mknod /dev/video0 c 81 0
# ll /dev/video0 crw-rw---- 1 paco paco 81, 0 2003-02-12 02:40 /dev/video0
Deberemos especificar manualmente el dispositivo, /dev/video0 cuando uses tus aplicaciones de video
Es recomendable hacer este enlace:
ln -s /dev/video0 /dev/video
ll /dev/video lrwxrwxrwx 1 root root 6 2003-02-12 02:40 /dev/video -> video0
Puedes dar privilegios con :
chmod 666 /dev/video0
Dar privilegios a tu usuario para usar la cámara:
Como root añadimos tu usario al grupo video:
adduser usuario video
none /proc/bus/usb usbdevfs defaults,rw,auto 0 0
modprobe videodev modprobe ov511 modprobe ovfx2 modprobe uhci modprobe ovsensor
Como usuario:
xawtv
modprobe -r uhci
# cat cam.sh #! /bin/bash case "$1" in start) insmod videodev insmod ov511 insmod ovfx2 insmod uhci insmod ovsensor ;; stop) rmmod -r -s videodev rmmod -r -s ov511 rmmod -r -s ovfx2 rmmod -r -s uhci rmmod -r -s ovsensor ;; *) echo "Uso: cam.sh start|stop" exit 1 ;; esac
$ xawtv -hwscan This is xawtv-3.82, running on Linux/i586 (2.4.20) dlopen failed for /usr/lib/libquicktime/lqt_vorbis.so: libvorbisenc.so.0: no se puede abrir el fichero del objeto compartido: No existe el fichero o el directoriolooking for available devicesport 83-83 type : Xvideo, image scaler name : 3dfx Video Overlay /dev/video0: OK [ -device /dev/video0 ] type : v4l name : OV518 USB Camera flags: capture
Se entiende q tenermos un servidor ftp y web ya funcionando.
Debemos crear en la carpeta del usuario el fichero:
nano .webcamrc
[grab] device = /dev/video0 text = "webcam linux %Y-%m-%d %H:%M:%S" infofile = filename #fg_red = 255 #fg_green = 255 #fg_blue = 255 #width = 320 #height = 240 delay = 0 wait = 0 #input = composite1 norm = pal rotate = 0 top = 0 left = 0 bottom = -1 right = -1 quality = 75 trigger = 0 once = 1 [ftp] host = mi_ip user = "mi_usuario" pass = "mi_password" dir = public_html/webcam file = webcam.jpeg tmp = uploading.jpeg passive = 1 debug = 0 auto = 0 local = 0 ssh = 0
Este script permite hacer una foto cada x segundos y guardalos en luna carpeta para luego poderse ver con el servidor web.
Debemos crear en la carpeta del usuario paco el fichero:
nano webcam.sh
#!/bin/sh # Por Paco Aldarias # 31-3-03 # Echo Script para webcam # Crea la carpeta del dia actual # Copia cada $1 (parametros de entrada) la imagen en la carpeta del dia d1=public_html/webcam d2=$d1/$(date +%d-%m-%Y) mkdir $d2 while : do d3=$d2/$(date +%d-%m-%Y-%k-%M).jpeg echo copiando $d1/webcam.jpeg en $d3 cp $d1/webcam.jpeg $d3 webcam sleep $1 done
Le damos permisos de ejecución:
chmod 700 webcam
Asi se llama:
./webcam.sh 120
Podremos ver el resultado asi:
http://localhost/~paco/webcam/webcam.jpeg
Instalarlo:
apt-get install motion
Versión actual:
motion 3.0.4-2 V4L Capture Program supporting Movement Dete
Uso:
motion -t public_html/motion/ -a 300
Esto crea dentro de la carpeta:
$HOME/public_html/motion/el video cada 300 segundos comprueba si hay cambios para generarar una imagen..
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html webcam -split 0 -local_icons 1 -show_section_numbers -no_auto_link -no_navigation
The translation was initiated by on 2004-07-22