You are on page 1of 8

Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

nfarina / homebridge

Dismiss
Join GitHub today
GitHub is home to over 28 million developers
working together to host and review code,
manage projects, and build software together.

Sign up

Install Homebridge on Windows (old)


PatcherMustermann edited this page on 6 Mar · 5 revisions

Pages 25
Updated: 06 March 2018
Find a Page…

A simplified Windows installation


Home
procedure can be found at the Wiki page:
Install HomeBridge on Windows 10 (new) Backup and Restore

Basic Troubleshooting

Easy Install Raspberry PI


(With Start with boot)
Created by PatcherMustermann FreeNAS 11 Installation using
a Jail

FreeNAS 11.1 Installation


Updated: 09 July 2016 using a Jail

FreeNAS 9.10 BSD Jail


- General information:
FreeNAS 9.3 and 9.10 Jail
Installation
This How-to is for Windows 7 & 10 64BIT (Windows 7
& 10 32BIT is untested). Homebridge autostart at
boot (init.d) on Ubuntu
All programs installed with 32BIT except Microsoft (linux)

Visual Studio and Apple Bonjour. HomeKit Glossary of Terms

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 1 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

- Step 1: You need following software Install Homebridge on


macOS
1 - GIT 2.8.3 32BIT (https://git-
Install Homebridge on
scm.com/download/win) Windows (old)

2 - Visual Studio Community 2015 Install HomeBridge on


(https://www.visualstudio.com/products/visual-studio- Windows 10 (new)

community-vs) Intel Edison

3 - Python 2.7.11 32BIT Migration Guide

(https://www.python.org/downloads/) Show 10 more pages…

4 - Open SSL 1.0.2h 32BIT


Clone this wiki locally
(http://slproweb.com/products/Win32OpenSSL.html)
https://github.com/nfarina/homebridg
5 - Nodejs v5.0.0 32BIT
(https://nodejs.org/en/download/releases/)

6 - Bonjour for Developers 3.0.0.10


(https://developer.apple.com/bonjour/)

6.1 - Alternate download location for Bonjour SDK


(http://www.softpedia.com/get/Programming/SDK-
DDK/Bonjour-SDK.shtml)

7 - getopt.h & getopt.c


(http://www.codeproject.com/KB/cpp/getopt4win/geto
pt_mb_uni_src.zip)

8 - unistd.h (do it yourself => Source:


https://github.com/KhaosT/HAP-NodeJS/issues/113)

8.1 - Create a file named unistd.h

8.2 - Open the file unistd.h with Notepad

8.3* - Copy following text in the file unistd.h =>


Version of Patcher (https://github.com/KhaosT/HAP-
NodeJS/issues/113)

#ifndef _UNISTD_H
#define _UNISTD_H 1

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 2 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

/* This file intended to serve as a drop-in


replacement for

unistd.h on Windows
Please add functionality as neeeded */

#include
#include
#include
#include /* for getpid() and the exec..()
family /
#include / for _getcwd() and _chdir() */

#define srandom srand


#define random rand

/* Values for the second argument to


access.
These may be OR'd together. /
#define R_OK 4 / Test for read permission.
/
#define W_OK 2 / Test for write permission.
/
//#define X_OK 1 / execute permission -
unsupported in windows/
#define F_OK 0 / Test for existence. */

#define access _access


#define dup2 _dup2
#define execve _execve
#define ftruncate _chsize
#define unlink _unlink
#define fileno _fileno
#define getcwd _getcwd
#define chdir _chdir
#define isatty _isatty
#define lseek _lseek
/* read, write, and close are NOT being
#defined here, because while there are file
handle specific versions for Windows, they
probably don't work for sockets. You

need to look at your app and consider


whether to call e.g. closesocket(). */

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 3 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

#define ssize_t int

#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* should be in some equivalent to */
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;

#endif /* unistd.h */

8.3* - Or copy following text in the file unistd.h =>


Version of WilliamHF
(https://github.com/nfarina/homebridge/issues/402)

#ifndef _UNISTD_H
#define _UNISTD_H 1

/* This file intended to serve as a drop-in


replacement for

unistd.h on Windows
Please add functionality as neeeded */

/* #include
#include
#include
#include */ /* for getpid() and the exec..
() family /
#include / for _getcwd() and _chdir() */

#define srandom srand


#define random rand

/* Values for the second argument to


access.
These may be OR'd together. /

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 4 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

#define R_OK 4 / Test for read permission.


/
#define W_OK 2 / Test for write permission.
/
//#define X_OK 1 / execute permission -
unsupported in windows/
#define F_OK 0 / Test for existence. */

#define access _access


#define dup2 _dup2
#define execve _execve
#define ftruncate _chsize
#define unlink _unlink
#define fileno _fileno
#define getcwd _getcwd
#define chdir _chdir
#define isatty _isatty
#define lseek _lseek
/* read, write, and close are NOT being
#defined here, because while there are file
handle specific versions for Windows, they
probably don't work for sockets. You

need to look at your app and consider


whether to call e.g. closesocket(). */

#define ssize_t int

#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* should be in some equivalent to */
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef signed __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;

#endif /* unistd.h */

8.4 - Save the file unistd.h

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 5 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

- Step 2: Install with the following order


# - The Windows User-Account must have
administrator rights!

1 - Visual Studio Community (C:\Program Files


(x86)\Microsoft Visual Studio 14.0)

2 - Python (C:\Python27) => By user settings: Enable


path

3 - Open SSL (C:\OpenSSL-Win32)

4 - GIT (C:\Program Files (x86)\Git)

5 - Nodejs (C:\Program Files (x86)\nodejs)

6 - Bonjour for Developers (C:\Program Files


(x86)\Bonjour SDK)

Note the Bonjour SDK installer will ignore requests


to install to a different directory and always install
to C:\Program Files (x86)\Bonjour SDK. If you'd
like it in a different directory, just move the folder
and update the BONJOUR_SDK_HOME
Environment Variable to match the new location.

7 - RESTART Computer

8 - Copy getopt.h, getopt.c and unistd.h to


"C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include"

9 - RESTART Computer

- Step 3: Configuration Visual Studio


# - The Windows User-Account must have
administrator rights!

1 - Open Visual Studio Community and create a C++


Project to install "dev environment"

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 6 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

2 - RESTART Computer

- Step 4: Running Homebridge


# - The Windows User-Account must have
administrator rights!

# - xxx = Your Windows Username (C:\Users\xxx...)

1 - Start GIT-CMD

2 - Console command: npm install -g homebridge

2.1 - If npm install fails with error C2373:


"__pfnDliNotifyHook2", try the workaround here:
https://stackoverflow.com/questions/38149603/npm-
install-fails-with-error-c2373-with-vs2015-update-3

3 - Console command: npm install -g homebridge-


http

4 - Check if folder "C:\Users\xxx\.homebridge" exists


=> The folder is invisible!

4.1 - When folder "C:\Users\xxx\.homebridge" not


exists you create this over Windows-CMD

4.1.1 - Open Windows-CMD

4.1.2 - CD C:\Users\xxx\

4.1.3 - mkdir .homebridge

5 - Copy "config-sample.json" from


"C:\Users\xxx\AppData\Roaming\npm\node_modules\
homebridge-http" to "C:\Users\xxx\.homebridge"

5.1 - Rename the "config-sample.json" to "config.json"


(C:\Users\xxx\.homebridge)

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 7 of 8
Install Homebridge on Windows (old) · nfarina/homebridge Wiki · GitHub 06/12/2018, 21)17

6 - Console command: cd
C:\Users\xxx\AppData\Roaming\npm\node_modules\h
omebridge\bin

7 - Console command: node homebridge

8 - Homebridge runs hopefully :)

8.1 - If iOS apps cannot pair to HomeBridge, you may


need to add a firewall rules to allow port 51826
(Control Panel > System Security > Windows Firewall
> Advanced Settings > Create New Rule to allow TCP
51826)

https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-Windows-(old) Page 8 of 8

You might also like