Skip to content

Instantly share code, notes, and snippets.

@Albirew
Created April 4, 2019 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Albirew/a27b10ae5ef2c307b87fce0cbbe93573 to your computer and use it in GitHub Desktop.
Save Albirew/a27b10ae5ef2c307b87fce0cbbe93573 to your computer and use it in GitHub Desktop.
Simple D-Link DCS-5020L camera web control
<?php
$camIP="172.16.3.14";
$camUser="admin";
$camPass="";
?>
<!DOCTYPE html>
<html>
<head>
<title>D-Link DCS-5020L cam control for <?php echo($camIP); ?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css" title="design">
th,h1 {
border: 3px dashed green;
border-left: 1ex solid green;
margin-right:30ex;
text-transform: uppercase;
}
tr {width:33%;}
button {
width: 5ex;
height: 5ex;
text-align: center;
cursor: pointer;
border: 1px solid #ddd;
}
.angle {background-color: #aaa;}
</style>
<script language="JavaScript">
function refreshIt() {
if (!document.images) return;
document.images['cam'].src = "http://<?php echo($camUser.':'.$camPass.'@'.$camIP); ?>/image/jpeg.cgi?" + Math.random();
setTimeout("refreshIt()",400);
}
</script>
</head>
<body onLoad="setTimeout('refreshIt()',1000)">
<h1>D-Link DCS-5020L camera control for <?php echo($camIP); ?></h1>
<div style="width:75%;text-align:center; float:right;">
<img src="http://<?php echo($camUser.':'.$camPass.'@'.$camIP); ?>/image/jpeg.cgi" title="" name="cam">
</div>
<div style="margin:10ex 10ex auto 10ex; padding: 2ex;">
<form name="PanTiltSingleMove" action="http://<?php echo($camUser.':'.$camPass.'@'.$camIP); ?>/pantiltcontrol.cgi" method="POST">
<input type="hidden" name="PanSingleMoveDegree" value="5">
<input type="hidden" name="TiltSingleMoveDegree" value="5">
<table>
<tr>
<td><button type="submit" name="PanTiltSingleMove" value="0" class="angle">↖</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="1">↑</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="2" class="angle">↗</button></td>
</tr><tr>
<td><button type="submit" name="PanTiltSingleMove" value="3">←</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="4" class="angle">⌂</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="5">→</button></td>
</tr><tr>
<td><button type="submit" name="PanTiltSingleMove" value="6" class="angle">↙</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="7">↓</button></td>
<td><button type="submit" name="PanTiltSingleMove" value="8" class="angle">↘</button></td>
</tr>
</table>
</form>
<div style="margin-top:2ex;">
<!-- IR CONTROL NOT WORKING, TRYING TO FIND ANOThER WAY...
<form name="setDaynightMode" action="http://<?php echo($camUser.':'.$camPass.'@'.$camIP); ?>/setControlDayNight" method="POST">-/->
<form name="setDaynightMode" action="http://<?php echo($camUser.':'.$camPass.'@'.$camIP); ?>/setDaynightMode" method="POST">
<input type="hidden" name="ReplySuccessPage" value="night.htm">
<input type="hidden" name="ReplyErrorPage" value="errrnight.htm">
<input type="hidden" name="ConfigDayNightMode" value="Save">
<button type="submit" name="DayNightMode" value="3">IR on</button>
<button type="submit" name="DayNightMode" value="2">IR off</button><br>
<button type="submit" name="DayNightMode" value="0" style="width: 10.5ex;">IR default</button>
</form>-->
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment