case "zero": commands += "DP 0,0;"; break;
case "anycommand": commands += val+";";break;
}
- commands += "PA?;PA,?;PR?;PR,?;";
+ commands += "PA?;PA,?;";
runcmd(commands);
}
<div class="position">Last Update:<br><span id="timestamp">--</span></div>
<h2 style="clear:both;">Move</h2>
+<img id="webcam" src="webcam.pl?-1">
<p>Enter value (in mm) and press Enter to execute command
<br><label title="rel X">rel X <input type="text" name="MoverelX" value="0" onkeypress="doenter(event,this)"></label>
<br><label title="rel Y">rel Y <input type="text" name="MoverelY" value="0" onkeypress="doenter(event,this)"></label>
<p>Run any other command
<br><label title="any command">Command <input type="text" name="anycommand" value="" onkeypress="doenter(event,this)" ></label>
<h2>Console</h2>
-<div id="errors"></div>
-</body>
+<div id="errors"></div></body>
+
+<script type="text/javascript">
+var i = 0;
+setInterval("document.getElementById('webcam').src = 'webcam.pl?'+i++",10000);
+setInterval("doit(document.getElementsByName('refresh')[0])",9000);
+setTimeout("doit(document.getElementsByName('refresh')[0])",500);
+</script>
--- /dev/null
+#!/usr/bin/perl
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTP-?i/i) {
+ &htsponse(200, "OK");
+ }
+
+print "Content-Type: image/jpeg;\r\n\r\n";
+
+system("fswebcam -F5 -d /dev/video1 -r 1280x720 --scale 844x475 --jpeg 80 '-' 2>/dev/null");
+return 1;