Setting up the Mini - Josh-Duncan/HomeBridge-Mini GitHub Wiki

Get Ubuntu Installed

  1. Install Ubuntu 16.04. SSH Server is the only non default option that I installed.

    Ubuntu 16.04

  2. Update Ubuntu to 18.04

    1. Apply the updates
    sudo apt update && sudo apt dist-upgrade && sudo apt autoremove
    
    1. I reboot for good measure (this is what happens when you're raised with Microsoft)

    2. Upgrade the OS

    sudo do-release-upgrade
    

    Ubuntu 18.04

  3. Update Ubuntu to 20.04

    sudo do-release-upgrade -d
    

    Ubuntu 18.04

Configure the OS

Set the Mac Mini so that it will restart on a power failure.

Thanks to Dioxaz's workshop for this solution, and explaining how to solve the problem for other models if this doesn't work.

  1. Create and update the rc.local file

    sudo nano /etc/rc.local
    
  2. Paste the following

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    setpci -s 0:03.0 0x7b.b=20
    exit 0
    
  3. Set the command

    sudo setpci -s 0:03.0 0x7b.b=20
    
  4. Restart to test

Install HomeBridge

The Prerequisites

  1. Install Node.js

    sudo apt install nodejs
    
  2. Install Node Package Manager

    sudo apt-get install npm 
    

HomeBridge

  1. Install the HomeBridge application

    sudo npm install -g --unsafe-perm homebridge
    
  2. Test execution

    homebridge
    

    Ubuntu 18.04

  3. Install HomeBridge config UI

    sudo npm install -g --unsafe-perm homebridge-config-ui-x
    
  4. Configure the config.json file

    sudo nano ~/.homebridge/config.json
    
    {
    	"bridge": {
    		"name": "Homebridge",
    		"username": "CC:22:3D:E3:CE:30",
    		"manufacturer": "homebridge.io",
    		"model": "homebridge",
    		"port": 51826,
    		"pin": "031-45-154"
    	},
    	"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
    	"ports": {
    		"start": 52100,
    		"end": 52150,
    		"comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
    	},
    	"platforms": [{
    		"platform": "config",
    		"name": "Config",
    		"port": 8080,
    		"log": {
       	"method": "file",
       	"path": "/var/log/homebridge.log"
       },
    		"service": "homebridge"
    	}]
    }
    
  5. Set Homebridge to auto start

    sudo hb-service install --user %username%