Installing HomeBridge (HomeKit bridge to Vera) on Docker Synology

Thanks for the great work. Its working on my synology now.

  1. It works with Openluup as well. I just tried it with my Openluup !

  2. When I use this command below, new container with new name starts each time. Is there a way to retain the old container and restart ? Is there a script to add to synology to start the same container if synology is rebooted, etc ?
    “docker run -d --net=host -p 51826:51826 -v /volume1/docker/<your_username>/homebridge:/root/.homebridge jessie-homebridge-vera”

Again, thanks for your hardwork.

[quote=“synapse007, post:21, topic:190921”]Thanks for the great work. Its working on my synology now.

  1. It works with Openluup as well. I just tried it with my Openluup !

  2. When I use this command below, new container with new name starts each time. Is there a way to retain the old container and restart ? Is there a script to add to synology to start the same container if synology is rebooted, etc ?
    “docker run -d --net=host -p 51826:51826 -v /volume1/docker/<your_username>/homebridge:/root/.homebridge jessie-homebridge-vera”

Again, thanks for your hardwork.[/quote]

That’s fine !

About your second question, I’m sorry but I don’t know how to do (I’m not a Docker specialist). Perhaps someone is able to help us about that (and give suggestion if I have to improve the code in the dockerfile).

I heard of a “restart” command in docker, but I’m not sure. I also found some thread talking about that here, here and here.

For the time being, I let the container running 24 hours/7, but it would be interesting to be able to program a restart at each SYNO start, or so …

Good morning,

I am having trouble installing the docker image.

When i put this command

cd /volume1/docker/admin/homebridge/
docker build -t jessie-homebridge-vera

I get the error docker: command not found.

Any suggestions please

I am using putty to log into synology

docker build -t jessie-homebridge-vera . :wink:

Yes but I’m already adding that command but still getting that error message. Thanks for replying.

Sent from my iPhone using Tapatalk

I had the same error. Check if docker service is running on Synology packages tab.

synapse docker is running already, thanks

This is what i am getting when trying to pull the image in docker

DiskStation> cd /volume1/docker/admin/homebridge
DiskStation> docker build -t jessie-homebridge-vera .
Sending build context to Docker daemon
FATA[0000] Post http:///var/run/docker.sock/v1.18/build?cpusetcpus=&cpushares=0&dockerfile=dockerfile&memory=0&memswap=0&rm=1&t=jessie-homebridge-vera: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

Any suggestions please?

I think you are running this command as admin. In other words, when you started ssh, you logged in as admin. Relogin as root in ssh and then run the docker run command, the TLS error will go away.

I am a newbie to docker as well and went through the same error.

synapse007,

Thank you so much for the advise. I was able to download the image file but i am having trouble initiating the script

Below is the details. I will appreciate any kind of help.

DiskStation> cd /volume1/docker/rawalish/homebridge
DiskStation> docker build -t jessie-homebridge-vera .
Sending build context to Docker daemon 5.632 kB
Sending build context to Docker daemon
Step 0 : FROM debian:jessie
—> a0e9fe2f8803
Step 1 : MAINTAINER tahitibub <tahitibub * gmail * com>
—> Using cache
—> 5e080afc9f04
Step 2 : USER root
—> Using cache
—> f39fc3e11ee0
Step 3 : ENV DEBIAN_FRONTEND noninteractive
—> Using cache
—> 3ca9d34a793a
Step 4 : RUN apt-get update && apt-get install -y apt-utils nano && sed -i “s/exit 101/exit 0/” /usr/sbin/policy-rc.d && apt-get install -y curl wget git apt-transport-https python build-essential make g++ libavahi-compat-libdnssd-dev libkrb5-dev vim net-tools
—> Using cache
—> 1df4e143b829
Step 5 : RUN curl -sLf -o /dev/null ‘https://deb.nodesource.com/node_0.12/dists/vivid/Release’ && curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && echo ‘deb Index of /node_0.12/ vivid main’ > /etc/apt/sources.list.d/nodesource.list && echo ‘deb-src Index of /node_0.12/ vivid main’ >> /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install -y nodejs
—> Using cache
—> 02c3e31dd273
Step 6 : RUN npm install -g homebridge@0.2.13 && npm install -g homebridge-vera
—> Using cache
—> 77d88fedcf83
Step 7 : USER root
—> Using cache
—> d2794f987718
Step 8 : RUN rm -r /var/run && rm -r /var/lock && ln -s /run /var/run && ln -s /run/lock /var/lock && rm /run/dbus/*
—> Using cache
—> c3bc5100a80f
Step 9 : EXPOSE 51826
—> Using cache
—> 98c0e80d6a21
Step 10 : CMD /root/.homebridge/run.sh
—> Using cache
—> 2b223cc4128f
Successfully built 2b223cc4128f
DiskStation>
DiskStation> docker run -d --net=host -p 51826:51826 -v /volume1/docker/rawalish
/homebridge:/root/.homebridge jessie-homebridge-vera
717ce19bd95d4bb1f5f44fb0d680c9d3c1e67fc5cf3890815430df763e355700
FATA[0000] Error response from daemon: Cannot start container 717ce19bd95d4bb1f5f44fb0d680c9d3c1e67fc5cf3890815430df763e355700: [8] System error: no such file or directory
DiskStation>

Hi all,

What’s happen about Syno DS212j?

Is it possible to install HomeBridge? Unable to install Docker…

[quote=“synapse007, post:21, topic:190921”]Thanks for the great work. Its working on my synology now.

  1. It works with Openluup as well. I just tried it with my Openluup !

  2. When I use this command below, new container with new name starts each time. Is there a way to retain the old container and restart ? Is there a script to add to synology to start the same container if synology is rebooted, etc ?
    “docker run -d --net=host -p 51826:51826 -v /volume1/docker/<your_username>/homebridge:/root/.homebridge jessie-homebridge-vera”

Again, thanks for your hardwork.[/quote]

Regarding point number 2:
Each time you enter this command, Docker creates a new container from the “jessie-homebridge-vera” image. You can view this new container on the Docker’s dashboard of the SYNOLOGY (with a fancy name).
You can restart this container (without creating a new one) but, for this operation to work, it seems that you need to provide a shutdown timeout beforehand, for the container ensures a successful restart.

According to EMCSizi, you have to give 120 seconds to stop the container, using this command :
docker stop -t 120

I’m sorry, but my syno has just been destroyed by a polarity reversal (due to a bad power cable) and I cannot test this.

Regards

I think it might fix issues on DSM 6 if you do:
sudo -i
before starting

So I just got around to installing this so I can test Vera with HomeKit. I got it started and everything ran fine but I was missing about 20 or so devices. So I decided to restart my Synology to see if the --restart=“always” command works with this code and it doesn’t. It starts, runs and then shuts down, starts, runs for a few seconds and then shuts down. The code is attached(start from the bottom). The first instance at 1:48 is when I ran it the first time through SSH and everything was working fine. At 2:04 is when I restarted the Synology. Also, it looks like it’s still not getting the rest of my lights when it’s trying to restart as well.

2016-04-07 02:05:06 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister> 2016-04-07 02:05:06 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:05:06 stderr *** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:05:06 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs> 2016-04-07 02:05:06 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:05:06 stderr *** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:05:05 stderr Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file 2016-04-07 02:05:04 stderr at Server.emit (events.js:104:17) 2016-04-07 02:05:04 stderr at EventedHTTPServer.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:62:10) 2016-04-07 02:05:04 stderr at EventedHTTPServer.emit (events.js:104:17) 2016-04-07 02:05:04 stderr at HAPServer._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:153:8) 2016-04-07 02:05:04 stderr at HAPServer.emit (events.js:104:17) 2016-04-07 02:05:04 stderr at Bridge.Accessory._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:352:20) 2016-04-07 02:05:04 stderr at Advertiser.startAdvertising (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30) 2016-04-07 02:05:04 stderr at Object.create [as createAdvertisement] (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:64:10) 2016-04-07 02:05:04 stderr at new Advertisement (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56:10) 2016-04-07 02:05:04 stderr at Error (native) 2016-04-07 02:05:04 stderr Error: dns service error: unknown 2016-04-07 02:05:04 stderr ^ 2016-04-07 02:05:04 stderr dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name, 2016-04-07 02:05:04 stderr /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56 2016-04-07 02:05:04 stdout Homebridge is running on port 51826. 2016-04-07 02:05:04 stdout e[30;47m e[0m 2016-04-07 02:05:04 stdout e[30;47m └────────────┘ e[0m 2016-04-07 02:05:04 stdout e[30;47m │ 031-45-154 │ e[0m 2016-04-07 02:05:04 stdout e[30;47m ┌────────────┐ e[0m 2016-04-07 02:05:04 stdout e[30;47m e[0m 2016-04-07 02:05:04 stdout Scan this code with your HomeKit App on your iOS device to pair with Homebridge: 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Waterfall'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Smoke Detector'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Second Floor'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Samsung TV'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Rear Windows/Doors'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Pool Pump'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Pool'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Outside Bath Light'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Outdoor Mod 2'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Outdoor Lights'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Master Bedroom'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Kitchen Lights'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Interior Motion'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Harmony Control'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Garage Door 2'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Garage Door 1'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Garage Door'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Front/Side Windows'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Front Door Lock'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Formal Lights'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Exhaust Fan'... 2016-04-07 02:05:04 stdout [Vera] Initializing platform accessory 'Entrance Doors'... 2016-04-07 02:05:03 stdout [Vera] Initializing Vera platform... 2016-04-07 02:05:03 stdout Loading 1 platforms... 2016-04-07 02:05:03 stdout --- 2016-04-07 02:05:03 stdout Loaded config.json with 0 accessories and 1 platforms. 2016-04-07 02:05:03 stdout --- 2016-04-07 02:05:03 stdout Registering platform 'homebridge-veralink.Vera' 2016-04-07 02:05:03 stdout VeraLink initializing 2016-04-07 02:05:03 stdout Loaded plugin: homebridge-vera 2016-04-07 02:05:02 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister> 2016-04-07 02:05:02 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:05:02 stderr *** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:05:02 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs> 2016-04-07 02:05:02 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:05:02 stderr *** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:05:01 stderr Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file 2016-04-07 02:05:01 stderr at Server.emit (events.js:104:17) 2016-04-07 02:05:01 stderr at EventedHTTPServer.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:62:10) 2016-04-07 02:05:01 stderr at EventedHTTPServer.emit (events.js:104:17) 2016-04-07 02:05:01 stderr at HAPServer._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:153:8) 2016-04-07 02:05:01 stderr at HAPServer.emit (events.js:104:17) 2016-04-07 02:05:01 stderr at Bridge.Accessory._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:352:20) 2016-04-07 02:05:01 stderr at Advertiser.startAdvertising (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30) 2016-04-07 02:05:01 stderr at Object.create [as createAdvertisement] (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:64:10) 2016-04-07 02:05:01 stderr at new Advertisement (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56:10) 2016-04-07 02:05:01 stderr at Error (native) 2016-04-07 02:05:01 stderr Error: dns service error: unknown 2016-04-07 02:05:01 stderr ^ 2016-04-07 02:05:01 stderr dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name, 2016-04-07 02:05:01 stderr /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56 2016-04-07 02:05:01 stdout Homebridge is running on port 51826. 2016-04-07 02:05:01 stdout e[30;47m e[0m 2016-04-07 02:05:01 stdout e[30;47m └────────────┘ e[0m 2016-04-07 02:05:01 stdout e[30;47m │ 031-45-154 │ e[0m 2016-04-07 02:05:01 stdout e[30;47m ┌────────────┐ e[0m 2016-04-07 02:05:01 stdout e[30;47m e[0m 2016-04-07 02:05:01 stdout Scan this code with your HomeKit App on your iOS device to pair with Homebridge: 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Waterfall'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Smoke Detector'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Second Floor'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Samsung TV'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Rear Windows/Doors'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Pool Pump'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Pool'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Outside Bath Light'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Outdoor Mod 2'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Outdoor Lights'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Master Bedroom'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Kitchen Lights'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Interior Motion'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Harmony Control'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Garage Door 2'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Garage Door 1'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Garage Door'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Front/Side Windows'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Front Door Lock'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Formal Lights'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Exhaust Fan'... 2016-04-07 02:05:01 stdout [Vera] Initializing platform accessory 'Entrance Doors'... 2016-04-07 02:04:59 stdout [Vera] Initializing Vera platform... 2016-04-07 02:04:59 stdout Loading 1 platforms... 2016-04-07 02:04:59 stdout --- 2016-04-07 02:04:59 stdout Loaded config.json with 0 accessories and 1 platforms. 2016-04-07 02:04:59 stdout --- 2016-04-07 02:04:59 stdout Registering platform 'homebridge-veralink.Vera' 2016-04-07 02:04:59 stdout VeraLink initializing 2016-04-07 02:04:59 stdout Loaded plugin: homebridge-vera 2016-04-07 02:04:53 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister> 2016-04-07 02:04:53 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:04:53 stderr *** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:04:53 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs> 2016-04-07 02:04:53 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 02:04:53 stderr *** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi. 2016-04-07 02:04:48 stderr Process 12 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid) 2016-04-07 02:04:47 stderr Failed to start message bus: The pid file "/var/run/dbus/pid" exists, if the message bus is not running, remove this file 2016-04-07 01:48:19 stdout Homebridge is running on port 51826. 2016-04-07 01:48:19 stdout e[30;47m e[0m 2016-04-07 01:48:19 stdout e[30;47m └────────────┘ e[0m 2016-04-07 01:48:19 stdout e[30;47m │ 031-45-154 │ e[0m 2016-04-07 01:48:19 stdout e[30;47m ┌────────────┐ e[0m 2016-04-07 01:48:19 stdout e[30;47m e[0m 2016-04-07 01:48:19 stdout Scan this code with your HomeKit App on your iOS device to pair with Homebridge: 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Waterfall'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Smoke Detector'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Second Floor'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Samsung TV'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Rear Windows/Doors'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Pool Pump'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Pool'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Outside Bath Light'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Outdoor Mod 2'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Outdoor Lights'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Master Bedroom'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Kitchen Lights'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Interior Motion'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Harmony Control'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Garage Door 2'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Garage Door 1'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Garage Door'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Front/Side Windows'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Front Door Lock'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Formal Lights'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Exhaust Fan'... 2016-04-07 01:48:19 stdout [Vera] Initializing platform accessory 'Entrance Doors'... 2016-04-07 01:48:18 stdout [Vera] Initializing Vera platform... 2016-04-07 01:48:18 stdout Loading 1 platforms... 2016-04-07 01:48:18 stdout --- 2016-04-07 01:48:18 stdout Loaded config.json with 0 accessories and 1 platforms. 2016-04-07 01:48:18 stdout --- 2016-04-07 01:48:18 stdout Registering platform 'homebridge-veralink.Vera' 2016-04-07 01:48:18 stdout VeraLink initializing 2016-04-07 01:48:18 stdout Loaded plugin: homebridge-vera 2016-04-07 01:48:17 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister> 2016-04-07 01:48:17 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 01:48:17 stderr *** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. 2016-04-07 01:48:17 stderr *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs> 2016-04-07 01:48:17 stderr *** WARNING *** Please fix your application to use the native API of Avahi! 2016-04-07 01:48:17 stderr *** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi. 2016-04-07 01:48:16 stderr Process 2371 died: No such process; trying to remove PID file. (/var/run/avahi-daemon//pid)

Hi everyone. I have a Synology DS1812+ with an Intel Atom D2700 processor. Assume this willl work just fine with this Nas?

My main question is if I want to install this on get it all configured from a Windows machine what files do I need? I already enabled SSH and installed Docker from the Package Center. For SSH I used Putty for windows and was able to SSH into my NAS just fine. I am lost on what files to use from there? How do i create the files needed and copy/paste the code required into them? If anyone can help me with this part it would be appreciated. I think I can figure out the rest…

Hi

Are people using this Docker?
I’m interested in using it, but would like to know if support is still available?

[quote=“Spudz72, post:34, topic:190921”]Hi everyone. I have a Synology DS1812+ with an Intel Atom D2700 processor. Assume this willl work just fine with this Nas?

My main question is if I want to install this on get it all configured from a Windows machine what files do I need? I already enabled SSH and installed Docker from the Package Center. For SSH I used Putty for windows and was able to SSH into my NAS just fine. I am lost on what files to use from there? How do i create the files needed and copy/paste the code required into them? If anyone can help me with this part it would be appreciated. I think I can figure out the rest…[/quote]

Hi, you probably already have the “docker” folder on your Synology after installing Docker there. Make another one inside it called “homebridge”. This is where you would put the files from @tahitibub instructions in this post. You can create the files in Windows, make the Synology “docker” folder shared so that Windows can see it, and copy the files there. In fact, you can do most of the editing in Windows. You only need SSH to run docker commands.

I modified the run.sh file to include dbus workaround (to help with docker start/stop commands), and redirected the homebridge output to the log. That allows me to connect to the running homebridge instance any time I want to check on things.

#!/bin/bash
# MODIFICATION DES PARAMETRES DE AVAHI
# AVAHI SETTINGS MODIFICATION
sed -i "s/^rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf
sed -i -e'/AVAHI_DAEMON_DETECT_LOCAL/s/1/0/' /etc/default/avahi-daemon

# DBUS workaround
rm -r /var/run && rm -r /var/lock && ln -s /run /var/run && ln -s /run/lock /var/lock && rm /run/dbus/*

# LANCEMENT DES SERVICES DBUS, AVAHI, HOMEBRIDGE
# RUNNING DBUS, AVAHI AND HOMEBRIDGE SERVICES
dbus-daemon --system
avahi-daemon -D
# homebridge
homebridge > homebridge.log 2>&1 &
echo Check homebridge status: cat homebridge.log
/bin/bash

Once the files are in that folder, login with Putty to your Synology as a root, then use these commands:

cd /volume1/docker/homebridge
docker build -t jessie_homebridge .
docker run --net=host -p 51826:51826 -v /etc/localtime:/etc/localtime -v /volume1/docker/homebridge:/root/.homebridge --name homebridge jessie_homebridge

If all went well, you will have the image called jessie_homebridge that you can see in the docker registry:

docker images

And you will see the running instance called “homebridge”:

docker ps

Now you can connect to the homebridge instance to see if it’s working:

docker exec -it homebridge /bin/bash

Once in it, check the log, processes, then you can exit the session, the docker will keep running:

# cat homebridge.log
# ps aux
# exit

To stop and start the instance, use these:

docker stop homebridge
docker start homebridge

The “docker run” command actually creates a new instance, so if you need to re-create it with the same name, then you should remove the old one first. To rebuild the image, you need to remove the image as well. Use these commands for cleanup:

docker rm homebridge
docker rmi jessie_homebridge

Note that start/stop from Synology docker UI does not work, it removes --net=host option and re-runs it. It basically means that the instance will not survive Synology reboot. I still don’t know how to make it work with their docker package. Not a big problem for me, I run it on power backup and rarely reboot.

Many thanks to @tahitibub for creating this docker image!

This is working great, thanks for putting this together! One question I have… I’m using jessie-homebridge-vera:latest and it loads fine. However, there is a feature that has been recently added to homebridge-vera that allows for the option to exclude rooms from loading by adding them to the config.json file. Does this setup load the latest version of homebridge-vera each time the docker container starts? I’m trying to test the “ignorerooms” variable discussed here, and it wont start the docker conatiner when I add the variable:

Any feedback would be great, thanks!

To get this to shutdown and restart with Sinology reboot just do the following:

ssh -p ‘SSH-PORT’ admin@‘NAS-IP’
sudo -i

then create your script: (http://www.lagmonster.org/docs/vi.html for vi commands)

vi /volume1/DockerAuto.sh

Place the following in the script

case $1 in start) /var/packages/Docker/target/usr/bin/docker start homebridge ;; stop) /var/packages/Docker/target/usr/bin/docker stop homebridge ;; *) echo "Usages: $0 [start|stop]" ;; esac

Then save the script.
Then run: chmod 755 DockerAuto.sh

Then open Task Scheduler in Synology GUI.
Create a schedules task called: Docker Start
Select user “root”
Choose event: Boot-up
Then in task settings, type: /volume1/DockerAuto.sh start

Create a schedules task called: Docker Stop
Select user “root”
Choose event: Shutdown
Then in task settings, type: /volume1/DockerAuto.sh stop

Enable both tasks and save settings.

I get the same error many other with docker were getting related to some DNS issue. I was able to run the container once and then when an App trys to connect it crashes, then crashes constantly from there. The fix apparently had something to do with avanti, but it crashes so I cant log in.

[7/2/2016, 12:14:22 AM] Homebridge is running on port 51826.
/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56
dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
^
Error: dns service error: unknown
at Error (native)
at new Advertisement (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:56:10)
at Object.create [as createAdvertisement] (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/advertisement.js:64:10)
at Advertiser.startAdvertising (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30)
at Bridge.Accessory._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:509:20)
at HAPServer.emit (events.js:104:17)
at HAPServer._onListening (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:182:8)
at EventedHTTPServer.emit (events.js:104:17)
at EventedHTTPServer. (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:62:10)
at Server.emit (events.js:104:17)

I saw from the main thread these changes were needed, and these are in the run.sh file as inline changes. I did update the latest Homebridge on the dockerfile, which didnt help.

In '/etc/avahi/avahi-daemon.conf' comment out 'rlimit-nproc = 3' (i.e. change to '#rlimit-nproc = 3')
In '/etc/default/avahi-daemon' change
	AVAHI_DAEMON_DETECT_LOCAL=1
	to
	AVAHI_DAEMON_DETECT_LOCAL=0

bk

I seem to have gotten this working by adding the dbus workaround posted by explorer, and by changing the dimmer value in the config file from false to true. This allows the dimmers to be detected.

add to run.sh:
rm -r /var/run && rm -r /var/lock && ln -s /run /var/run && ln -s /run/lock /var/lock && rm /run/dbus/*

That said, its only been up and running for 15 minutes but definitely progress.

Thanks for the help all.

x