Author Topic: WebSwitch 1216 - How to read relais status?  (Read 2585 times)

HB9ODP

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My RemoteRig
WebSwitch 1216 - How to read relais status?
« 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?
RRC V1, TS-480, KAM, MFJ Automatic Tuner, G5RV

ok1cdj

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: WebSwitch 1216 - How to read relais status?
« Reply #1 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