Ankündigung

Einklappen
Keine Ankündigung bisher.

EibLib/Ip & EibNet/IP

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Warichet
    antwortet
    Hi,

    I'm making some (very little) progress
    The command:
    eibd -d -D -S -T -i bcu1:/dev/tty
    does indeed start the daemon, as seen by:
    ps aux | grep eibd
    the command:
    groupswrite ip:127.0.0.1 0/1/31 1
    doesn't return an error anymore .... I get
    "Send request"
    but nothing happens.

    So, there is still a mistake in my setup, I guess it has to do with the eibd startup parameters.

    Anyone be so kind to post the command line about how to start eibd, with IP enabled on a BCU1.

    Thank you for any hint.

    Einen Kommentar schreiben:


  • jef2000
    antwortet
    Zitat von Warichet Beitrag anzeigen
    What would be the recommended parameters to start eibd ?

    I guess there is something wrong with my setup, as I'm unable to issue the command "groupswrite ip:127.0.0.1 0/1/31 1" (hence I draw the wrong conclusions).

    Thank you
    Hi

    You said:
    "Indeed, so far I can switch a lamp On/Off with the phone's TouchScreen."
    I assume you are able to do it with eibd... Ah, but perhaps you are using unix sockets intead of inet sockets...
    There are 2 different ways to access eibd with client library. If you start eibd with -u option, you are using unix sockets and must use commands like:
    groupswrite local:/tmp/eib 1/1/11 1
    to switch devices on/off.
    If you start eibd with -i option, you are using inet (aka tcp) sockets and must use commands like:
    groupswrite ip:127.0.0.1 1/1/11 1
    to switch devices on/off.

    I tried to write a couple of examples with the php interface to see how it works.
    groupswrite.php:
    PHP-Code:
    <?php
    require('eibclient.php');

    $con = new EIBConnection($argv[1]);
    $dest split('/'$argv[2]);
    $dest_addr = (($dest[0] & 0x01f) << 11) | (($dest[1] & 0x07) << 8) | (($dest[2] & 0xff));

    if (
    $con->EIBOpenT_Group ($dest_addr1) == -1)
        exit(
    "Connect failed");
    $data chr(0).chr(0x80 $argv[3]);
    printf($data);
    $len $con->EIBSendAPDU($data);
    if (
    $len == -1)
        exit(
    "Request failed");
    print(
    "Send request\n");

    $con->EIBClose();

    ?>
    To switch on group 1/1/11, start eibd with -i option and execute command:
    php groupswrite.php 127.0.0.1 1/1/11 1

    groupread.php:
    PHP-Code:
    <?php
    require('eibclient.php');

    $con = new EIBConnection($argv[1]);
    $dest split('/'$argv[2]);
    $dest_addr = (($dest[0] & 0x01f) << 11) | (($dest[1] & 0x07) << 8) | (($dest[2] & 0xff));

    if (
    $con->EIBOpenT_Group ($dest_addr0) == -1)
        exit(
    "Connect failed");
    $data chr(0).chr(0);
    $len $con->EIBSendAPDU($data);
    if (
    $len == -1)
        exit(
    "Request failed");
    print(
    "Send request\n");

            
    while (
    1)    {
            
    $data = new EIBBuffer();
            
    $src = new EIBAddr();
        
    $len $con->EIBGetAPDU_Src($data$src);
        if (
    $len == -1)
            exit(
    "Read failed");
        if (
    $len 2)
            exit(
    "Invalid Packet");
        
    $buf unpack("C*"$data->buffer);
        if (
    $buf[1] & 0x3 || ($buf[2] & 0xC0) == 0xC0) {
            
    printf("Error: Unknown APDU: %02X%02X\n"$buf[1], $buf[2]);
        }
        else if ((
    $buf[2] & 0xC0) == 0x40) {
            if (
    $len == 2) {
                
    printf ("%02X\n"$buf[2] & 0x3F);
            }
            else {
                for (
    $i=3$i<=$len$i++)
                                
    printf ("%02X"$buf[$i]);
                
    printf ("\n");
            }
            break;
        }
    }

    $con->EIBClose();

    ?>
    To get the actual value of group 1/1/11, start eibd with -i option and execute command:
    php groupread.php 127.0.0.1 1/1/11

    Best regards,

    Jean-François

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von jef2000 Beitrag anzeigen
    The only difference you will see is on the command line when you start eibd.
    What would be the recommended parameters to start eibd ?

    I guess there is something wrong with my setup, as I'm unable to issue the command "groupswrite ip:127.0.0.1 0/1/31 1" (hence I draw the wrong conclusions).

    Thank you

    Einen Kommentar schreiben:


  • jef2000
    antwortet
    Zitat von Warichet Beitrag anzeigen
    Pointing me to a piece of PHP code, with a practical example of the client library usage would be appreciated, especially the syntax of using a BCU1.
    So far, I've only found PHP samples making use of IP.
    That's what I'm saying. If you use the client library of EIBD, the syntax of the PHP code is the same. There is no difference wether you use BCU1 or EIBNet/IP. The only difference you will see is on the command line when you start eibd.

    For example, with eibd, you can use the command "groupswrite ip:127.0.0.1 0/1/31 1". The fact that your EIB bus is connected using a BCU1 serial interface, USB or EIBnet/IP interface makes no difference. The differences between different bus interfaces are hidden inside eibd and the client library used by groupswrite is independent of the bus interface you use.

    Jean-François

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von jef2000 Beitrag anzeigen
    I don't understand what the PHP code has to do with EIBlib or EIBNet.
    As such ? nothing !
    It's a personal choice. Not being a professional developper, I found it easier to learn than C.

    Zitat von jef2000 Beitrag anzeigen
    (available for C, java and PHP)
    Pointing me to a piece of PHP code, with a practical example of the client library usage would be appreciated, especially the syntax of using a BCU1.
    So far, I've only found PHP samples making use of IP.

    Einen Kommentar schreiben:


  • jef2000
    antwortet
    Zitat von Warichet Beitrag anzeigen
    But in order to have a decent Visu, I need to develop some PHP code on the eibd server.
    So far, I've only found PHP code for the EibNet protocol.
    Hi,

    I don't understand what the PHP code has to do with EIBlib or EIBNet.
    The advantage of eibd is to be able to access the bus using the eibd client library (available for C, java and PHP), whatever bus connection type is used (serial, usb, EIBnet/IP tunneling or routing, tpuart).

    I never used the PHP version of the client library, but it looks like a PHP mapping of the C client library.

    Regards,

    Jean-François

    Einen Kommentar schreiben:


  • makki
    antwortet
    @Matthias: EIBnet/IP als "Server".
    Also eine zusätzliche Option, die - genau wie die iETS-Funktion auch - anderen IP-Geräten den Buszugriff über den HS ermöglicht. Nur eben mit EIBnet/IP (Routing) statt EIBlib/IP.

    Das macht natürlich nur Sinn wenn der HS selbst z.B. mit einer FT1.2 an den Bus angebunden ist, damit man keinen zusätzlichen IP-Router á la N146 und keine weitere BCU für (z.B.) den eibd benötigt.

    Wie aufwändig das ist, k.A., aber das Protokoll ist ja "clientseitig" schon im HS implementiert.

    Das mit dem Laien nehm ich Dir aber nicht ab

    Makki

    Einen Kommentar schreiben:


  • MatthiasS
    antwortet
    @makki
    Kannst du mir als Laien mal in einfachen Worten erklären (in ganz einfachen bitte), was der HS lernen muss, damit Warichets Anforderunegn erfüllt werden können? Das erschließt sich mir überhaupt nicht.

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von makki Beitrag anzeigen
    - use the KO-Gateway of HS
    - i.e. use the "4 Werte aus/in XML" Baustein as "Interface"
    No, thanks

    Zitat von makki Beitrag anzeigen
    I'll further dig on using eibd with IP-Routing enabled as Interface for the HS sometime, as it should theoretically work.
    It would be nice if you could share your findings

    Zitat von makki Beitrag anzeigen
    as we're probably two out of 5 people asking for this at all, I would understand if this won't make it on the Top10-asked features for the HS
    Oh well, one dummy could save the bunch
    Also, some projet managers do have a visionary approach (as opposed to just bug fixing). They are able to identify the market needs, years ahead .....

    One day, IP will rule the world (might not be be v4)

    Einen Kommentar schreiben:


  • makki
    antwortet
    Warichet, I was struggling around with exactly the same, maybe the reason I can follow you

    Anyway, indeed the following options are left:
    - use the KO-Gateway of HS
    - i.e. use the "4 Werte aus/in XML" Baustein as "Interface"
    Probably not what I'd call the most clever way (specific to HS, inflexible and hard to code)

    So left is indeed buying a separate IP-Router (N148 etc.) or get a TP-UART interface for the eibd. Its ~50 EUR and really works like a charm, also gives an independent bus-access and at least a "basic" IP-Router.
    I'll further dig on using eibd with IP-Routing enabled as Interface for the HS sometime, as it should theoretically work. In real life my first tests failed as mentioned with scan-errors, the remainder worked during my tests (1 day)..

    Edit: and as we're probably two out of 5 people asking for this at all, I would understand if this won't make it on the Top10-asked features for the HS

    Makki

    Einen Kommentar schreiben:


  • Chris M.
    antwortet
    Zitat von Warichet Beitrag anzeigen
    But in order to have a decent Visu, I need to develop some PHP code on the eibd server.
    You could use linknx and knxweb. No PHP programming required for a normal Visu IIRC. (And special XML stuff can be done by using only the XML protocol of linknx and the usual XML transformations)
    Zitat von Warichet Beitrag anzeigen
    I thought the HS could fullfill the function of IP gateway for all other IP devices (which is my understanding of a gateway).
    It turns out that my expectations are wrong
    That's my understanding as well.

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von MatthiasS Beitrag anzeigen
    So, the missing "server", what is it good for?
    Sorry, I should have been more explicit.

    My reasoning is based on Makki's reply
    HS can use KNXnet/IP Routing to access the bus, but it does not provide an KNXnet/IP Server for other IP-devices.
    Let me elaborate a bit.
    I'm busy with a project where I want to use a Cisco phone (VoIP) as a KNX Visu. I need a way (primitives and API) to read/write to the bus, and I thought eibd would do it. Indeed, so far I can switch a lamp On/Off with the phone's TouchScreen.
    But in order to have a decent Visu, I need to develop some PHP code on the eibd server.
    So far, I've only found PHP code for the EibNet protocol.
    I thought the HS could fullfill the function of IP gateway for all other IP devices (which is my understanding of a gateway).
    It turns out that my expectations are wrong, hence I either
    • drop the project
    • buy a N148


    Please note that I'm a newbee in the field of KNX programming. So it might very well be that one of my base assumptions is wrong, in which case, bardaff

    Pssst: a Visu in each room ? with a TouchScreen ? any taker ?

    Einen Kommentar schreiben:


  • MatthiasS
    antwortet
    Zitat von Warichet Beitrag anzeigen
    In such case, it wouldn't be needed for HS owners to buy yet another IP interface (N148 163€ ).
    Sorry, i do not understand. With my HS I can use ETS for programming KNX devices and at the same time the hs does its own work. With just ONE interface.

    So, the missing "server", what is it good for?

    Einen Kommentar schreiben:


  • Warichet
    antwortet
    Zitat von makki Beitrag anzeigen
    HS can use KNXnet/IP Routing to access the bus, but it does not provide an KNXnet/IP Server for other IP-devices.
    Aah, the missing link !
    So far, I've seen serious contradictions in several posts, about this topic.
    All clear now, thank you.

    If I get you right, we only miss the Server part of KNXnet/IP on the HS.
    Wouldn't that be a good idea for our friends of DaCom , to put it on their "to do list" (I mean .... on top of the list , and push that QC in a black hole )
    In such case, it wouldn't be needed for HS owners to buy yet another IP interface (N148 163€ ) but rather make the HS a valuable investment

    I'm sure you guessed the question is still in the context of the Cisco/eibd project mentionned here (yes, I'm a bit of a "hard neck" )
    Now, it all boils down to a "no go"
    A pitty. So far I'm able to switch a lamp On/off from the phone, but to make a decent application I need some primitives. The only php samples I've found are about EibNet/IP.

    Einen Kommentar schreiben:


  • makki
    antwortet
    Correct, HS can use KNXnet/IP Routing to access the bus, but it does not provide an KNXnet/IP Server for other IP-devices.

    In any case (independently which Interface the HS uses for bus-access) it provides an EIBLib/IP Server which can be used with with ETS3 to access the bus.

    ETS 3.0f now also supports KNXnet/IP Routing to access the bus, previous versions only support KNXnet/IP Tunneling or EIBLib/IP.
    Means an IP-Router might be shared by i.e. ETS30f,HS,eibd.

    Finally, EIBNet/IP = KNXnet/IP and iETS is AFAIK only another wording for using an EIBLib/IP Server to access the Bus with ETS..


    Makki

    Einen Kommentar schreiben:

Lädt...
X