Comments (21)
Either way will work, it's probably more of a personal preference thing. Personally, I like to manage all my containers through a single docker-compose.yml
file as I find it easier.
from docker-homebridge.
You can have up to 100 devices exposed through a single homebridge instances, but if you want to run multiple instances of Homebridge on the same host doing that with Docker is fairly trivial.
You need to change some Homebridge config settings to make sure it does not conflict with your first instance:
- Homebridge Port - change it away from the default
51826
- Homebridge Username - change it away from the default
CC:22:3D:E3:CE:30
- make sure you only use hexadecimal characters - Homebridge Name - Optional. This makes it easy to identify which instance is which in iOS.
These can all be changed in the config.json
file created after you run the container for the first time.
As for actually launching a second docker container, just make sure the container name is unique, in my examples I use --name=homebridge
, so for a second instance you might use --name=homebridge-two
.
Once the second container is up and running, you should be able to pair it with iOS just like you did with the first.
If you're using Docker Compose just create a second entry under services:
version: '2'
services:
homebridge:
image: oznu/homebridge:latest
network_mode: host
volumes:
- ./volumes/homebridge:/homebridge
homebridge-two:
image: oznu/homebridge:latest
network_mode: host
volumes:
- ./volumes/homebridge-two:/homebridge
from docker-homebridge.
Thanks for the explanation! I’m going to give this a shot after my RPI3 comes in the mail. This would definitely solve my current issue to testing purposes.
Noob question, Are all the Homebridge services isolated from each other? Meaning first container running Homebridge 1, second container running Homebridge 2?
from docker-homebridge.
As long as you specify unique /homebridge
volume mount locations for each container, they will be isolated from one another.
from docker-homebridge.
from docker-homebridge.
Good news is the Pi came in and I've successfully deployed your script. The first homebridge service works with homeApp.
Creating Containers
I'm a bit lost in creating containers. How do I go about that?
When creating a directory, does that mean you are creating a container? (3. Create Docker Compose Manifest)
Is there a way to run Docker on RPI and use Kitematic or similar to control containers from a GUI?
from docker-homebridge.
Docker Compose is doing the hard work in the background to create and manage the containers for you.
Each entry under services:
represents another container.
version: '2'
services:
homebridge:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config:/homebridge
environment:
- PGID=1000
- PUID=1000
homebridge-testing:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config-testing:/homebridge
environment:
- PGID=1000
- PUID=1000
Start it using these steps:
- Run
docker-compose up -d homebridge
- this will launch the first container in the background. - Run
docker-compose up homebridge-testing
- this will create theconfig-testing
volume and populate the default config.json. You will get an error saying the port is already in use. PressCTRL+C
to exit the container. - Edit the
./config-testing/config.json
file as per instructions in my first comment. - Make sure it's working by running
docker-compose up homebridge-testing
. If it is, pressCTRL+C
then restart it in background mode by runningdocker-compose up -d
.
As for a Kitematic on Raspberry Pi, I've seen a few ways to do it over the years, most were quite complicated though. Portainer is a web based alternative that might suit your needs, it has an ARM image that should run on the Raspberry Pi, though I have not tested it.
from docker-homebridge.
understood, I'm assuming I have to create a directory for "homebridge-testing"
mkdir /home/pi/homebridge cd /home/pi/homebridge
I'm guessing not but at this point, should I create a new file called docker-compose.yml using nano for "homebridge-testing" or use the previous docker-compose that was created for "homebridge"?
from docker-homebridge.
After tinkering for some time, I got it working. I created an individual Docker Compose Manifest for each homebridge service. I then copied the service example from your previous post to the docker-compose.yml file. Ever since I have added another. I now have three services running without any problems.
The next step will be to install the following:-
- Peter Scargill the script - MQTT & NODE red
- FFmpeg with the OpenMAX H.264 GPU acceleration
Peter Scargill
Homebridge IP Camera
Though I'm uncertain how to go about installing them in a docker environment.
A general question, suppose I have to install Domoticz, or the above. Do I have to deploy them in containers or can install them outside the docker setup?
Portainer - looks interesting, I got to read up about it.
Thank you in advance!
from docker-homebridge.
I couldn’t find a FFmpeg OMX Docker image so I installed as a global library. I can’t seem to get that to talk to one of the container running the IP Cam plugin.
from docker-homebridge.
Which homebridge plugin are you trying to install?
from docker-homebridge.
homebridge-camera-ffmpeg-omx
https://www.npmjs.com/package/homebridge-camera-ffmpeg-omx
Before Docker, I was running ffmpeg on RPI3 and noticed there was a 6 sec delay in receiving streams so I gave ffmpeg omx a try which made a huge improvement. There are still delays but not as bad.
Correct me if I’m wrong, can’t I globally install ffmpeg omx on a specific container without Dockering it as an image?
from docker-homebridge.
To get the plugin to work when running Docker in a container you would need to have ffmpeg
installed in the container as well. The default ffmpeg
package can be installed by adding PACKAGES=ffmpeg
as an environment variable, but this version does not have omx support.
I've had a quick look at what would be required to compile it from source. It looks like the package libomxil-bellagio
, which is required to build ffmpeg
with omx support, is not available in the Alpine Linux repositories.
You might have better luck with an alternative Raspbian based Homebridge Docker image. I haven't used any I can recommend, but here is an example of building ffmpeg
with omx using resin/rpi-raspbian:jessie
as the base image:
https://github.com/alexellis/raspberrypi-youtube-streaming/blob/master/Dockerfile
from docker-homebridge.
@jeylites would you mind posting your step by step instructions on how you got your additional images up and running? I'm really struggling! Thank you!
from docker-homebridge.
@VeniceNerd sure... this is what I have gathered from @oznu
### SETUP BASED ON RASPBERRY PI 3
Prerequisite
- Plan your container & service names
- Create a docker-compose.yml file on txt or atom
Here is an example of mine of four homebridge service running. Named as follow...
- homebridge
- homeoutside
- homeinside
- homecam
version: '2'
services:
homebridge:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config:/homebridge
environment:
- PGID=1000
- PUID=1000
homeoutside:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config-homeoutside:/homebridge
environment:
- PGID=1000
- PUID=1000
homeinside:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config-homeinside:/homebridge
environment:
- PGID=1000
- PUID=1000
homecam:
image: oznu/homebridge:raspberry-pi
restart: always
network_mode: host
volumes:
- ./config-homecam:/homebridge
environment:
- PGID=1000
- PUID=1000
- PACKAGES=ffmpeg
Follow instructions on Step 1 & Step 2
3. Create Docker Compose Manifest
Create a new directory and change into it:
mkdir /home/pi/homebridge
cd /home/pi/homebridge
Create a new file called docker-compose.yml using nano:
- refer to prerequisite file, copy the content to nano
nano docker-compose.yml
Start it using these steps:
-
cd /home/pi/homebridge
-
Run
docker-compose up -d
- this will launch the first container in the background. -
Edit the ./config/config.json file .
You need to change some Homebridge config settings to make sure it does not conflict with your first instance:
Homebridge Port - change it away from the default 51826
Homebridge Username - change it away from the default CC:22:3D:E3:CE:30- make sure you only use hexadecimal characters
Homebridge Name - Optional. This makes it easy to identify which instance is which in iOS.
These can all be changed in the config.json file created after you run the container for the first time.
from docker-homebridge.
Hi @oznu I been wanting to ask on the following but I keep forgetting. After tinkering for a while, I noticed there are two ways to get the instances going.
A) like you suggested, create the instances within the same directory like below
B) create an individual directory & nano.yml files for each instances like below.
The question is, are there right & wrong to Step A or Step B? because they both seem to work.
from docker-homebridge.
After testing for a few days now on Setup A and B, setup B seem to load Homebridge faster than Setup A . Again I’m not sure on the right and wrong of this setup.
from docker-homebridge.
Hi - thanks for laying it all out here. I ran into similar issues and got it running after going through this post. I'm also curious about the A and B setup. Which is better? I noticed you could do both and they still work.
I also see you have got ffmpeg running on a different post. That's probably going to be my next step once I get this right.
from docker-homebridge.
I'm not sure myself which is right or wrong. Currently, I have setup A running for a couple weeks without any problems, I'm will be testing setup B soon when my second Pi comes in.
Meanwhile, hopeful, we could get @oznu comments on this.
from docker-homebridge.
Digging up this old thread from Google - I've got homebridge running on my Synology, but want to add a 2nd Home. I've followed the steps above by changing the Port, Username, and Name.
I'm getting errors on the 2nd container that "Error: listen EADDRINUSE: address already in use :::51826"
Are those ports that both containers are trying to use? Suggestions?
from docker-homebridge.
from docker-homebridge.
Related Issues (20)
- Automated build process needs to create a release package HOT 2
- Add Docker tag in footer HOT 2
- Homebridge failed to install using the Homebridge on Portainer guide HOT 7
- Exposing port 8000 HOT 3
- docker publish should has a version tag not just ubuntu HOT 7
- QNAP Installation with Container Station 3 - Wiki Updates HOT 6
- Homebridge keep restarting after update HOT 3
- IPv6 issue on first run. Need to disable IPv6 in container HOT 3
- Step by Step process to upgrade Node.js and Homebridge HOT 4
- Node errors in logs when starting container with Portainer HOT 2
- Lost configuration after container restart / host reboot HOT 2
- mDNS in a Docker container HOT 4
- `UIX_CUSTOM_PLUGIN_PATH` env var has no effect HOT 3
- Command exexcute .sh file HOT 1
- Cannot connect to ui HOT 4
- Is Docker-Hombridge a limited version of Homebridge, with which you cannot control a second Raspberry with a .sh command? HOT 4
- dbus and other pids are deleted off the host HOT 2
- HB based Docker container doesn't appear to be correctly interfacing with system AVHI-daemon per documentation HOT 6
- How to install latest android-tools/adb inside Homebridge Docker container? HOT 5
- .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-homebridge.