Ankündigung

Einklappen
Keine Ankündigung bisher.

eibd mit BCU1 automatisch starten wie???

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

    eibd mit BCU1 automatisch starten wie???

    Hallo.

    Nachdem mein eibd ja nurn läuft möchte ich jetzt gerne das es auch bei Booten startet.
    Nur leider finde ich keine passendes Skript dafür oder irgendwelche hinweise wie ich es umschreiben muss da ih ja vor dem starten von eibd noch ein
    "setserial /dev/ttyS0 uart none"
    "cd /knxd/bcu1driver-0.2.6.6"
    "insmod eib-common.ko"
    "insmod eib-8250.ko"
    "insmod eib-pei16.ko"

    machen muss um die treiber zu laden.

    oder kann ich das einfach ganz oben in das startscript für eibd schreiben??

    ich hoffe ihr wist was ich meine und könnt mir helfen.

    MFG Christian

    #2
    Kannst Du ins init-script schreiben.. Init-Script kannst Du Dir auch von hier extrahieren.
    Meine Meinung ist allerdings: mit einer BCU1 ist kein dauerhafter, vollgasfester, stabiler Betrieb möglich (das liegt IMHO primär nicht am Treiber sondern einfach an der uralten BCU1). Da ärgert man sich nur unnötig mit Problemen rum, die man nicht haben müsste..

    IP oder TP-UART beschaffen, Notfalls geht FT1.2 oder USB auch sehr viel schmerzfreier..
    Die TP-UART bleibt aber das Mittel der Wahl (Nachteil: geht nicht direkt, lokal mit der ETS), diese Schnittstelle wird aber nicht ohne Grund auch auf sehr vielen KNX-Komponenten zum Microkontroller eingesetzt.. Und die kann der eibd mehr als perfekt. Kein insmod, keine Kernel-Header, einfach nur verwenden

    Makki
    EIB/KNX & WireGate & HS3, Russound,mpd,vdr,DM8000, DALI, DMX
    -> Bitte KEINE PNs!

    Kommentar


      #3
      IP oder TP-UART beschaffen, Notfalls geht FT1.2 oder USB auch sehr viel schmerzfreier..
      So langsam bin ich ja auch überzeugt, eine passende Schnittstelle hab ich z.B. im Shop von Wiregate gesehen. Kann ich die auch per USB nach Seriell Wandler anschließen? Mein Server hat keine RS232 mehr.


      Hier mal mein Init-Skripte für den Eibd und MH:

      Unter Suse nach /etc/init.d kopieren uns die Links in den Runleveln setzen bzw. vom Yast setzen lassen. sollte Deine Distribution upstart verwenden muß Du mal schauen, damit hab ich mich noch nicht beschäftigt.

      Ach ja, vollständig sind die Skripte noch nicht, tun aber schon mal was sie sollen. Ich hab die Templates von Suse nur angepaßt, deswegen stehen da recht viele auskommentierte Sachen drinn. Außerdem hab ich bei MH noch einen Überwachung ob er läuft, alco nicht über diese Zeilen wundern.


      EIBD:
      PHP-Code:
      #!/bin/sh

      ### BEGIN INIT INFO
      # Provides:          eibd
      # Required-Start:    $local_fs $remote_fs $syslog $time cron smartd
      # Required-Stop:     $local_fs $remote_fs $syslog $time cron smartd
      # Default-Start:     3
      # Default-Stop:      0 1 2 5 6
      # Short-Description: EIBD daemon providing access to the eib buss
      # Description:       EIBD daemon providing access to the eib buss
      ### END INIT INFO


      # Check for missing binaries (stale symlinks should not happen)
      # Note: Special treatment of stop for LSB conformance
      EIBD_BIN=/usr/local/bin/eibd
      EIBD_PID
      =/var/run/eibd.pid
      EIBD_LOG
      =/var/log/eibd
      EIBD_SOCK
      =/tmp/eib
      EIBD_USER
      =eibd
      #USB_DEV=2:2:1:0

      EIBD_ARGS="--GroupCache --daemon=$EIBD_LOG --Discovery --pid-file=$EIBD_PID --listen-local --listen-tcp --Server --Tunnelling usb:"
      #EIBD_ARGS="--daemon=$EIBD_LOG --pid-file=$EIBD_PID --listen-tcp usb:"

      test -x $EIBD_BIN || { echo "$EIBD_BIN not installed"
          if [ 
      "$1" "stop" ]; then exit 0;
          else exit 
      5fi; }

      # Check for existence of needed config file and read it
      #FOO_CONFIG=/etc/sysconfig/FOO
      #test -r $FOO_CONFIG || { echo "$FOO_CONFIG not existing";
      #    if [ "$1" = "stop" ]; then exit 0;
      #    else exit 6; fi; }

      # Read config    
      #. $FOO_CONFIG

      # Source LSB init functions
      # providing start_daemon, killproc, pidofproc, 
      # log_success_msg, log_failure_msg and log_warning_msg.
      # This is currently not used by UnitedLinux based distributions and
      # not needed for init scripts for UnitedLinux only. If it is used,
      # the functions from rc.status should not be sourced or used.
      #. /lib/lsb/init-functions

      # Shell functions sourced from /etc/rc.status:
      #      rc_check         check and set local and overall rc status
      #      rc_status        check and set local and overall rc status
      #      rc_status -v     be verbose in local rc status and clear it afterwards
      #      rc_status -v -r  ditto and clear both the local and overall rc status
      #      rc_status -s     display "skipped" and exit with status 3
      #      rc_status -u     display "unused" and exit with status 3
      #      rc_failed        set local and overall rc status to failed
      #      rc_failed <num>  set local and overall rc status to <num>
      #      rc_reset         clear both the local and overall rc status
      #      rc_exit          exit appropriate to overall rc status
      #      rc_active        checks whether a service is activated by symlinks
      . /etc/rc.status

      # Reset status of this service
      rc_reset

      # Return values acc. to LSB for all commands but status:
      # 0      - success
      # 1       - generic or unspecified error
      # 2       - invalid or excess argument(s)
      # 3       - unimplemented feature (e.g. "reload")
      # 4       - user had insufficient privileges
      # 5       - program is not installed
      # 6       - program is not configured
      # 7       - program is not running
      # 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)

      # Note that starting an already running service, stopping
      # or restarting a not-running service as well as the restart
      # with force-reload (in case signaling is not supported) are
      # considered a success.

      case "$1" in
          start
      )
          echo -
      "Starting eibd "
          
      ## Start daemon with startproc(8). If this fails
          ## the return value is set appropriately by startproc.
          
      USB_DEV=$(findknxusb awk '/device:/ {print $2 }')
                     
          
      rm -f $EIBD_SOCK
          
          
      # Check size of address tab and set to 0 if needed
          
      bcuaddrtab usb: | grep -"Size: 0"
          
      Result=$?
          if [ 
      $Result -ne 0 ]; then
              bcuaddrtab 
      -w 0 usb: &>/dev/null
          fi
          
          
      /sbin/startproc -u $EIBD_USER $EIBD_BIN $EIBD_ARGS &>/dev/null #$USB_DEV &>/dev/null
          
          # Workarround because the USB interface is not initalized correctly on first try
          #sleep 10
          #/sbin/checkproc -p $EIBD_PID $EIBD_BIN
          #if [ "$?" -ne "0" ]; then
          #    echo -e -n "\n     eibd was not started, trying again"
          #    /sbin/startproc -u $EIBD_USER $EIBD_BIN $EIBD_ARGS$USB_DEV &>/dev/null
             #fi

          # Remember status and be verbose
          
      rc_status -v
          
      ;;
          
      stop)
          echo -
      "Shutting down eibd "
          
      ## Stop daemon with killproc(8) and if this fails
          ## killproc sets the return value according to LSB.

          
      /sbin/killproc -TERM $EIBD_BIN

          
      # Remember status and be verbose
          
      rc_status -v
          
      ;;
          try-
      restart|condrestart)
          
      ## Do a restart only if the service was active before.
          ## Note: try-restart is now part of LSB (as of 1.9).
          ## RH has a similar command named condrestart.
          
      if test "$1" "condrestart"then
              
      echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
          
      fi
          
      $0 status
          
      if test $? = 0then
              
      $0 restart
          
      else
              
      rc_reset    # Not running is not a failure.
          
      fi
          
      # Remember status and be quiet
          
      rc_status
          
      ;;
          
      restart)
          
      ## Stop the service and regardless of whether it was
          ## running or not, start it again.
          
      $0 stop
          
      $0 start

          
      # Remember status and be quiet
          
      rc_status
          
      ;;
          
      force-reload)
          
      ## Signal the daemon to reload its config. Most daemons
          ## do this on signal 1 (SIGHUP).
          ## If it does not support it, restart the service if it
          ## is running.

          
      echo -"Reload service eibd "
          
      ## if it supports it:
          
      /sbin/killproc -HUP $EIBD_BIN
          
      #touch /var/run/FOO.pid
          
      rc_status -v

          
      ## Otherwise:
          #$0 try-restart
          #rc_status
          
      ;;
          
      reload)
          
      ## Like force-reload, but if daemon does not support
          ## signaling, do nothing (!)

          # If it supports signaling:
          
      echo -"Reload service eibd "
          
      /sbin/killproc -HUP $EIBD_BIN
          
      #touch /var/run/FOO.pid
          
      rc_status -v
          
          
      ## Otherwise if it does not support reload:
          #rc_failed 3
          #rc_status -v
          
      ;;
          
      status)
          echo -
      "Checking for service eibd "
          
      ## Check status with checkproc(8), if process is running
          ## checkproc will return with exit status 0.

          # Return value is slightly different for the status command:
          # 0 - service up and running
          # 1 - service dead, but /var/run/  pid  file exists
          # 2 - service dead, but /var/lock/ lock file exists
          # 3 - service not running (unused)
          # 4 - service status unknown :-(
          # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
          
          # NOTE: checkproc returns LSB compliant status values.
          
      /sbin/checkproc $EIBD_BIN
          
      # NOTE: rc_status knows that we called this init script with
          # "status" option and adapts its messages accordingly.
          
      rc_status -v
          
      ;;
      #    probe)
      #    ## Optional: Probe for the necessity of a reload, print out the
      #    ## argument to this init script which is required for a reload.
      #    ## Note: probe is not (yet) part of LSB (as of 1.9)
      #
      #    test /etc/FOO/FOO.conf -nt /var/run/FOO.pid && echo reload
      #    ;;
          
      *)
          echo 
      "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
          
      exit 1
          
      ;;
      esac
      rc_exit 
      MH:

      PHP-Code:
      #!/bin/sh

      ### BEGIN INIT INFO
      # Provides:          misterhouse
      # Required-Start:    $local_fs $remote_fs $syslog $time cron smartd eibd
      # Required-Stop:     $local_fs $remote_fs $syslog $time cron smartd eibd
      # Default-Start:     3
      # Default-Stop:      0 1 2 5 6
      # Short-Description: Mister house home automatisation
      # Description:       Mister house home automatisation
      ### END INIT INFO


      # Check for missing binaries (stale symlinks should not happen)
      # Note: Special treatment of stop for LSB conformance
      MH_BIN=/srv/mh/mh/bin/mh
      MH_PID
      =/var/run/mh.pid
      MH_LOG
      =/srv/mh/log/mh.log
      MH_USER
      =mh
      #USB_DEV=2:2:1:0

      MH_ARGS=""

      test -x $MH_BIN || { echo "$MH_BIN not installed"
          if [ 
      "$1" "stop" ]; then exit 0;
          else exit 
      5fi; }

      # Check for existence of needed config file and read it
      #FOO_CONFIG=/etc/sysconfig/FOO
      #test -r $FOO_CONFIG || { echo "$FOO_CONFIG not existing";
      #    if [ "$1" = "stop" ]; then exit 0;
      #    else exit 6; fi; }

      # Read config    
      #. $FOO_CONFIG

      # Source LSB init functions
      # providing start_daemon, killproc, pidofproc, 
      # log_success_msg, log_failure_msg and log_warning_msg.
      # This is currently not used by UnitedLinux based distributions and
      # not needed for init scripts for UnitedLinux only. If it is used,
      # the functions from rc.status should not be sourced or used.
      #. /lib/lsb/init-functions

      # Shell functions sourced from /etc/rc.status:
      #      rc_check         check and set local and overall rc status
      #      rc_status        check and set local and overall rc status
      #      rc_status -v     be verbose in local rc status and clear it afterwards
      #      rc_status -v -r  ditto and clear both the local and overall rc status
      #      rc_status -s     display "skipped" and exit with status 3
      #      rc_status -u     display "unused" and exit with status 3
      #      rc_failed        set local and overall rc status to failed
      #      rc_failed <num>  set local and overall rc status to <num>
      #      rc_reset         clear both the local and overall rc status
      #      rc_exit          exit appropriate to overall rc status
      #      rc_active        checks whether a service is activated by symlinks
      . /etc/rc.status

      # Reset status of this service
      rc_reset

      # Return values acc. to LSB for all commands but status:
      # 0      - success
      # 1       - generic or unspecified error
      # 2       - invalid or excess argument(s)
      # 3       - unimplemented feature (e.g. "reload")
      # 4       - user had insufficient privileges
      # 5       - program is not installed
      # 6       - program is not configured
      # 7       - program is not running
      # 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)

      # Note that starting an already running service, stopping
      # or restarting a not-running service as well as the restart
      # with force-reload (in case signaling is not supported) are
      # considered a success.

      case "$1" in
          start
      )
          echo -
      "Starting mister house "
          
      ## Start daemon with startproc(8). If this fails
          ## the return value is set appropriately by startproc.
                   
          
      export mh_parms=/srv/mh/mh.private.ini
          
      /sbin/startproc -u $MH_USER $MH_BIN $MH_ARGS &>> /srv/mh/log/mh.log
          
      #/sbin/startproc -u $MH_USER $MH_BIN $MH_ARGS 
          #&>/dev/null
          
          
      touch /tmp/mh.watchdog
          chown mh
      :eib /tmp/mh.watchdog
          
          
      # Remember status and be verbose
          
      rc_status -v
          
      ;;
          
      stop)
          echo -
      "Shutting down mister house "
          
      ## Stop daemon with killproc(8) and if this fails
          ## killproc sets the return value according to LSB.
          
          
      rm -/tmp/mh.watchdog

          
      /sbin/killproc -TERM $MH_BIN

          
      # Remember status and be verbose
          
      rc_status -v
          
      ;;
          try-
      restart|condrestart)
          
      ## Do a restart only if the service was active before.
          ## Note: try-restart is now part of LSB (as of 1.9).
          ## RH has a similar command named condrestart.
          
      if test "$1" "condrestart"then
              
      echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
          
      fi
          
      $0 status
          
      if test $? = 0then
              
      $0 restart
          
      else
              
      rc_reset    # Not running is not a failure.
          
      fi
          
      # Remember status and be quiet
          
      rc_status
          
      ;;
          
      restart)
          
      ## Stop the service and regardless of whether it was
          ## running or not, start it again.
          
      $0 stop
          
      $0 start

          
      # Remember status and be quiet
          
      rc_status
          
      ;;
          
      force-reload)
          
      ## Signal the daemon to reload its config. Most daemons
          ## do this on signal 1 (SIGHUP).
          ## If it does not support it, restart the service if it
          ## is running.

          
      echo -"Reload service mister house "
          
      ## if it supports it:
          
      /sbin/killproc -HUP $MH_BIN
          
      #touch /var/run/FOO.pid
          
      rc_status -v

          
      ## Otherwise:
          #$0 try-restart
          #rc_status
          
      ;;
          
      reload)
          
      ## Like force-reload, but if daemon does not support
          ## signaling, do nothing (!)

          # If it supports signaling:
          
      echo -"Reload service mister house "
          
      /sbin/killproc -HUP $MH_BIN
          
      #touch /var/run/FOO.pid
          
      rc_status -v
          
          
      ## Otherwise if it does not support reload:
          #rc_failed 3
          #rc_status -v
          
      ;;
          
      status)
          echo -
      "Checking for service mister house "
          
      ## Check status with checkproc(8), if process is running
          ## checkproc will return with exit status 0.

          # Return value is slightly different for the status command:
          # 0 - service up and running
          # 1 - service dead, but /var/run/  pid  file exists
          # 2 - service dead, but /var/lock/ lock file exists
          # 3 - service not running (unused)
          # 4 - service status unknown :-(
          # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
          
          # NOTE: checkproc returns LSB compliant status values.
          #/sbin/checkproc -p $EIBD_PID $EIBD_BIN
          
      /sbin/checkproc $MH_BIN
          
      # NOTE: rc_status knows that we called this init script with
          # "status" option and adapts its messages accordingly.
          
      rc_status -v
          
      ;;
      #    probe)
      #    ## Optional: Probe for the necessity of a reload, print out the
      #    ## argument to this init script which is required for a reload.
      #    ## Note: probe is not (yet) part of LSB (as of 1.9)
      #
      #    test /etc/FOO/FOO.conf -nt /var/run/FOO.pid && echo reload
      #    ;;
          
      *)
          echo 
      "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
          
      exit 1
          
      ;;
      esac
      rc_exit 

      Kommentar


        #4
        Zitat von Jockel Beitrag anzeigen
        So langsam bin ich ja auch überzeugt, eine passende Schnittstelle hab ich z.B. im Shop von Wiregate gesehen. Kann ich die auch per USB nach Seriell Wandler anschließen? Mein Server hat keine RS232 mehr.
        Ein Student hat an unseren Institut eine Interface Platine gebaut, die einen TPUART + USB/seriell Wandlerchip (Ich glaube FTDI) enthalten hat.

        Ich hatte Gelegenheit, das Port kurz zu testen: Es hat mit unseren Demokoffer problemlos funktioniert.
        Einen Stress/Lasttest habe ich nicht gemacht. Die einzige Auswirkung unter Last könnte sein, das es vermehrt zu unnötigen Telegramwiederholungen am Bus kommt.

        Das Ergebniss sollte auf ein herkömliches TPUART Interface + USB/RS232 Wandler übertragbar sein. Wenn das TPUART Interface Handshake-Leitungen zur Spannungsversorgung nutzt, muss man nur sicherstellen, das der USB/RS232 Wandler diese auch umsetzt.

        Kommentar


          #5
          Sorry übersehen..
          Zitat von Jockel Beitrag anzeigen
          Kann ich die auch per USB nach Seriell Wandler anschließen? Mein Server hat keine RS232 mehr.
          Prinzipiell sollte es keine Probleme geben, bei mir läuft TP-UART via Wandler 100% stabil. Es gibt bei den USB-Seriell-Wandler aber "solche und solche"; mit den FTDI habe ich persönlich eher schlechte Erfahrungen gemacht und setze daher ausgewählte mit PL2303-Chipsatz ein..

          Makki
          EIB/KNX & WireGate & HS3, Russound,mpd,vdr,DM8000, DALI, DMX
          -> Bitte KEINE PNs!

          Kommentar


            #6
            Danke! Dann werde ich die Schnittstelle bestellen, sobald ich wieder zu Hause bin!

            Die FTDI Chips setzen wir auch in einigen unserer Produkte ein, ich mag sie aber auch nicht... Haben mir schon eine ganze Menge Ärger gemacht.

            Kommentar

            Lädt...
            X