in
Creating Smarter Networks

Read values from iLON for web page (linux/apache/php server)

Last post 10-29-2008 6:17 AM by dev26. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-16-2008 5:17 AM

    • Jam-Rolf
    • Top 25 Contributor
    • Joined on 10-16-2008
    • Posts 2
    • Points 40

    Read values from iLON for web page (linux/apache/php server)

    Hello group,

    I'm very new to the world of building automation, open control products, iLON, SmartServer, etc.
    Currently we are looking into the possibility to read data from a SmartServer to display on a webpage running on some other server.
    What I understand so far is that it should be able to connect to the SmartServer and read "data" with the help of SOAP. Probably the data is returned in XML. Is this true? I saw some C# links.

    Normally we develop websites and applications based on PHP/MySQL/JavaScript/XHTML/Flash...
    I do not see any info with keywords like "ilon smartserver php".

    Any idea that what we are trying to code is not unusual? Maybe someone has any pointers where we can look (which pdf on de Echelon manual pdf for example).
    I dont think we'll use Contribute for this, because it's not a web page ON the iLON server..

    Thanks for any pointes/advice where we should start looking etc.

    Rolf
    NL

    • Post Points: 20
  • 10-16-2008 12:19 PM In reply to

    • rmhair
    • Top 10 Contributor
    • Joined on 12-14-2007
    • San Jose CA
    • Posts 13
    • Points 160

    Re: Read values from iLON for web page (linux/apache/php server)

     Hello Rolf,

     There are some PHP-SOAP (or google it) based resources out there, but I haven't tried them.

    We are currently working on building a python based interface using ZSI which is a SOAP/webservices library.  They have a tool called wsdl2py that builds the python software stubs for accessing the iLON100 SmartServer SOAP interface.  Actually using the stubs will require more programming.  

    We built a basic interface for version 1.0 of the iLON which worked well - 500K plus points collected over time from different iLON's...

    Good Luck,

    Richard

    • Post Points: 20
  • 10-17-2008 2:32 PM In reply to

    • Jam-Rolf
    • Top 25 Contributor
    • Joined on 10-16-2008
    • Posts 2
    • Points 40

    Re: Read values from iLON for web page (linux/apache/php server)

    Hi Richard,

    Thank you for your quick answer. Tonight I checked my MAMP installation on my Mac/OS X system. It had PHP-SOAP installed by default. We already decided to go with PHP-SOAP for first testing, as there are some others (NuSOAP, PEAR:SOAP), but PHP-SOAP is the fastest.

    I can connect to other SOAP web services with the methods available, so that's step 1.

    Now I wonder if there's some sort of "open" SmartServer somewhere for testing purposes. We do not have a test SmartServer at the company up & running, and I wondered if there's maybe some public available test-iLON (perhaps run by Echelon) on the web.. basically I'm looking for an url wih WSDL which I can use this weekend ;)

    Regards,
    Rolf

    Filed under: , , , ,
    • Post Points: 20
  • 10-29-2008 6:17 AM In reply to

    • dev26
    • Top 25 Contributor
    • Joined on 06-17-2008
    • Posts 6
    • Points 75

    Re: Read values from iLON for web page (linux/apache/php server)

    Hi

    here is an example how to connect to SmartServer from PHP:

    <?
    // we need to specify the 'location' because it points to 'localhost' in the WSDL
    $client = new SoapClient('http://ilon-address/WSDL/v4.0/iLON100.wsdl',
            array('location' => 'http://ilon-address/WSDL/iLON100.wsdl'));

    // read a DP, one can use any request from the 'i.LON SmartServer Programmer’s Reference' here
    $dp_data = $client->Read(new SoapVar(
            '<Read xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">'
            . '     <iLonItem>'
            . '             <Item>'
            . '                     <UCPTname>Net/LON/iLON App/Digital Input 1/nvoClsValue_1</UCPTname>'
            . '             </Item>'
            . '     </iLonItem>'
            . '</Read>',
            XSD_ANYXML)
    )

    // show the result
    echo $dp_data->iLonItem->Item->UCPTvalue->_;

    // the var_dump function can be used to examine properties of the response
    var_dump($dp_data);
    ?>

    Note: to not request the iLON100.wsdl and iLON100.xsd files each time they can be saved locally (in the same directory where the script is) and then used as

    $client = new SoapClient('iLON100.wsdl', array('location' => 'http://ilon-address/WSDL/iLON100.wsdl'));

    • Post Points: 5
Page 1 of 1 (4 items)
©2008 Echelon Corporation