homebridge von init.d auf systemd umstellen

  • systemctl status homebridge.service

    ? homebridge.service - Node.js HomeKit

    Loaded: error (Reason: Bad message)

    Active: inactive (dead)

  • det


    Ich habe den Inhalt nochmals komplett gelöscht und sauber am mac eingefügt.


    Ich konnte nun die schritte ab

    sudo systemctl daemon-reload


    sauber ohne Fehlermeldung abarbeiten.


    Homebridge läuft auch wieder.


    Hierfür und für deine geduldigen Anleitungen vielen Dank.


    Ich komme noch nicht ganz zurecht, was manchmal mit „was steht im log“ gemeint ist.


    Kann ich noch irgendwie überprüfen, ob homebridge mit systemd sauber läuft?

  • Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] WebHook: Started server on port '51828'.

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] Initializing VorwerkVacuumRobot platform...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing Hue platform...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] homebridge-hue v0.5.7, node v6.10.0, homebridge v0.4.22

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] Loading 0 accessories...

    Oct 12 22:38:15 raspberrypi dhcpcd[436]: eth0: no IPv6 Routers available

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] Changed occupancy state for 192.168.192.56 to true. Last successful ping 2017-10-12T22:38:15+02:00 , last webhook none .

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] Changed occupancy state for 192.168.192.24 to true. Last successful ping 2017-10-12T22:38:15+02:00 , last webhook none .

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Philips hue: warning: api version 1.21.0

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Philips hue: BSB002 bridge v1709131301, api v1.21.0

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Philips hue: 6 accessories

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Philips hue'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Philips hue: 3 services

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Lichter Wohnwand'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Unterschrank'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Freie Steckdose'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Sofa'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] [Hue] Initializing platform accessory 'Gartenspot'...

    Oct 12 22:38:15 raspberrypi homebridge[554]: [2017-10-12 22:38:15] Found robot #1: Kohlers VR200

    Oct 12 22:38:16 raspberrypi homebridge[554]: [2017-10-12 22:38:16] Initializing platform accessory 'Kohlers VR200'...

    Oct 12 22:38:16 raspberrypi homebridge[554]: Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

    Oct 12 22:38:16 raspberrypi homebridge[554]: ??????????????

    Oct 12 22:38:16 raspberrypi homebridge[554]: ? 031-45-154 ?

    Oct 12 22:38:16 raspberrypi homebridge[554]: ??????????????

    Oct 12 22:38:16 raspberrypi homebridge[554]: [2017-10-12 22:38:16] Homebridge is running on port 51826.

    Oct 12 22:38:16 raspberrypi homebridge[554]: [2017-10-12 22:38:16] [Harmony Hub] Fetching Logitech Harmony activities...

    Oct 12 22:38:37 raspberrypi systemd[690]: Time has been changed

    Oct 12 22:38:37 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:39:07 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:38:37 raspberrypi systemd[1]: Time has been changed

    Oct 12 22:38:37 raspberrypi homebridge[554]: [2017-10-12 22:38:37] [Harmony Hub] Found activities:

    Oct 12 22:38:37 raspberrypi homebridge[554]: Samsung

    Oct 12 22:38:37 raspberrypi homebridge[554]: Radio

    Oct 12 22:38:37 raspberrypi homebridge[554]: Receiver

    Oct 12 22:38:37 raspberrypi homebridge[554]: Nachtruhe

    Oct 12 22:38:37 raspberrypi homebridge[554]: Fernsehen

    Oct 12 22:38:37 raspberrypi homebridge[554]: PowerOff

    Oct 12 22:38:37 raspberrypi homebridge[554]: BlueRay

    Oct 12 22:38:37 raspberrypi homebridge[554]: NickiRadio

    Oct 12 22:38:37 raspberrypi homebridge[554]: Mac anschalten

    Oct 12 22:38:37 raspberrypi homebridge[554]: CD-Player

    Oct 12 22:38:37 raspberrypi homebridge[554]: Heimkino

    Oct 12 22:39:44 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:40:14 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:39:52 raspberrypi systemd[1]: Starting Session c3 of user pi.

    Oct 12 22:39:52 raspberrypi systemd[1]: Started Session c3 of user pi.

    Oct 12 22:41:06 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:41:36 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:42:05 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:42:35 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:51:06 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:51:36 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:52:02 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:52:32 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:53:03 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:53:33 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:53:40 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...

    Oct 12 22:53:40 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:54:10 2017 [try http://www.rsyslog.com/e/2007 ]

    Oct 12 22:53:40 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.

    Oct 12 22:54:39 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Oct 12 22:55:09 2017 [try http://www.rsyslog.com/e/2007 ]

  • det


    Vielen Dank für deine Hilfe und Tipps. Homebridge läuft einwandfrei ?

  • Moin! Hab die Homebridge unter Node 9.3.0 und raspbian stretch manuell installiert. Soweit so gut.

    Habe sie dann nach dieser Anleitung als systemdienst eingerichtet mit root.


    Sobald ich aber ein plugin in meiner config.json habe, egal welches, startet die homebridge nicht mehr.

    Nehme ich alle plugins aus der config.json raus, läuft sie ganz normal.


    Any ideas?


    Hier noch der Log:


  • Wie sieht die Config aus?

  • An der config sollte es hoffentlich nicht liegen. Dort ist lediglich das raspberry und Nest Plugin enthalten. Ich lade sie später mal hoch, habe aktuell keinen Zugriff. Es funktionierte aber mit der selben config problemlos, als die Homebridge normal lief und über init.d im Autostart war.


    Irgendwie lassen sich auch keine Plugins mehr installieren aktuell, er zeigt nur Fehlermeldungen. Sollte ich vor sudo npm install mit cd /var/homebridge vielleicht erst in diesen Pfad wechseln?


    Damit die Homebridge ohne Plugins überhaupt startet, musste ich aus der homebridge.service Datei den Pfad um „local“ reduzieren.

  • sollte ich vor sudo npm install mit cd /var/homebridge vielleicht erst in diesen Pfad wechseln

    brauchst du nicht.


    homebridge.service Datei den Pfad um „local“ reduzieren.

    :?:

    zeigen was du meinst

    so muss es aussehen:

    homebridge.services

    und die homebridge in defaults:

    Code
    # Defaults / Configuration options for homebridge
    # The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
    #HOMEBRIDGE_OPTS=-U /var/homebridge >> /var/log/homebridge.log 2>> //var/log/homebridge.err
    HOMEBRIDGE_OPTS=-U /var/homebridge
    
    # If you uncomment the following line, homebridge will log more 
    # You can display this via systemd's journalctl: journalctl -f -u homebridge
    # DEBUG=*
  • Mein hombridge.services sieht so aus.

    Einziger Unterschied ist:


    "ExecStart" ist der Pfad nicht: ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS sondern ExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTS


    Wenn "local" mit drin steht, startet die HomeBridge überhaupt nicht. Das Problem hatte auch jemand auf Seite 2 dieses Threads, daher mein "Lösungsansatz".


    Homebridge in defaults ist exakt so angelegt wie bei dir. Bin ratlos.

  • Hey det, danke für deine Hilfe. Ich poste die config sobald ich daheim bin.

    Habe noch eine generelle Frage, gibt es eine Möglichkeit die ganzen Installationen rückgängig zu machen, um frisch zu starten?

    Wenn die Homebridge bisher irgendwelche Fehler macht, mache ich meinen Raspberry immer komplett platt und installiere Raspbian neu, das dauert immer etwas.. Am liebsten würde ich das frische aufsetzen der Homebridge und allen dazugehörigen installationen wie node, npm avahi etc manuell entfernen via ssh. Ich denke, jedesmal raspbian neu aufzusetzen ist unnötig?

  • Hier ist die config. Eigentlich unspektakulär.


    Weiterhin bekomme ich folgenden Fehler bei Plugin Installation:

    Einmal editiert, zuletzt von krmkrx ()

  • Homebridge installiere ich wie folgt, als User Pi auf einem frischen Raspbian Stretch full


    sudo apt-get update

    sudo apt-get upgrade

    curl -sL https//deb.node.source.com/setup_8.x | sudo -E bash -

    sudo apt-get install -y nodejs

    sudo npm i npm -g

    sudo apt-get install libavahi-compat-libdnssd-dev

    sudo apt-get install git

    sudo npm install -g --unsafe-perm homebridge

  • curl -sL https//deb.node.source.com/setup_8.x | sudo -E bash -

    sudo apt-get install -y nodejs

    aha deswegen sind die Pfade bei dir anderst


    System cleanen,

    sudo apt-get install -y ntpdate libpcap*

    wget https://nodejs.org/dist/v8.9.3…8.9.3-linux-armv7l.tar.gz

    tar -xvf node-v8.9.3-linux-armv7l.tar.gz

    cd ./node-v8.9.3-linux-armv7l

    sudo cp -R * /usr/local/

    cd ..

    sudo rm node-v8.9.3-linux-armv7l -r

    sudo rm node-v8.9.3-linux-armv7l.tar.gz

    sudo apt-get install -y libavahi-compat-libdnssd-dev

    sudo npm install -g --unsafe-perm npm@latest homebridge@latest


    jetzt die Plugins installieren


    so ungefähr

  • Hallo zusammen,


    ich bin neu hier und habe mir Homebridge über die Anleitung manuell erfolgreich installiert. Vielen Dank für die Anleitung. Prinzipiell habe ich Homebridge mit dem Harmony-Plugin zum Fliegen bekommen incl. automatischem Start beim Booten des Raspi (Version 1 B+). Leider stürzt die Homebridge aus unerfindlichen Gründen ständig ab, fast täglich.

    Ich habe daher anhand der Anleitung in diesem Thread versucht, den automatischen Neustart zu implementieren. Das ist mir nicht gelungen und ich bekomme nun die Homebridge überhaupt nicht mehr gestartet.


    Beim Versuch über "sudo systemctl start homebridge" kommt die Fehlermeldung:

    "Failed to start homebridge.service: Unit homebridge.service is not loaded properly: Invalid argument.

    See system logs and 'systemctl status homebridge.service' for details."


    Der systemctl status liefert mehrmals:

    "Jan 08 22:11:39 raspberrypi systemd[1]: homebridge.service: Service lacks both ExecStart= and ExecStop= setting. Refusing."


    Was kann ich tun? Unklar war mir beim Einrichten die Stelle in der Beschreibung:

    "...wenn hombridge als root laufen soll, dann diese Zeile anpassen

    Code

    1. User=homebridge

    in

    Code

    1. User=root"


    Wo steht diese Zeile überhaupt?


    Wenn ich standardmäßig installiert habe, bin ich user homebridge, oder?


    Ihr merkt, ich habe keine Ahnung, hoffe aber, dass ich mir meine Installation nicht zerschossen habe und ihr mir helfen könnt!? Vielen Dank schon mal....


    Grüße

    Volker