Ankündigung

Einklappen
Keine Ankündigung bisher.

OpenWRT - EIBD - Linknx - PHP

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

    Zitat von Goahead Beitrag anzeigen
    root@OpenWrt:~# ls -l /dev/tty*
    crw-r--r-- 1 root root 5, 0 Jan 1 01:00 /dev/tty
    crw-r--r-- 1 root root 4, 64 Jan 1 01:00 /dev/ttyS0
    crw-r--r-- 1 root root 4, 65 Jan 1 01:00 /dev/ttyS1

    root@OpenWrt:~# eibd -u ft12:/dev/ttyS0 -t1023
    Layer 1(004DC688,386D43C2) Open
    Layer 1(004DC688,386D43C2) Opened
    Layer 2(004ECA18,386D43C2) Open
    Layer 2(004ECA18,386D43C2) Opened
    Layer 3(004FCD48,386D43C2) Open
    Layer 2(004ECA18,386D43C2) OpenL2
    Layer 1(004DC688,386D43C2) SendReset
    Layer 1(004DC688,386D43C2) Send(007): A9 1E 12 34 56 78 9A
    Layer 0(004DC688,386D43C2) Send(004): 10 40 40 16
    Layer 1(004DC688,386D43C2) Send(007): A9 00 18 34 56 78 0A
    Layer 0(004DC688,386D43C2) Recv(003): 40 40 16
    Layer 0(004DC688,386D43C2) Send(004): 10 40 40 16
    Layer 0(004DC688,386D43C2) Recv(003): 40 40 16
    Layer 0(004DC688,386D43C2) Send(004): 10 40 40 16
    Layer 0(004DC688,386D43C2) Recv(004): 40 40 40 16
    Layer 0(004DC688,386D43C2) Recv(015): 0A 0A 42 75 73 79 42 6F 78 20 76 31 2E 34 2E
    Layer 0(004DC688,386D43C2) Recv(018): 32 20 28 32 30 30 37 2D 30 35 2D 31 34 20 32 31 3A 35
    Layer 0(004DC688,386D43C2) Recv(017): 30 3A 35 32 20 43 45 53 54 29 20 42 75 69 6C 74 2D
    I suppose that you have put the wire between RX and TX for this test.
    If it's the case, it confirms that the port is /dev/ttyS0 and that we can send and receive through it.
    I was expecting to receive exactly what we have sent, but the last 3 "Recv(...):" lines contain something else. I converted the hex data of these three lines, and got "BusyBox v1.4.2 (2007-05-14 21:50:52 CEST) Built-...". This is a console message. Because the serial port is by default connected to a console to allow people to connect it to a PC (with hyperterminal for example) and see the messages when the system is booting. Here is seems that EIBD and the console are both using the serial port at the same time and they end up talking to each other.
    The serial console is started by a line in /etc/inittab file that looks like this:
    tts/0::askfirst:/bin/ash --login
    You'll have to remove it or comment it by putting a # at the beginning of the line.
    Once you removed it, restart the router and try again (be careful, doing something wrong there could block completely the router, ask first if you're not sure)

    Zitat von Goahead Beitrag anzeigen
    root@OpenWrt:/# knxswrite ip:127.0.0.1 1/1/1 0
    Open failed: Connection refused

    So...it cant acess to Loopback!! or EIBD is not running!
    Yes EIBD is not running or at least not running with network sockets.
    If you want to access eibd with "knxswrite ip:127.0.0.1 1/1/1 0", you must start eibd with -i option instead of -u to enable network sockets instead of unix sockets.

    When you start EIBD without the -d option (e.g. "eibd -u ft12:/dev/ttyS0 -t1023"), it will display the log messages, but EIBD will stop when you do <ctrl>-C. To have EIBD running, you can start it in one command window, and open another command window to start knxswrite in parallel. Or you can start eibd with -d option, but then you don't see the messages.
    To check if EIBD is running, you can do "ps ax | grep eibd" and see if there is a line corresponding to it.

    Zitat von Goahead Beitrag anzeigen
    Like i said..i want to connect trought internet somewhere at work, connecting to my Asus router (cable provider) at home, that is also connected to Dlink DSL router (ADSL is not connected) by switch ports that have EIBD and www page inside that Dlink router.


    What should i check then..EIBD is not running..right?
    That should be possible, but we have to do it in the right order. First focus on eibd. When it's running, we'll look at linknx, then the web server, PHP and finally remote connection via internet.

    Another question, how did you connect the serial port to the bus coupler (5wg1 114-2AB02)?


    Regards,

    Jean-François

    Kommentar


      Zitat von jef2000 Beitrag anzeigen
      I suppose that you have put the wire between RX and TX for this test.
      If it's the case, it confirms that the port is /dev/ttyS0 and that we can send and receive through it.
      I was expecting to receive exactly what we have sent, but the last 3 "Recv(...):" lines contain something else. I converted the hex data of these three lines, and got "BusyBox v1.4.2 (2007-05-14 21:50:52 CEST) Built-...". This is a console message. Because the serial port is by default connected to a console to allow people to connect it to a PC (with hyperterminal for example) and see the messages when the system is booting.
      Yes i connected TX with RX
      Log was bigger but i cut the text...
      Meanwhile it stops after some seconds sending and receiving and i have to kill it with crtl+c

      Here is seems that EIBD and the console are both using the serial port at the same time and they end up talking to each other.
      The serial console is started by a line in /etc/inittab file that looks like this:
      tts/0::askfirst:/bin/ash --login
      You'll have to remove it or comment it by putting a # at the beginning of the line.
      Once you removed it, restart the router and try again (be careful, doing something wrong there could block completely the router, ask first if you're not sure)
      Correct i can acess router with hyperterminal (SSH)
      Ill correct this.


      Yes EIBD is not running or at least not running with network sockets.
      If you want to access eibd with "knxswrite ip:127.0.0.1 1/1/1 0", you must start eibd with -i option instead of -u to enable network sockets instead of unix sockets.

      When you start EIBD without the -d option (e.g. "eibd -u ft12:/dev/ttyS0 -t1023"), it will display the log messages, but EIBD will stop when you do <ctrl>-C. To have EIBD running, you can start it in one command window, and open another command window to start knxswrite in parallel. Or you can start eibd with -d option, but then you don't see the messages.
      To check if EIBD is running, you can do "ps ax | grep eibd" and see if there is a line corresponding to it.
      Ill check it at home..dont have router here
      If its not running or not in the list..then how do i enable it on startup?

      That should be possible, but we have to do it in the right order. First focus on eibd. When it's running, we'll look at linknx, then the web server, PHP and finally remote connection via internet.

      Another question, how did you connect the serial port to the bus coupler (5wg1 114-2AB02)?
      Maybe ill use your suggested schematic
      http://ouaye.net/linknx/bcu-interfac...-interface.png
      Or maybe the one with some resistors that i think is in this thread..

      Do you have another sugestion to connect UART do Busankoppler?


      Regards
      Goahead

      Kommentar


        Zitat von Goahead Beitrag anzeigen
        Ill check it at home..dont have router here
        If its not running or not in the list..then how do i enable it on startup?
        If you have the script /etc/init.d/S70linknx , eibd will be started automatically ( change /dev/tts/0 to /dev/ttyS0 ).
        But as long as it's not fully working, it's better to open a shell on the router, start eibd manually with "eibd -i ft12:/dev/ttyS0 -t1023", and let it run in its own window, then open a second shell on the router and try "knxswrite ip:127.0.0.1 1/1/1 0" on it.

        Zitat von Goahead Beitrag anzeigen
        Maybe ill use your suggested schematic
        http://ouaye.net/linknx/bcu-interfac...-interface.png
        Or maybe the one with some resistors that i think is in this thread..

        Do you have another sugestion to connect UART do Busankoppler?
        The resistor interface from this thread is fine. My interface with optocouplers is better for paranoids like me.

        Regards,

        Jean-François

        Kommentar


          Zitat von jef2000 Beitrag anzeigen
          If you have the script /etc/init.d/S70linknx , eibd will be started automatically ( change /dev/tts/0 to /dev/ttyS0 ).
          But as long as it's not fully working, it's better to open a shell on the router, start eibd manually with "eibd -i ft12:/dev/ttyS0 -t1023", and let it run in its own window, then open a second shell on the router and try "knxswrite ip:127.0.0.1 1/1/1 0" on it.
          After disable com1 for busybox and reboot, test is done.

          First Putty Window:
          eibd -i ft12:/dev/ttyS0 -t1023

          Second Putty window and Connected RX with TX:
          root@OpenWrt:~# knxswrite ip:127.0.0.1 1/1/1 0
          Send request

          First window again:
          Layer 8(004FCE90,386D450F) New Connection
          Layer 8(004FCED0,386D450F) ClientConnection Init
          Layer 8(004FCED0,386D450F) RecvMessage(005): 00 22 09 01 FF
          Layer 7(0052DDD8,386D450F) OpenGroup
          Layer 4(004FCF18,386D450F) OpenGroup 1/1/1 WO
          Layer 8(004FCED0,386D450F) SendMessage(002): 00 22
          Layer 8(004FCED0,386D450F) RecvMessage(004): 00 25 00 80
          Layer 7(0052DDD8,386D450F) Send(002): 00 80
          Layer 4(004FCF18,386D450F) Send Group T_DATA_XXX_REQ A_GroupValue_Write (small) 00
          Layer 3(004FCD48,386D450F) Send L_Data low from 0.0.0 to 1/1/1 hops: 07 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
          Layer 2(004ECA18,386D450F) Send L_Data low from 0.0.0 to 1/1/1 hops: 07 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
          Layer 1(004DC688,386D450F) Send(009): 11 0C 00 00 09 01 F1 00 80
          Layer 0(004DC688,386D450F) Send(016): 68 0A 0A 68 53 11 0C 00 00 09 01 F1 00 80 EB 16
          Layer 7(0052DDD8,386D450F) CloseGroup
          Layer 2(004ECA18,386D450F) Recv L_Data low from 0.0.0 to 1/1/1 hops: 07 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
          Layer 3(004FCD48,386D450F) Recv L_Data low from 0.0.0 to 1/1/1 hops: 07 T_DATA_XXX_REQ A_GroupValue_Write (small) 00
          Layer 0(004DC688,386D450F) Recv(005): 68 0A 0A 68 53
          Layer 4(004FCF18,386D450F) CloseGroup
          Layer 3(004FCD48,386D450F) deregisterGroupCallBack 004FCF18 = 0
          Layer 8(004FCED0,386D450F) ClientConnection closed
          Layer 0(004DC688,386D450F) Recv(011): 11 0C 00 00 09 01 F1 00 80 EB 16
          Layer 0(004DC688,386D450F) Send Ack(001): E5
          Layer 0(004DC688,386D450F) Recv(001): E5


          Is this all Ok?..it seems to me
          So next step..How do i enable eibd at start?
          What should S70Linknx file have?

          If EIBD ok..then lets begin second stage...

          Once again...
          Merci Beaucoup François
          Regards from Portugal
          Goahead

          Kommentar


            Zitat von Goahead Beitrag anzeigen
            Is this all Ok?..it seems to me
            I don't see anything wrong here. But you didn't test it with the bus coupler, right? Now you still have to make the resistor adapter and connect to the bus coupler to see if you can switch lights on or off.

            Zitat von Goahead Beitrag anzeigen
            So next step..How do i enable eibd at start?
            What should S70Linknx file have?

            If EIBD ok..then lets begin second stage...
            My S70Linknx file contains this:
            Code:
            #!/bin/sh
            sleep 30
            /usr/bin/eibd -i -e 0.1.100 -d ft12:/dev/tts/1
            sleep 2
            mkdir /tmp/lib
            cd /tmp/lib
            ln -s /usr/var/lib/linknx/ linknx
            
            cd /tmp/log && knxlog ip:127.0.0.1 &
            
            linknx -c -w -d
            
            lighttpd -f /etc/knx/lighttpd-fcgi.conf
            lighttpd -f /etc/knx/lighttpd-fcgi-auth.conf
            The first line "sleep 30" waits 30 seconds. It's not really necessary, but I added it to be sure that the router has booted and received re-synchronized its clock with the network time and date before knxlog starts to avoid strange timestamps in the logs.

            The second line "/usr/bin/eibd -i -e 0.1.100 -d ft12:/dev/tts/1" starts eibd, you'll have to change the serial port name to /dev/ttyS0.
            Type "eibd --help" to have more info about command line options

            Then wait again 2 seconds

            The next 3 lines create a symlink from /var/lib/linknx (on the ramdisk) to /usr/var/lib/linknx (on the flash). This location will be used to store config and persistent data if needed. If /usr/var/lib/linknx doesn't exist, you'll have to create it and put your config file "linknx.xml" there.
            You can find all the information needed to configure linknx.xml here:
            http://linknx.wiki.sourceforge.net/Configuration
            And an example here:
            http://linknx.cvs.sourceforge.net/li...ml?view=markup

            The line "cd /tmp/log && knxlog ip:127.0.0.1 &" is not mandatory. I use it to log all the group object messages in files. If you use it, be careful to delete the log files periodically, otherwise they will fill all your router's memory and it will crash.

            Line "linknx -c -w -d" starts linknx. You can also use "linknx -c -w -d/tmp/log/linknx.log" to log all messages to a file, but again, be careful to clean it regularly.
            Type "linknx --help" to have more info about command line options

            The last 2 lines start the web server.
            The first one start a server listening on a TCP port only reachable from my home network and has no login/password. The second one start a server on another TCP port reachable from the internet (I've put a port forwarding rule in my ADSL modem/router config) and asks for a login/password

            Regards,

            Jean-François

            Kommentar


              Cant find any diagram or schematic for the resistor type connection!
              Translation German to English is a bit tricky...
              So... In BCU:
              A resistor of 45.3K in pin 6 to enable FT1.2
              1K series TX (BCU) to RX UART to limit current and not burn UART RX?
              Direct connection RX UART to TX BCU?
              Will +/-3V3P from UART to BCU detect a signal "1" instead of "0"?
              A saw somewhere that it should be at least 4V2P to be considered a "1" in a BCU...but maybe it depends on BCU.

              Maybe i should use the 2 transistor solution..
              Je suis un peu paranoïaque comme vous

              Let me read a little more about xml...but...
              Maybe you could explain with a simple example of ON/OFF of a groupadress the configuration of html->php->XML

              Isnt Knxweb simpler? doesnt it create all xml, php code needed with simple user html interface?

              Can i make a memorie image of my router (fs, Kernel, aplication and configurations) all in one .bin for future flash or even to share it to other users of DSL-504T that are beginners just like me?
              (the only thing to change is the xml and file in www directory)

              regards
              Goahead

              Kommentar


                Bcu2uart 74hct125

                Hi All

                - Resistors circuit found in thread is definetly the easyest solution...but depends on BCU internal resistors and UART input resistors on chip..so i would not call it a generic solution...and also a bit risky.
                - François Circuit is the best isolation circuit ...but it has to many components and solder points.. not a simple DIY.

                So...after some thinking a present you an ideia circuit in attachement...

                Simulation seems to be ok...
                I will mount and test it later, but maybe someone can already point me some disavantages or some issue in this circuit.

                It only has 2 resistors and one 0.50cts chip that can be found in any electronic store.

                shoot me then...

                Regards
                Goahead
                Angehängte Dateien

                Kommentar


                  Zitat von Goahead Beitrag anzeigen
                  Cant find any diagram or schematic for the resistor type connection!
                  Translation German to English is a bit tricky...
                  So... In BCU:
                  A resistor of 45.3K in pin 6 to enable FT1.2
                  1K series TX (BCU) to RX UART to limit current and not burn UART RX?
                  Direct connection RX UART to TX BCU?
                  Will +/-3V3P from UART to BCU detect a signal "1" instead of "0"?
                  A saw somewhere that it should be at least 4V2P to be considered a "1" in a BCU...but maybe it depends on BCU.

                  Maybe i should use the 2 transistor solution..
                  Je suis un peu paranoïaque comme vous
                  About the resistor interface, I don't know more than what's in this forum.

                  Zitat von Goahead Beitrag anzeigen
                  Let me read a little more about xml...but...
                  Maybe you could explain with a simple example of ON/OFF of a groupadress the configuration of html->php->XML

                  Isnt Knxweb simpler? doesnt it create all xml, php code needed with simple user html interface?
                  KnxWeb is still under development, it's not a "production quality" solution that you just install and use.
                  The XML configuration file needed by linknx must be created manually. In the future, we will add an interface to modify it in knxweb.

                  Zitat von Goahead Beitrag anzeigen
                  Can i make a memorie image of my router (fs, Kernel, aplication and configurations) all in one .bin for future flash or even to share it to other users of DSL-504T that are beginners just like me?
                  (the only thing to change is the xml and file in www directory)
                  I never did it, but it must be possible.
                  That's a question you would better ask on OpenWRT forum... If it's not already explained in the OpenWRT documentation.

                  Regards,

                  Jean-François

                  Kommentar


                    Zitat von Goahead Beitrag anzeigen
                    It only has 2 resistors and one 0.50cts chip that can be found in any electronic store.

                    shoot me then...
                    Looks good.
                    What will be the power supply of 74HCT125? VDD or VCC.

                    Regards,

                    Jean-François

                    Kommentar


                      VCC=5VP

                      I didnt test it yet...
                      I thought that i had one chip at home..but i didnt find it...
                      Have to go to store to buy one chip to build the circuit...but im almost shure it will work.

                      Ill post the results...

                      Then ..you will need to continue helping me creating xml file and web interface

                      Regards from Portugal
                      What a sunny day with 20º...smells like spring today.

                      Goahead

                      Kommentar


                        Hallo jef2000 und alle Forum- Mitglieder

                        wie kann ich WebNKX 0.2 mit LinKNX koppeln ?

                        Jch habe OpenSUSE 10.3 auf einen Laptop installiert.

                        eibd lauft mit dem Parametern eibd –D –T –S –i –d ft12:/dev/ttyS0 (auch Zugriff mit der ETS3)

                        LinKNX lauft mit dem Parametern: usr/bin/ linknx –c –d –w

                        xampp php/Apache Web- Server ist installiert

                        in den Ordner htdocs habe ich alle Dateien von WebKNX hineinkopiert


                        http://duse.duse.de über Internet (DNS Dienst muss noch angepasst werden!)

                        http://localhost LOKAL



                        Ich kann aber bei z.B. „Neuer Schalter“ nichts auswahlen.

                        Die linknx.xml habe ich erstmal zu testen belassen und nur die Gruppenadressen an meinen EIB angepasst.

                        Wohin muss ich die linknx.xml kopieren ???

                        Kommentar


                          Zitat von daniel.duese Beitrag anzeigen
                          Wohin muss ich die linknx.xml kopieren ???

                          Wenn Du LinKNX mit dem Parameter -c aurufst dann muss die LinKNX nach /var/lib/linknx/linknx.xml. Der Parameter "-c" gibt nämlich genau den Pfad an, wo Deine linknx.xml liegt.

                          MfG

                          Daniel
                          Endlich kann Ich Bei Euch mitreden ...

                          Kommentar


                            ...das habe ich alles gemacht, auch die Rechte habe ich gesetzt. Nur habe ich das Gefühl, dass WebKNX nicht auf die linknx.xml zugreift oder nicht zugreifen kann...

                            Werde mal OpenSuse 10.2 installieren.

                            Kommentar


                              Hallo,

                              In KnxWeb 2.0 Datei linknx.php, ist host=127.0.0.1 und port=1028 hard-coded.

                              Du musst wahrscheinlich
                              <xmlserver type="inet" port="1028"/>

                              im Abschnitt "services" von linknx XML config addieren.

                              Gruss,

                              Jean-François

                              Kommentar


                                Zitat von daniel.duese
                                die linknx.php habe ich bearbeitet. 127.0.0.1 habe ich geändert.

                                Die linknx.xml habe ich original gelassen. Es ist Deine Version.
                                Den PHP skript kann nicht linknx erreichen.

                                Wenn linknx und php auf dem selben Rechner laüfen, musst du nichts in linknx.php ändern.

                                Wenn du "netstat -a" auführt, musst du eine Linie wie:
                                tcp 0 0 *:1028 *:* LISTEN
                                im ausgang sehen. Wenn es nicht so ist, kannst du linknx ohne "-d" starten und log Augang hier posten.

                                Du kannst auch mal versuchen "telnet 127.0.0.1 1028" auszuführen. Und wenn (ob) du einloggen bist "<read><config><rules/></config></read> [enter][CTRL-d]"

                                Gruss,

                                Kommentar

                                Lädt...
                                X