Dave's Web-Log

Aus Weimarnetz Wiki
Zur Navigation springen Zur Suche springen

kleine Gedankenstuetze

Vorlagen

Steuerbare-Webcam(logitech sphere) unter Win

  • Logisphere-Programm --> logisphere
    • easy to use programm
    • nicht ganz billig (20 Euros)
    • kostenlose Version mit Einschränkungen (Laufzeit 6 Stunden pro Tag)
    • Installation Windoofs typisch: next --> next --> Enter

Steuerbare-Webcam(logitech sphere) unter Linux(Ubuntu)

benötigte Programme / Dateien Befehle
gcc apt-get install gcc
make apt-get install make
module-assistant apt-get install module-assistant
pwc - Webcamdriver mit module-assistant in den Kernel kompilieren und installieren
apache2 apt-get install apache2
php4
  • in den apache nun noch php einbinden!
  • dann die php-module noch kopieren
apt-get install php5
  • in /etc/apache2.conf die zeile mit den.php Endungen, die Auskommentierung entfernen
  • cp /etc/apache2/mods-available/php4 /etc/apache2/mods-enable/php4
motion (mind.Version 3.2.1)
  • motion.conf bearbeiten
  • livecam.htm und control204.php anlegen
apt-get install motion
Cambozola Java-Applet runterladen und in /var/www kopieren Link --> Cambozola

Wie geht das von statten?

Als erstes mal die ganzen sachen installieren! Wenn schon die PWC-Driver für die kamera dabei sind, braucht ihr nicht noch die zu kompalieren. Dann kannst du ab dem apache2 anfangen zu installieren.

  • Lege unter /var/www eine neue Datei an die livecam.htm heisst.
 vi /var/www/livecam.htm 
  • Kopiere dir diesen Quelltext rein.

<html>
<head>
    <title>Webcam - Pan and Tilt</title>
</head>
<body text="#000000" bgcolor="#EEF0E0" link="#0000EE" vlink="#551A8B" alink="#FF0000">
    <center>
        <h2>Web Camera - Logitech Sphere - Pan and Tilt</h2>
        <applet code=com.charliemouse.cambozola.Viewer
            archive=cambozola.jar width=320 height=240>
            <param name=url value=http://Deine_IP_Adresse:8081>
        </applet>
    </center>
    <form name="pantilt" action="control204pt.php" method="post">
        <center>
            Click buttons below to rotate and tilt camera.<br>
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Pan Left ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" L5 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" L4 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" L3 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" L2 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" L1 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Center Pan">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" R1 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" R2 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" R3 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" R4 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" R5 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Pan Right"><br>
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Tilt Down">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" D5 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" D4 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" D3 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" D2 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" D1 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Center Tilt">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" U1 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" U2 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" U3 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" U4 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" U5 ">
            <INPUT TYPE=SUBMIT NAME="command" VALUE=" Tilt Up "><br>
            <INPUT TYPE=SUBMIT NAME="command" VALUE="Calibrate">
        </center>
    </form>
</body>
</html>

  • unter Deine_IP_Adresse müsst ihr natürlich eure IP eintragen
  • als nächstes legen wir die Steuerungsdatei an mit
 vi /var/www/control204pt.php 
  • und dann kopiere dir diesen Quelltext rein
<?
    Header("HTTP/1.0 204 No Content");

    $command = (IsSet($_REQUEST['command'])) ? $_REQUEST['command'] : "";

    switch ($command)
    {
        case " L5 ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=-200&tilt=0');
            break;
        case " L4 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=-60&y=1000');
            break;
        case " L3 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=-45&y=1000');
            break;
        case " L2 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=-30&y=1000');
            break;
        case " L1 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=-15&y=1000');
            break;
        case "Center Pan":
            readfile('http://username:password@localhost:8080/0/track/set?x=0&y=1000');
            break;
        case " R1 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=15&y=1000');
            break;
        case " R2 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=30&y=1000');
            break;
        case " R3 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=45&y=1000');
            break;
        case " R4 ":            
            readfile('http://username:password@localhost:8080/0/track/set?x=60&y=1000');
            break;
        case " R5 ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=200&tilt=0');
            break;
        case " U5 ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=0&tilt=100');
            break;
        case " U4 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=20');
            break;
        case " U3 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=15');
            break;
        case " U2 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=10');
            break;
        case " U1 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=5');
            break;
        case "Center Tilt":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=0');
            break;
        case " D1 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=-5');
            break;
        case " D2 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=-10');
            break;
        case " D3 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=-15');
            break;
        case " D4 ":
            readfile('http://username:password@localhost:8080/0/track/set?x=1000&y=-20');
            break;
        case " D5 ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=0&tilt=-100');
            break;
        case "Pan Left ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=-10&tilt=0');
            break;
        case "Pan Right":
            readfile('http://username:password@localhost:8080/0/track/set?pan=10&tilt=0');
            break;
        case " Tilt Up ":
            readfile('http://username:password@localhost:8080/0/track/set?pan=0&tilt=5');
            break;
        case "Tilt Down":
            readfile('http://username:password@localhost:8080/0/track/set?pan=0&tilt=-5');
            break;
        case "Calibrate":
            readfile('http://username:password@localhost:8080/0/config/set?text_left=CAMERA%20CALIBRATING%20POSITION');
            readfile('http://username:password@localhost:8080/0/detection/pause');
            readfile('http://username:password@localhost:8080/0/track/set?x=-69&y=24');
            sleep(5);
            readfile('http://username:password@localhost:8080/0/track/set?x=69&y=-29');
            sleep(3);
            readfile('http://username:password@localhost:8080/0/track/set?x=65&y=-5');
            sleep(2);
            readfile('http://username:password@localhost:8080/0/config/set?text_left=CAMERA');
            readfile('http://username:password@localhost:8080/0/detection/start');
        default:
            break;
    }
?>

  • danach noch die motion.conf datei bearbeiten (hier meine bsp.conf)
# Minimal motion example config file provided by the
# Debian motion package - for basic webcam operation.
#
# You most certainly want to investigate
# /usr/share/doc/motion/examples/motion-dist.conf.gz
# for further configuration options. Also, refer to the
# motion man page and /usr/share/doc/motion/motion_guide.html
# for detailed information on configuration options.

daemon off
quiet on

# You may very well need to change this (check with 'dmesg'
# after plugging in your webcam)
videodevice /dev/video0

# Image size in pixels (valid range is camera dependent)
width 320
height 240

framerate 2
quality 85
auto_brightness off

# Initial brightness, contrast, hue (NTSC), and saturation
# 0 = disabled (valid range 0-255)
brightness 0
contrast 0
saturation 0
hue 0

# Encode movies in real-time (install ffmpeg before enabling)
ffmpeg_cap_new off

# Target base directory for pictures and films
# You should probably change this (create dir beforehand)
target_dir /tmp
jpeg_filename bild

# Define a port number (e.g. 8000) to enable the mini-http server
# 0 = disabled
webcam_port 8081

# Set to 'off' to allow anybody (not just localhost) to view the
# webcam via the mini-http server (http://hostname:port)
webcam_localhost off

webcam_quality 50
webcam_maxrate 8

# Drivertyp der Steuerung
track_type 3

#Steuerungs-Port
control_port 8080

#Control html
control_html_output on

# user und pw
control_authentication

Webcam Geleit23.jpg

  • die Dateien stammen alle von Kenneth Lavrsen und wurden leicht modifiziert
  • viel spass!

rechner in 2 netze stellen

  • Bsp. mit 192er netz und 104er + 10er netz
  • eine 2. adresse für die Netwerkkarte (z.b. interface eth0) vergeben
ifconfig eth0:1 104.63.222.14 netmask 255.255.255.240 broadcast 104.63.222.15
  • jetzt noch dem rechner das andere Netz verraten, bzw. das es geroutet wird
route add -net 10.0.0.0/8 gw 104.63.222.1
route add -net 104.0.0.0/8 gw 104.63.222.1

MySQL installieren

  • mysqldateiname.tar.gz-datei von mysql-gmbh runterladen
  • befehle der reihenfolge nach ausfuehren
     
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip < kompletterpfadmitdateiname.tar.gz | tar xvf -
ln -s kompletterpfadmitdateinameohne.tar.gz mysql
cd mysql
scripts/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql data
chgrp -R mysql .
bin/mysqld_safe --user=mysql &
bin/mysql
show databases;
use mysql;
show tables;
describe user;
insert into user values('10.0.1.2','teilnehmer','','Y','Y','Y','Y','Y','N','N','N','N','N','N','N','N','Y');
insert into user values('\%','leser','','Y','N','N','N','N','N','N','N','N','N','N','N','N','N');
flush privileges;
  • noch ein hinweis wegen user anlegen
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h m18box password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

Aldi-Webcam Qtec Webcam 100 Pac207-BCA installieren

nachschauen was los ist :-) also in die console eintippen.

dmesg

da sollte dann so etwas rausgespuckt werden:

drivers/media/video/spca5xx/spca5xx-main.c: USB SPCA5XX camera found. Qtec Webcam 100 Pac207-BCA

als nächstes überprüfen wir noch die usb-meldung

lsusb

da sollte dann so etwas rausgespuckt werden:

ID 093a:2460 Pixart Imaging, Inc.

nun zum driver installieren: