Auto-Readout SNR levels from your Dreambox

This PHP script automatically lists all received SNR levels from the transponders of the current satellite. These are the results for my place in North Germany.

You need a connected Dreambox and the "services" file on your harddisc. And this is the script:
<?php
//by Peer-Axel Kroeske
//radiovibrations.com/dreambox/signals.htm
//last update: 17-05-2010

set_time_limit(120);

//change Path, IP and position here!!
$DreamboxIP='192.168.3.99';
$fs=fopen('c:/dreambox/edit/services','r');
$posx=192; //192=19.2 degrees East, -10=1.0 deg west

print'<body><pre>';

$polv[0]='H';$polv[1]='V';
$fecv=array('1/2','2/3','3/4','5/6','7/8');

while ($s!='end' and !feof($fs))
  {
  unset($s);unset($c);unset($pc);
  while ($c!=chr(10) and !feof($fs))
    {$c=fread($fs,1);$s.=$c;if ($c==':') {$pc++;}}
  $s=trim($s,chr(10)); 
  if ($pc==2) 
    {
	$nsp=substr($s,0,8);
	$tid=substr($s,9,4);
	$nid=substr($s,14,4);
	}
    elseif ($pc==5)
    {
	$xp=explode(':',$s);
	$frq=substr($xp[0],3,5);
	$syr=round($xp[1]/1000);
	while (strlen($syr)<5) {$syr=' '.$syr;} 
	$pol=$xp[2];
	$fec=$fecv[$xp[3]];
	$pos=$xp[4];
	if ($pos==$posx)
	  {
	  $zapto="http://root:dreambox@$DreamboxIP/cgi-bin/zapTo?path=1:0:1:9999:$tid:$nid:$nsp:0:0:0:";
      $f1=@fopen($zapto,'r');
      usleep(800000);
      $f1=fopen("http://root:dreambox@$DreamboxIP/satFinder",'r');
      $s1=fread($f1,500);
      $p=strpos($s1,'SNR');
      $snr=substr($s1,$p+32,3);
      trim($snr,'<');
      if ($snr[0]<'5') {$snr='---';}
      $pos10=floor($pos/10);
      while (strlen($pos10)<2) {$pos10=' '.$pos10;}
//      print"<br>$zapto";
      print"<br>$pos10° $frq$polv[$pol] $syr $snr $ids";
      fclose($f1);
	  }
	}
  }	
?>
</pre></body>

Radiovibrations.com -> Dreambox Notes