Remote Rig

RRC 1258 Support in English => General discussion forum => Topic started by: HB9ODP on 2010-06-11, 12:59:56

Title: WebSwitch 1216 - How to read relais status?
Post by: HB9ODP on 2010-06-11, 12:59:56
Hello, it's possible to read a string with an internal http page to know if the relais are ON or OFF?
Title: Re: WebSwitch 1216 - How to read relais status?
Post by: ok1cdj on 2010-07-09, 13:20:19
Hi, you can use PHP and parse html pages. I'm using this way to read Analog input for rotator position and calibration.
// file rotator.php
$kalibrace=-10; //calibration
$dom = new domDocument;
loadHTMLFile('http://10.20.0.202/adin.egi');
$tables=$dom->getElementsByTagName('table');
$rows = $tables->item(0)->getElementsByTagName('tr');
$i=0;
foreach ($rows as $row)
     {
      if($i==4){
      $cols = $row->getElementsByTagName('td');
      $poloha=$cols->item(1)->nodeValue;
      }
      $i++;
     }
echo $poloha+$kalibrace; // print antenna position


This way you can get any info from webswitch.

73 Ondra OK1CDJ