Giter VIP home page Giter VIP logo

hap-nodejs's Introduction

Homebridge

Unlocking Door

Homebridge is a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.

Since Siri supports devices added through HomeKit, this means that with Homebridge you can ask Siri to control devices that don't have any support for HomeKit at all. For instance, using just some of the available plugins, you can say:

  • Siri, unlock the back door. [pictured to the right]
  • Siri, open the garage door.
  • Siri, turn on the coffee maker.
  • Siri, turn on the living room lights.
  • Siri, good morning!

You can explore all available plugins at the NPM website by searching for the keyword homebridge-plugin.

Community

The official Homebridge Discord server and Reddit community are where users can discuss Homebridge and ask for help.

Homebridge Discord Homebridge Reddit

HomeKit communities can also be found on both Discord and Reddit.

Installation

raspbian

Raspberry Pi

Official Homebridge Raspberry Pi Image
Install Homebridge on Raspbian


linux

Linux

Debian or Ubuntu Linux | Red Hat, CentOS or Fedora Linux | Arch / Manjaro Linux|Install Homebridge on Arch Linux


macos

macOS

Install Homebridge on macOS


windows

Windows 10 / 11

Install Homebridge on Windows 10 / 11 Using Hyper V


docker

Docker

Install Homebridge on Docker
Synology | Unraid | QNAP | TrueNAS Scale


docker

Synology DSM

Install Homebridge on Synology DSM 7

Other Platforms

Other Platforms

Adding Homebridge to iOS

  1. Open the Home app on your device.
  2. Tap the Home tab, then tap .
  3. Tap Add Accessory, then scan the QR code shown in the Homebridge UI or your Homebridge logs.

If the bridge does not have any accessories yet, you may receive a message saying Additional Set-up Required, this is ok, as you add plugins they will show up in the Home app without the need to pair again (except for Cameras and TVs).

Cameras and most TV devices are exposed as separate accessories and each needs to be paired separately. See this wiki article for instructions.

Interacting with your Devices

Once your device has been added to HomeKit, you should be able to tell Siri to control your devices. However, realize that Siri is a cloud service, and iOS may need some time to synchronize your device information with iCloud.

One final thing to remember is that Siri will almost always prefer its default phrase handling over HomeKit devices. For instance, if you name your Sonos device "Radio" and try saying "Siri, turn on the Radio" then Siri will probably start playing an iTunes Radio station on your phone. Even if you name it "Sonos" and say "Siri, turn on the Sonos", Siri will probably just launch the Sonos app instead. This is why, for instance, the suggested name for the Sonos accessory is "Speakers".

Plugin Development

The https://developers.homebridge.io website contains the Homebridge API reference, available service and characteristic types, and plugin examples.

The Homebridge Plugin Template project provides a base you can use to create your own platform plugin.

There are many existing plugins you can study; you might start with the Homebridge Example Plugins or a plugin that already implements the device type you need.

When writing your plugin, you'll want Homebridge to load it from your development directory instead of publishing it to npm each time. Run this command inside your plugin project folder so your global installation of Homebridge can discover it:

npm link

You can undo this using the npm unlink command.

Then start Homebridge in debug mode:

homebridge -D

This will start up Homebridge and load your in-development plugin. Note that you can also direct Homebridge to load your configuration from somewhere besides the default ~/.homebridge, for example:

homebridge -D -U ~/.homebridge-dev

This is very useful when you are already using your development machine to host a "real" Homebridge instance (with all your accessories) that you don't want to disturb.

Common Issues

Home App Says Accessory Already Added

To fix this, Reset Homebridge.

My iOS App Can't Find Homebridge

Try the following:

  1. Swap between the Bonjour HAP and Ciao mDNS Advertiser options. See the wiki for more details.
  2. iOS DNS cache has gone stale or gotten misconfigured. To fix this, turn airplane mode on and back off to flush the DNS cache.

Limitations

  • One bridge can only expose 150 accessories due to a HomeKit limit. You can however run your plugins as a Child Bridge or run Multiple Homebridge Instances to get around this limitation.
  • Once an accessory has been added to the Home app, changing its name via Homebridge won't be automatically reflected in iOS. You must change it via the Home app as well.

Why Homebridge?

Technically, the device manufacturers should be the ones implementing the HomeKit API. And I'm sure they will - eventually. When they do, this project will be obsolete, and I hope that happens soon. In the meantime, Homebridge is a fun way to get a taste of the future, for those who just can't bear to wait until "real" HomeKit devices are on the market.

Credit

Homebridge was originally created by Nick Farina.

The original HomeKit API work was done by Khaos Tian in his HAP-NodeJS project.

hap-nodejs's People

Contributors

alistairg avatar arnthorsnaer avatar bwp91 avatar codyc1515 avatar dependabot[bot] avatar donavanbecker avatar ebaauw avatar grover avatar hjdhjd avatar hobbyquaker avatar htreu avatar khaost avatar maddox avatar mschm avatar mzyy94 avatar n0rt0nthec4t avatar neophob avatar nfarina avatar northernman54 avatar origamidream avatar oznu avatar pdlove avatar planetbeing avatar rhit-pabbaac avatar rlovelett avatar samuelthomas2774 avatar shaquu avatar snowdd1 avatar sszczep avatar supereg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hap-nodejs's Issues

Push characteristics update to iOS device

Hi,

is there a way to push change of state outside of HAP to iOS? I try to control accessories provided by openHAB (a home automation gateway) where the state of an accessory can change without HAP´s notice. Even if I listen on the changes from outside in HAP-NodeJS I can't get the update pushed to iOS.

Thanks and kudos for both, HAP-NodeJS and HomeKitDemo.

Cheers,
henning

question about sending different commands via true or false statements?

I'm trying to figure out how to send two different commands depending on if the command is to turn OFF or ON. I'm just using http requests in this application.
Right now it sends the same command with either the OFF or ON command and it works great except I can only send either ON or OFF depends on what I use in the http link, is there any way to have a OR statement with two different links to send either ON or OFF depending if the target state is true or false?

See my example below.

},{
cType: types.POWER_STATE_CTYPE,
onUpdate: function(value)
{ request("http://192.168.1.100/kitchen%20Light%20on") , console.log("Change:",value); execute("Rear Kitchen Light", "Light - Power State", value); },

perms: ["pw","pr","ev"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Turn On the Light",
designedMaxLength: 1

child_process/python script integration

Attempting to run a python script throw child_process. Receiving a SyntaxError..
Suggestions?

// HomeKit types required
var types = require("./types.js")
var exports = module.exports = {};
var exec = require('child_process').exec;

var execute = function (accessory, characteristic, value) {
console.log("executed accessory: " + accessory + ", and characteristic: " + characteristic + ", with value: " + value + ".");
}

exports.accessory = {
displayName: "Light 1",
username: "1A:2B:3C:4D:5E:FF",
pincode: "031-45-154",
services: [{
sType: types.ACCESSORY_INFORMATION_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Light 1",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
}, {
cType: types.MANUFACTURER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Oltica",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
}, {
cType: types.MODEL_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Rev-1",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
}, {
cType: types.SERIAL_NUMBER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "A1S2NASF88EW",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
}, {
cType: types.IDENTIFY_CTYPE,
onUpdate: null,
perms: ["pw"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Identify Accessory",
designedMaxLength: 1
}]
}, {
sType: types.LIGHTBULB_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Light 1",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
}, {
cType: types.POWER_STATE_CTYPE,
onUpdate: function (value) {
target = "off";
if (value === true) {
target = "on";
}
exec('python path/to/script', function (error, stdout, stderr) {},
perms: ["pw", "pr", "ev"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Turn On the Light",
designedMaxLength: 1
}, {
cType: types.HUE_CTYPE,
onUpdate: function (value) {
console.log("Change:", value);
execute("Test Accessory 1", "Light - Hue", value);
},
perms: ["pw", "pr", "ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Hue of Light",
designedMinValue: 0,
designedMaxValue: 360,
designedMinStep: 1,
unit: "arcdegrees"
}, {
cType: types.BRIGHTNESS_CTYPE,
onUpdate: function (value) {
console.log("Change:", value);
execute("Test Accessory 1", "Light - Brightness", value);
},
perms: ["pw", "pr", "ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Brightness of Light",
designedMinValue: 0,
designedMaxValue: 100,
designedMinStep: 1,
unit: "%"
}, {
cType: types.SATURATION_CTYPE,
onUpdate: function (value) {
console.log("Change:", value);
execute("Test Accessory 1", "Light - Saturation", value);
},
perms: ["pw", "pr", "ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Saturation of Light",
designedMinValue: 0,
designedMaxValue: 100,
designedMinStep: 1,
unit: "%"
}]
}]
}

push a message to the HAP-Server and update the characteristics of an accessory

Hey KhaosT,

is it possible to send a msg to the HAP-Server to modify the value of a characteristic of an accessory?

my homematic equipment is able to send notifications when its state changes (e.g. light on/off, thermostat value change..)

If i read the value with my iOS app - valueForUpdate() in
https://github.com/KhaosT/HAP-NodeJS/blob/master/Characteristic.js#L95
is called.

So i could for example add a "onRead()" method similar to "onUpdate()" method in an accessory like you did it here:
https://github.com/KhaosT/HAP-NodeJS/blob/master/Characteristic.js#L34

but i think it´s a bad practice to do something like a sync http call in my imaginary onRead() method.
(because i would need to wait for the answer)

would be nicer if i could push a message to the HAP-Server and update the characteristics of an accessory.

i would appreciate your thoughts

best regards
tristan

Install Issue - node-gyp

I reinstalled using node version 0.10.36....
now when I run npm install -g node-gyp
I get a Trace/breakpoint trap

Should I also be downgrading npm?

ty

HAP is not starting on Raspberry PI

Hi, I like the idea of using HAP as a replacement for SiriProxy.
So I installed NodeJS on a Raspberry PI. It is v0.10.28 that I installed. according to these instructions: http://raspberryalphaomega.org.uk/2014/06/11/installing-and-using-node-js-on-raspberry-pi/

Then I get the HAP-NodeJS SW.

When I run npm rebuild it get this:

root@raspberrypi:~/HAP# npm rebuild

[email protected] install /root/HAP/node_modules/curve25519
node-gyp rebuild

gyp ERR! clean error
gyp ERR! stack Error: EACCES, unlink 'build'
gyp ERR! System Linux 3.6.11+
gyp ERR! command "node" "/opt/node-v0.10.28-linux-arm-pi/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/HAP/node_modules/curve25519
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the curve25519 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls curve25519
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.6.11+
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "rebuild"
npm ERR! cwd /root/HAP
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/HAP/npm-debug.log
npm ERR! not ok code 0

Any idea, suggestion ?

KR, Rudy

Unable to pair with accessory

I can successfully browse accessories and get past the initial pairing process by entering the correct PIN code, however on "Step 5", the NodeJS server crashes with:

New Session 49514
Server Connection Established 50124
Start Pair M1
Start Pair M3
Start Pair M5

buffer.js:188
        throw new TypeError('First argument needs to be a number, ' +
              ^
TypeError: First argument needs to be a number, array or string.
    at new Buffer (buffer.js:188:15)
    at Buffer (buffer.js:158:12)
    at Object.processPairStepFive (/Users/nick/Downloads/HAP-NodeJS-master/Server.js:325:27)
    at Object.processPairStepFour (/Users/nick/Downloads/HAP-NodeJS-master/Server.js:309:9)
    at Object.processPairStepThree (/Users/nick/Downloads/HAP-NodeJS-master/Server.js:292:8)
    at Object.processPairSequence (/Users/nick/Downloads/HAP-NodeJS-master/Server.js:224:11)
    at IncomingMessage.<anonymous> (/Users/nick/Downloads/HAP-NodeJS-master/Server.js:39:17)
    at IncomingMessage.emit (events.js:95:17)
    at IncomingMessage.<anonymous> (_stream_readable.js:764:14)
    at IncomingMessage.emit (events.js:92:17)

From my rudimentary debugging thus far, it seems the serverLTPK var is undefined here. But I'm not sure what that means exactly.

problem with npm rebuild

hey guys, im trying to build this on raspberry pi and i run into problems im hoping you guys can help with:

pi@raspberrypi ~/HAP-NodeJS $ npm rebuild

[email protected] install /home/pi/HAP-NodeJS/node_modules/curve25519
node-gyp rebuild

make: Entering directory '/home/pi/HAP-NodeJS/node_modules/curve25519/build'
CXX(target) Release/obj.target/curve/node_curve.o
SOLINK_MODULE(target) Release/obj.target/curve.node
SOLINK_MODULE(target) Release/obj.target/curve.node: Finished
COPY Release/curve.node
make: Leaving directory '/home/pi/HAP-NodeJS/node_modules/curve25519/build'

[email protected] install /home/pi/HAP-NodeJS/node_modules/srp/node_modules/bignum
node-gyp configure build

make: Entering directory '/home/pi/HAP-NodeJS/node_modules/srp/node_modules/bignum/build'
make: Nothing to be done for 'all'.
make: Leaving directory '/home/pi/HAP-NodeJS/node_modules/srp/node_modules/bignum/build'
[email protected] /home/pi/HAP-NodeJS/node_modules/curve25519
[email protected] /home/pi/HAP-NodeJS/node_modules/js-nacl
[email protected] /home/pi/HAP-NodeJS/node_modules/node-hkdf
[email protected] /home/pi/HAP-NodeJS/node_modules/node-hkdf/node_modules/vows
[email protected] /home/pi/HAP-NodeJS/node_modules/node-hkdf/node_modules/vows/node_modules/eyes
[email protected] /home/pi/HAP-NodeJS/node_modules/node-persist
[email protected] /home/pi/HAP-NodeJS/node_modules/node-persist/node_modules/mkdirp
[email protected] /home/pi/HAP-NodeJS/node_modules/node-persist/node_modules/underscore
[email protected] /home/pi/HAP-NodeJS/node_modules/node-persist/node_modules/sugar
[email protected] /home/pi/HAP-NodeJS/node_modules/srp
[email protected] /home/pi/HAP-NodeJS/node_modules/srp/node_modules/bignum

pi@raspberrypi ~/HAP-NodeJS $ node Core.js

module.js:340
throw err;
^
Error: Cannot find module 'mdns'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/pi/HAP-NodeJS/Advertiser.js:1:74)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

pi@raspberrypi ~/HAP-NodeJS $ npm install mdns
npm WARN package.json [email protected] No repository field.
/

[email protected] install /home/pi/HAP-NodeJS/node_modules/mdns
node-gyp rebuild

make: Entering directory '/home/pi/HAP-NodeJS/node_modules/mdns/build'
CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
In file included from ../src/dns_sd.cpp:1:0:
../src/mdns.hpp:31:20: fatal error: dns_sd.h: No such file or directory
compilation terminated.
dns_sd_bindings.target.mk:128: recipe for target 'Release/obj.target/dns_sd_bindings/src/dns_sd.o' failed
make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1
make: Leaving directory '/home/pi/HAP-NodeJS/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.12.28+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/HAP-NodeJS/node_modules/mdns
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.28+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "mdns"
npm ERR! cwd /home/pi/HAP-NodeJS
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Adding Multiple Accessories?

I read the instructions on adding multiple accessories and it says
"Duplicate one of the accessory scripts in the accessories folder."

So I just added another file called Light_accessory2.js inside the accessories folder and edited the name serial number and UID. then I started the server again but it doesn't show the new device.
These are the parts I changed....

displayName: "Kitchen Light",
username: "1A:2B:3C:4D:5E:FE"

initialValue: "Kitchen Light",

initialValue: "A2S2NASF88EW",

also all the ones that pertain to the ON, Hue, Brightnes, and Saturation

onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 2", "light service", value); },

Sorry for the dumb question, but is there anywhere else to reference that I have added a new accessory?

Unable to delete accessory

I have an accessory "stuck" in my iOS app. When I attempt to delete it, nothing happens in the client, but HAP-NodeJS outputs "Handle Remove Pairing Info". I am currently looking for solutions.

Asking Siri for a status, doesn't do anything on the server

Hi,

I have setup HAP-NodeJS on a Raspberry Pi and also written a simple iOS HomeKit enabled app. I have connected the iOS app with the GarageDoorOpener.

If I tell Siri to open / close the garage, everything works fine. But if I ask about the door status, I always get an wrong answer.

Does anybody have an idea whats wrong? Do I need to set anything else?
Normally CURRENT_DOOR_STATE_CTYPE should be called on the server or?

Banana Pi Core.js startup error

I get this when i start HAP on a BananaPi:

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
HAP-NodeJS starting...
abort:  ??6??????_

==== Stack trace ============================================

Security context: 0x28134659 <JS Object>#0#
    1: cD [/home/pi/homekit/HAP-NodeJS/node_modules/js-nacl/lib/nacl_factory.js:~7020] (this=0x28134701 <JS Global Object>#1#,a=115216,b=115216,d=115472)
    2: cT [/home/pi/homekit/HAP-NodeJS/node_modules/js-nacl/lib/nacl_factory.js:7633] (this=0x28134701 <JS Global Object>#1#,a=114168,b=114296)
    3: cR [/home/pi/homekit/HAP-NodeJS/node_modules/js-nacl/lib/nacl_factory.js:7569] (this=0x28134701 <JS Global Object>#1#,b=114168,c=114040)
    4: _crypto_sign_ed25519_keypair(aka ck) [/home/pi/homekit/HAP-NodeJS/node_modules/js-nacl/lib/nacl_factory.js:6575] (this=0x5f61e909 <an Object>#2#,b=5357576,c=5357616)
    5: crypto_sign_keypair [/home/pi/homekit/HAP-NodeJS/node_modules/js-nacl/lib/nacl_factory.js:26278] (this=0x3ef23641 <an Object>#3#)
    6: new AccessoryInfo [/home/pi/homekit/HAP-NodeJS/Accessory.js:64] (this=0x3ef67a61 <an AccessoryInfo>#4#,displayName=0x20cfda59 <String[3]: Fan>,username=0x20cfda69 <String[17]: CC:22:3D:EE:5E:FA>,pincode=0x20cfda89 <String[10]: 031-45-154>)
    8: new Accessory [/home/pi/homekit/HAP-NodeJS/Accessory.js:30] (this=0x3ef67925 <an Accessory>#5#,displayName=0x20cfda59 <String[3]: Fan>,username=0x20cfda69 <String[17]: CC:22:3D:EE:5E:FA>,persistStore=0x5f6d3e59 <an Object>#6#,targetPort=51826,pincode=0x20cfda89 <String[10]: 031-45-154>,accessoryController=0x3ef66199 <an AccessoryController>#7#)
   10: /* anonymous */ [/home/pi/homekit/HAP-NodeJS/Core.js:68] (this=0x5f6d3f25 <an Object>#8#,exports=0x5f6d3f25 <an Object>#8#,require=0x5f6d3e8d <JS Function require>#9#,module=0x5f6d3e65 <a Module>#10#,__filename=0x20c325e1 <String[35]: /home/pi/homekit/HAP-NodeJS/Core.js>,__dirname=0x5f6d3f11 <String[27]: /home/pi/homekit/HAP-NodeJS>)
   12: _compile [module.js:456] (this=0x5f6d3e65 <a Module>#10#,content=0x20c331c9 <Very long string[2920]>#11#,filename=0x20c325e1 <String[35]: /home/pi/homekit/HAP-NodeJS/Core.js>)
   13: .js [module.js:474] (this=0x5f6d3d5d <an Object>#12#,module=0x5f6d3e65 <a Module>#10#,filename=0x20c325e1 <String[35]: /home/pi/homekit/HAP-NodeJS/Core.js>)
   14: load [module.js:356] (this=0x5f6d3e65 <a Module>#10#,filename=0x20c325e1 <String[35]: /home/pi/homekit/HAP-NodeJS/Core.js>)
   15: _load [module.js:312] (this=0x5f6d3d91 <JS Function Module>#13#,request=0x20c33d4d <String[35]: /home/pi/homekit/HAP-NodeJS/Core.js>,parent=0x28108081 <null>,isMain=0x281080b1 <true>)
   16: runMain [module.js:497] (this=0x5f6d3d91 <JS Function Module>#13#)
   17: startup [node.js:119] (this=0x28134701 <JS Global Object>#1#)
   18: /* anonymous */ [node.js:906] (this=0x28134701 <JS Global Object>#1#,process=0x5f6d400d <a process>#14#)

Am I missing a lib? thanks

npm rebuild fails

npm rebuild fails with curve

[email protected] install /home/pi/HAP-NodeJS/node_modules/curve25519
node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/pi/HAP-NodeJS/node_modules/curve25519/build'
CXX(target) Release/obj.target/curve/node_curve.o
../node_curve.cc:13:37: error: ‘Arguments’ does not name a type
../node_curve.cc:13:46: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../node_curve.cc:16:37: error: ‘Arguments’ does not name a type
../node_curve.cc:16:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value DoCurve(const int&)’:
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../node_curve.cc:17:15: error: within this context
../node_curve.cc:19:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../node_curve.cc:20:44: error: ‘New’ is not a member of ‘v8::String’
../node_curve.cc:20:63: error: ‘ThrowException’ was not declared in this scope
../node_curve.cc:22:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:23:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:24:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:26:20: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate_)’
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h: In function ‘void init(v8::Handlev8::Object)’:
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../node_curve.cc:30:15: error: within this context
../node_curve.cc:31:43: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handlev8::Object&, const char [6], v8::Handlev8::Value (&)(const int&))’
../node_curve.cc:31:43: note: candidate is:
/home/pi/.node-gyp/0.12.0/src/node.h:228:13: note: template void node::NODE_SET_METHOD(const TypeName&, const char_, v8::FunctionCallback)
curve.target.mk:81: recipe for target 'Release/obj.target/curve/node_curve.o' failed
make: *** [Release/obj.target/curve/node_curve.o] Error 1
make: Leaving directory '/home/pi/HAP-NodeJS/node_modules/curve25519/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.18.7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/HAP-NodeJS/node_modules/curve25519
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok

npm ERR! Linux 3.18.7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "rebuild"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the curve25519 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls curve25519
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/HAP-NodeJS/npm-debug.log

Status of Accessories

Hi,
Really like the project, but I sometimes have an issue, where siri states that it cannot perform the action at the moment. However, when I say to turn off the accessory before turning it on then it seems to work.
My question is does it know the state of the device hence it has to be turned off?

Thanks

Error starting Core.js

Hello, im having problems starting the Core.js.
This is what i get when i try to start HAP-NodeJS:

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister

/home/pi/HAP-NodeJS/accessories/._Light_accessory.js:1
(function (exports, require, module, __filename, __dirname) {
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at accessories (/home/pi/HAP-NodeJS/Core.js:21:24)
at Array.forEach (native)
at Object. (/home/pi/HAP-NodeJS/Core.js:19:53)
at Module._compile (module.js:456:26)

Can anyone help me?

Thank you very much

wemo

Can this work with belkin wemo wirless plug socket ? because i cant get mine too work

npm rebuild issue

Hi,

I am trying to use the HAP server,but while using command npm rebuild it generated error saying Cannot open include file: 'unistd.h'. I am using node js v0.10.32 in windows 7 32 bit system

Cant get it to work with ubuntu

[email protected] install /root/HAP-NodeJS/node_modules/curve25519
node-gyp rebuild

make: Entering directory /root/HAP-NodeJS/node_modules/curve25519/build' CXX(target) Release/obj.target/curve/node_curve.o SOLINK_MODULE(target) Release/obj.target/curve.node SOLINK_MODULE(target) Release/obj.target/curve.node: Finished COPY Release/curve.node make: Leaving directory/root/HAP-NodeJS/node_modules/curve25519/build'

[email protected] install /root/HAP-NodeJS/node_modules/mdns
node-gyp rebuild

make: Entering directory /root/HAP-NodeJS/node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o In file included from ../src/dns_sd.cpp:1:0: ../src/mdns.hpp:31:20: fatal error: dns_sd.h: No such file or directory #include <dns_sd.h> ^ compilation terminated. make: *** [Release/obj.target/dns_sd_bindings/src/dns_sd.o] Error 1 make: Leaving directory/root/HAP-NodeJS/node_modules/mdns/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 2.6.32-24-pve
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/HAP-NodeJS/node_modules/mdns
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mdns
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-24-pve
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "rebuild"
npm ERR! cwd /root/HAP-NodeJS
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/HAP-NodeJS/npm-debug.log
npm ERR! not ok code 0

iOS 8.3 not working.

Hey guys I've had this working fine for a few months but I upgraded to 8.3 this week and my homekit devices are all greyed out in the iPhone. I tried restarting both iPhone and the server but no dice.
Is anyone using it with latest iOS update?
Incidentally the iPhone does see the simulator app on my Mac just fine. I can see the devices on my network with bonjour browser so I know they are there. Any suggestions?

Not able to start server

I have installed nodejs 0.10.36 in Mac 10.10.0

Rebuild it
and tried to run like
node Core.js

I am getting this error. its not able to start.
Can you pls check whats the issue ?


module.js:340
throw err;
^
Error: Cannot find module './build/Release/curve'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/Users/Sam/Documents/Homekit/Server/HAP-NodeJS-master/node_modules/curve25519/index.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Error while installing on rPI2

Hello,
I get this error when I try to install node-gyp on my rPI2. Hope anyone could help me.

sudo npm install -g node-gyp
abort: m??$0??0????%:????:??$

==== Stack trace ============================================

Security context: 0x4f334659 #0#
1: _parse(aka parse) [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extended-header.js:~61](this=0x39984c45 #1#,c=0x3998a4f5 #2#)
2: emit [events.js:95](this=0x39984c45 #1#,type=0x56f14839 <String[4]: data)
3: arguments adaptor frame: 2->1
4: _read [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:111](this=0x39984c45 #1#)
8: _read [native v8natives.js:1594](this=0x39984c45 #1#)
9: write [/usr/local/lib/node_modules/npm/node_modules/tar/lib/entry.js:68](this=0x39984c45 #1#,c=0x3998a4f5 #2#)
10: _process [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:105](this=0x39914d6d #3#,c=0x3998a47d #4#)
11: /* anonymous _/ [/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:47](this=0x39914de5 #5#,c=0x3998a47d #4#)
12: emit [events.js:95](this=0x39914de5 #5#,type=0x56f14839 <String[4]: data)
13: arguments adaptor frame: 2->1
14: emitChunk [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:145](this=0x39914de5 #5#,flush=0x4f308091 <undefined)
15: arguments adaptor frame: 0->1
16: resume [/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:~55](this=0x39914de5 #5#)
17: arguments adaptor frame: 1->0
18: resume [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/reader.js:~251](this=0x39914d6d #3#,who=0x4f308091 <undefined)
19: arguments adaptor frame: 0->1
20: /
anonymous / [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extract.js:57](this=0x39914f6d #6#)
21: emit [events.js:92](this=0x39914f6d #6#,type=0x35efd1a9 <String[5]: ready)
22: /
anonymous / [/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:39](this=0x4f334701 #7#,er=0x4f308081 <null)
23: arguments adaptor frame: 2->1
24: /
anonymous */ [/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:29](this=0x4f334701 #7#,er=0x4f308081 <null)
26: oncomplete [fs.js:108](this=0x3995a521 #8#)
27: arguments adaptor frame: 1->0

==== Details ================================================

[1]: _parse(aka parse) [/usr/local/lib/node_modules/npm/node_modules/tar/lib/extended-header.js:~61](this=0x39984c45 #1#,c=0x3998a4f5 #2#) {
// stack-allocated locals
var i = 260
var l = 410
var b = 67
var val = 0x3998b399 <String[4]: File>
// expression stack (top to bottom)
[05] : 0
[04] : 2086534
--------- s o u r c e c o d e ---------
function parse(c) {? if ........
......
.....

Errors Installing on a Raspberry Pi

I have already successfully installed and launched HAP-NodeJS on a Ubuntu 14 VM

On the RPi, I have already performed the following:

  • apt-get update
  • apt-get install nodejs npm git-core libnss-mdns libavahi-compat-libdnssd-dev
  • git clone https://github.com/KhaosT/HAP-NodeJS.git
  • cd HAP-NodeJS
  • npm rebuild node-gyp not found
  • npm install -g node-gyp failed to fetch from registry
  • npm config set registry http://registry.npmjs.org/ fix failed to fetch from registry
  • npm install -g node-gyp fix node-gyp not found

Continue to receive these error messages

root@raspberrypi:~/HAP-NodeJS# npm rebuild

> [email protected] install /root/HAP-NodeJS/node_modules/curve25519
> node-gyp rebuild

/usr/bin/env: node: No such file or directory

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 127
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the curve25519 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls curve25519
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 3.12.28+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "rebuild"
npm ERR! cwd /root/HAP-NodeJS
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: node-gyp rebuild
npm ERR! message sh "-c" "node-gyp rebuild" failed with 127
npm ERR! errno {}
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
npm WARN /usr/share/doc/nodejs/README.Debian
npm WARN
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/HAP-NodeJS/npm-debug.log
npm not ok
root@raspberrypi:~/HAP-NodeJS#

value via http request php or http ?

I explain

I value my sensors that are readable via a http request via php. they are the forms: value $ 1, $ 2 value ...

how to Recuper in the HAP-nodejs, I tried several things but it does not work!

I would like for example:

ctype: types.CURRENT_TEMPERATURE_CTYPE,
onUpdate: function (value) {console.log ("Change", value); execute ("thermostat", "Current Temperature", value); },
perms: ["pr", "ev"]
format: "int"
initialValue: 26
supportevents: false,
supportBonjour: false,
manfDescription: "Current Temperature"
unit: "celsius"

in place of initialValue: 26: have my value $ value1

Need HomeKitDemo-Source

The link in the Wiki leads to a "page not found".
There are several other HomeKitDemo - but the one i tried shows multiple error message.
Can someone provide a link to the code?
Thx
Thorsten

Failed to start Core.js on Intel Edison

Failed to start this app on Intel Edison. See logs below. Any pre-configuration needed on Intel Edison?
root@edison:/.node_app_slot# node Core.js
/home/root/.node_app_slot/node_modules/mdns/lib/dns_sd.js:35
throw ex;
^
Error: /home/root/.node_app_slot/node_modules/mdns/build/Release/dns_sd_bindings.node: invalid ELF header
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/root/.node_app_slot/node_modules/mdns/lib/dns_sd.js:24:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
root@edison:
/.node_app_slot#

Thanks.

Using GPIOs on Raspberry Pi

Hi!
I managed to get the HAP-NodeJS installed and working on my Raspberry with the example accessories.
I'd like now to add an accessory that drives a GPIO output, but I can't understand how to do that.
I suppose I have to copy one of the accessories and edit the values, but I wasn't able to understand how to call some kind of function or command in the terminal when the value of a characteristic changes...
Any help would be appreciated!
Thanks in advace,
Luca

PS: Thanks @KhaosT for your awesome work!

Acessories

Hi,
I am trying to create another light accessory, i.e. I used the existing Light_accessory.js to control the living room lights, and created a new file - BedRoomLight_accessory.js -
with the following -

// HomeKit types required
var types = require("./types.js")
var exports = module.exports = {};

exports.accessory = {
displayName: "Bedroom Light",
username: "1A:2B:3C:4D:5E:FF",
pincode: "031-45-154",
services: [{
sType: types.ACCESSORY_INFORMATION_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Bedroom Light",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
},{
cType: types.MANUFACTURER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "HomeEasy",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
},{
cType: types.MODEL_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Rev-1",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
},{
cType: types.SERIAL_NUMBER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "A2S2NASF99EW",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
},{
cType: types.IDENTIFY_CTYPE,
onUpdate: null,
perms: ["pw"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Identify Accessory",
designedMaxLength: 1
}]
},{
sType: types.LIGHTBULB_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Bedroom Light",
supportEvents: false,
supportBonjour: false,
manfDescription: "Bla",
designedMaxLength: 255
},{
cType: types.POWER_STATE_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 1", "light service", value); },
perms: ["pw","pr","ev"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Turn On the Light",
designedMaxLength: 1
},{
cType: types.HUE_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 1", "Light - Hue", value); },
perms: ["pw","pr","ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Hue of Light",
designedMinValue: 0,
designedMaxValue: 360,
designedMinStep: 1,
unit: "arcdegrees"
},{
cType: types.BRIGHTNESS_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 1", "Light - Brightness", value); },
perms: ["pw","pr","ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Brightness of Light",
designedMinValue: 0,
designedMaxValue: 100,
designedMinStep: 1,
unit: "%"
},{
cType: types.SATURATION_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 1", "Light - Saturation", value); },
perms: ["pw","pr","ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "Adjust Saturation of Light",
designedMinValue: 0,
designedMaxValue: 100,
designedMinStep: 1,
unit: "%"
}]
}]
}

I've restarted the server, but I am unable to see the new bedroom light accessory on my iphone.
Any ideas what I'm missing.

Thanks

Starting shell command

Hi,
i have it now compiled and run as expected.
2 questions:
a) how to start a shell commando from the Accessory script? I want to control KNX connected devices via "eibd" (command is "groupswrite ip:192.168.0.100 3/4/5 1" to switch on the light, 0 to switch off....)

b) i copied an accessory script and changed the Username and display name & restarted Core.js - but looks like Core.js does not detect a 2nd accessory. What else is required.

Thx.
Thorsten

Power-State:onUpdate

I added gpio to my project. In the onUpdate section. Very similar to the gist you have of it. However it never activates the gpio.

When I cut and past the code to its own file, it works just fine. So I know that's good. Have anything changed which would cause it not to work

Yosemite DNS service error

I've followed the steps in Readme.md, but after running node Core.js I get the following error:

> $ node Core.js
HAP-NodeJS starting...
TCP server accepting connection on port: 51826
HAP Server is listening
TCP server accepting connection on port: 51828
HAP Server is listening
TCP server accepting connection on port: 51832
HAP Server is listening
TCP server accepting connection on port: 51838
HAP Server is listening
TCP server accepting connection on port: 51846
HAP Server is listening

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: dns service error: unknown
    at Advertisement.on_service_registered (/Users/jeffhuijsmans/Development/HAP-NodeJS/node_modules/mdns/lib/advertisement.js:42:24)
    at SocketWatcher.MDNSService.self.watcher.callback (/Users/jeffhuijsmans/Development/HAP-NodeJS/node_modules/mdns/lib/mdns_service.js:18:40)

Are there some extra steps to take on OS X?

Communication across different networks

Does the apple Home Kit supports communicating across different networks.
let say i want to turn off my heater sitting in office which i forget to switch off in home..
How this works??

Compile errors during npm rebuild

I've followed the instructions on the Wiki to build this on my Raspberry Pi, however when running npm rebuild. I get the below compile errors.

Probably something really obvious I've not done but I have no idea now.

Any ideas?


[email protected] install /home/pi/homekit/HAP-NodeJS/node_modules/curve25519
node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory '/home/pi/homekit/HAP-NodeJS/node_modules/curve25519/build'
CXX(target) Release/obj.target/curve/node_curve.o
../node_curve.cc:13:37: error: ‘Arguments’ does not name a type
../node_curve.cc:13:46: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
../node_curve.cc:16:37: error: ‘Arguments’ does not name a type
../node_curve.cc:16:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value DoCurve(const int&)’:
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../node_curve.cc:17:15: error: within this context
../node_curve.cc:19:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../node_curve.cc:20:44: error: ‘New’ is not a member of ‘v8::String’
../node_curve.cc:20:63: error: ‘ThrowException’ was not declared in this scope
../node_curve.cc:22:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:23:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:24:61: error: invalid types ‘const int[int]’ for array subscript
../node_curve.cc:26:20: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate_)’
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h: In function ‘void init(v8::Handlev8::Object)’:
/home/pi/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../node_curve.cc:30:15: error: within this context
../node_curve.cc:31:43: error: no matching function for call to ‘NODE_SET_METHOD(v8::Handlev8::Object&, const char [6], v8::Handlev8::Value (&)(const int&))’
../node_curve.cc:31:43: note: candidate is:
/home/pi/.node-gyp/0.12.0/src/node.h:228:13: note: template void node::NODE_SET_METHOD(const TypeName&, const char_, v8::FunctionCallback)
curve.target.mk:81: recipe for target 'Release/obj.target/curve/node_curve.o' failed
make: *** [Release/obj.target/curve/node_curve.o] Error 1
make: Leaving directory '/home/pi/homekit/HAP-NodeJS/node_modules/curve25519/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2

afetr server run, accesories must stay in scanning ...

i'm problem
after the server run :

HAP-NodeJS starting...
TCP server accepting connection on port: 51826
HAP Server is listening
TCP server accepting connection on port: 51828
HAP Server is listening
New Session 51674
Server Connection Established 35766
New Session 51672
Server Connection Established 43971
Client Disconnected
Server Disconnected
Client Disconnected
Server Disconnected
New Session 51682
Server Connection Established 43972
New Session 51684
Server Connection Established 43973

and the accesories must stay in "scanning"

error on thermostat accessory var update_char_iid = update_char["iid"];

Trying to test the thermostat_accessory and it gives me an error when I try and speak with Siri to adjust the temperature. This is what I get. I'm using the thermostat_accessory.js file as it was originally so I haven't modified it.

/root/HAP-NodeJS/AccessoryController.js:52
var update_char_iid = update_char["iid"];
^
TypeError: Cannot read property 'iid' of undefined
at Object.processCharacteristicsValueWrite (/root/HAP-NodeJS/AccessoryController.js:52:36)
at Object.responseCharacteristic (/root/HAP-NodeJS/Server.js:112:29)
at IncomingMessage. (/root/HAP-NodeJS/Server.js:53:17)
at IncomingMessage.emit (events.js:95:17)
at IncomingMessage. (stream_readable.js:764:14)
at IncomingMessage.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:426:10)
at emitReadable (_stream_readable.js:422:5)
at readableAddChunk (_stream_readable.js:165:9)
at IncomingMessage.Readable.push (_stream_readable.js:127:10)

If I manually go into the thermostat in the iOS app and click on the target temp field it lets me set the target temp and it works and shows up in the log.

Any ideas?
I tried searching but this error doesn't look like it's come up before, maybe a syntax problem or one of my files have a typo?
Sorry to keep bothering you, I really appreciate all the help :)

Siri does not recognize secondary home?

I have now installed HAP-NodeJS in my office and added a second Home with a room "office".
Asking Siri to switch off the lights by naming the second home: "switch off light " work's.
But "switch off light" does not work, Siri says the devices are not responding.
I suspect that Siri does not recognize that it's in a different home and tries to address the primary home or so. So somehow I need to tell Siri that I am in a different home or set the device up in a way that it concludes this.
Anyone any idea or experience?

Disconnection

When my phone goes on standby i get this message on the server:
Server Disconnected
Client Disconnected

and it will not auto reconnect when i unlock my phone, i have to restart the server to get it to reconnect to my phone but when it goes into stand by i have to restart the server.

Creating Outdoor Blinds Accessory

Hi guys.
I have been trying to create an accessory called Outdoor Blinds.
I have successfully created and added it by modifying the Garage door Opener accessory.
However... the commands such as Open the outdoor blinds and close the outdoor blinds do not work.
I get "it looks like you do not have an app called outdoor blinds"
the only command that works for me is "Open the garage door and Close the garage door" this is a bit of an issue because I have a garage door that I plan to add.
I know this is the accessory that is being called because the output correctly prints "Sent close to Outdoor Blinds"
The code that i have used is below:

// HomeKit types required
var types = require("./types.js")
var exports = module.exports = {};
var nc = require("node-cat");
var host = "xxx.xx.xx.xxx";
var port = "xxxx";

var types = require("./types.js")
var exports = module.exports = {};

var execute = function(accessory,characteristic,value){ console.log("executed accessory: " + accessory + ", and characteristic: " + characteristic + ", with value: " + value + "."); }

exports.accessory = {
displayName: "Outdoor Blinds",
username: "3C:51:3D:EE:5E:DB",
pincode: "031-45-154",
services: [{
sType: types.ACCESSORY_INFORMATION_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "OutDoor Blinds Opener",
supportEvents: false,
supportBonjour: false,
manfDescription: "Name of the accessory",
designedMaxLength: 255
},{
cType: types.MANUFACTURER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Oltica",
supportEvents: false,
supportBonjour: false,
manfDescription: "Manufacturer",
designedMaxLength: 255
},{
cType: types.MODEL_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Rev-1",
supportEvents: false,
supportBonjour: false,
manfDescription: "Model",
designedMaxLength: 255
},{
cType: types.SERIAL_NUMBER_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "OutdoorBlinds",
supportEvents: false,
supportBonjour: false,
manfDescription: "SN",
designedMaxLength: 255
},{
cType: types.IDENTIFY_CTYPE,
onUpdate: null,
perms: ["pw"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Identify Accessory",
designedMaxLength: 1
}]
},{
sType: types.GARAGE_DOOR_OPENER_STYPE,
characteristics: [{
cType: types.NAME_CTYPE,
onUpdate: null,
perms: ["pr"],
format: "string",
initialValue: "Outdoor Blinds Control",
supportEvents: false,
supportBonjour: false,
manfDescription: "Name of service",
designedMaxLength: 255
},{
cType: types.CURRENT_DOOR_STATE_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Garage Door", "Current State", value); },
perms: ["pr","ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "BlaBla",
designedMinValue: 0,
designedMaxValue: 4,
designedMinStep: 1,
designedMaxLength: 1
},{
cType: types.TARGET_DOORSTATE_CTYPE,
//onUpdate: function(value) { console.log("Change:",value); execute("Outdoor blinds", "Target State", value); },

onUpdate: function(value) { console.log("Change:",value); var client = nc.createClient(host, port);client.start(
function(client /* the tcp client returned by net.connect */, rl /* readline instance */, stdin, stdout)

{

if (value === 0) {
client.write("09tn01800BC^");
stdout.write("Sent Open to Outdoor Blinds.");
client.end();
}
if (value === 1) {
client.write("09tn01800BC^");
stdout.write("Sent Close to Outdoor Blinds.");
client.end();
}})
},
perms: ["pr","pw","ev"],
format: "int",
initialValue: 0,
supportEvents: false,
supportBonjour: false,
manfDescription: "BlaBla",
designedMinValue: 0,
designedMaxValue: 1,
designedMinStep: 1,
designedMaxLength: 1
},{
cType: types.OBSTRUCTION_DETECTED_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Garage Door", "Obstruction Detected", value); },
perms: ["pr","ev"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "BlaBla",
}]
}]
}

Does anybody have any idea how i might move forward with this??
As far as I know there is no generic door opener service.
Thanks guys.

Start Verify M1/M3

I have now 3 devices running, a lamp "window" (Licht Fenster), a lamp "cabinet" (Licht Schrankwand) and a power switch device "espresso machine" (Espressomaschine).
All react to Siri commands, the lamps on "Licht" plus "Fenster" or "Schrankwand", the espresso machine in fact on "Espresso Maschine", very good. Quite nice to say "all devices off" and the two lamps and the espresso machine get switched off one after the other. Fun!

In the first try the window light wouldn't pair, I see that every time a pairing fails if the "Verify M5" is not performed. Then the device is orphaned and doesn't show up in the discovery nor in the device list. I needed to reset HomeKit config, uninstall/reinstall the app, restart the phone etc. to get back to normal.
So the pairing process seems to be a bit fragile, currently can't see any factor influencing the failing of the pairing.

One thing that's disturbing now is that the HAP-NodeJS server would come up with "Start Verify M1" and "Start Verify M3" messages from time to time which take a few 10 seconds to complete.
During that time the HAP server is little responsive, it would take quite long until a command to a device would be executed or sometimes not at all, Siri saying the device could not be reached.
Attached a part of the log below, don't know if this helps.

HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
Change: true
executed accessory: Espressomaschine, and characteristic: power switch, with value: true.
HTTP response: 200
{"returnCode": true}
Change: false
executed accessory: Espressomaschine, and characteristic: power switch, with value: false.
HTTP response: 200
{"returnCode": true}
Change: false
executed accessory: Licht Schrankwand, and characteristic: light service, with value: false.
Change: false
executed accessory: Licht Fenster, and characteristic: light service, with value: false.
Change: false
executed accessory: Espressomaschine, and characteristic: power switch, with value: false.
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
Server Disconnected
Client Disconnected
Change: true
executed accessory: Licht Schrankwand, and characteristic: light service, with value: true.
Change: true
executed accessory: Licht Fenster, and characteristic: light service, with value: true.
Change: true
executed accessory: Espressomaschine, and characteristic: power switch, with value: true.
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
New Session 64982
Server Connection Established 39102
Start Verify M1
Start Verify M3
Verify Success
Change: false
executed accessory: Espressomaschine, and characteristic: power switch, with value: false.
HTTP response: 200
{"returnCode": true}
Change: false
executed accessory: Licht Schrankwand, and characteristic: light service, with value: false.
Change: false
executed accessory: Licht Fenster, and characteristic: light service, with value: false.
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
Change: true
executed accessory: Licht Schrankwand, and characteristic: light service, with value: true.
Change: true
executed accessory: Licht Fenster, and characteristic: light service, with value: true.
HTTP response: 200
{"returnCode": true}
HTTP response: 200
{"returnCode": true}
Server Disconnected
Client Disconnected
Server Disconnected
Client Disconnected
New Session 64986
New Session 64987
Server Connection Established 59086
Server Connection Established 34817
Start Verify M1
Start Verify M1
Start Verify M3
Verify Success
Start Verify M3
Verify Success
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
New Session 64991
Server Connection Established 39110
Start Verify M1
New Session 49506
Server Connection Established 59089
Start Verify M1
Start Verify M3
Verify Success
Start Verify M3
Verify Success
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
New Session 64992
New Session 64993
Server Connection Established 59091
Server Connection Established 34822
Start Verify M1
Start Verify M1
Start Verify M3
Verify Success
New Session 49510
New Session 49511
Start Verify M3
Verify Success
Server Connection Established 39115
Server Connection Established 34824
Start Verify M1
Start Verify M1
Start Verify M3
Verify Success
Start Verify M3
Verify Success
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
New Session 64997
Server Connection Established 39117
Start Verify M1
Start Verify M3
Verify Success
New Session 49518
Server Connection Established 59096
Start Verify M1
Start Verify M3
Verify Success
Server Disconnected
Client Disconnected
Server Disconnected
Client Disconnected
New Session 65001
Server Connection Established 59097
Start Verify M1
New Session 65002
Server Connection Established 34828
Start Verify M1
Start Verify M3
Verify Success
Start Verify M3
Verify Success
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected

addressing rgb light accessory

hello,

I've managed to address my RGB light via HAP-NodeJS. many thanks for that great piece of code. I have three issues right now:

  1. how do I configure that this light belongs to a room ?
  2. is it possible to write all three characterstics (HSL) within one onUpdate? I need to make http requests and if I change I color via the circle all three values are sent as single http requests. this makes my RGB flash a little. would love to set the color with just one statement for hue, saturation and brightness.
  3. is it possible to set the initial values and prefetch them via the brigde? I could get these initial values also via http request.

thanks!

iPhone not detecting accessories from RasPi

I have a similar issue, as discussed in #3 whereas when I run the server on my Mac everything works fine, the accessories show up and Siri commands get through.
Now after I got my Raspberry Pi B+ to run the server the console shoots me some warnings:

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>

but then continues with HAP-NodeJS starting... and TCP server accepting connection on port: 51826 and so on. Still my iPhone (as well as the iNet Bonjour Browser) won't detect any services.

What I've tried so far:

  • Run npm rebuild again
  • Reinstall node-gyp
  • Reinstall node from the Heroku repo
  • Restart the Pi
  • Restart the router
  • Restart the iPhone
  • Clone the HAP repo again

I really don't know what I'm doing wrong and any help is highly appreciated.
Thanks for the effort.

Update

When I run the server on my Mac and set up an accessory, cancel the server and run it on the Pi, I do see the iPhone's attempts on trying to verify the accessory, so there are commands coming through, the Pi is just not discoverable as it seems...

Airport extreme bonjour problem

Hi KHaosT,

Great updates to the HAP-NodeJS!
I have one question you could perhaps help me with. Recently I experience bonjour problems with my router (airport extreme) when using the HAP-NodeJS and other bonjour services (vnc, https, etc.). What happens is that bonjour services are not published correctly (disappear in Bonjour Browser or cannot be " unfolded" using the > button).
Do you have any idea on what causes this problem? Is there a way to debug my router (already factory reseted)? Is it simply up for an replacement, or could there something be caused by HAP-NodeJS or other services of mine (no recent changes).

Hopefully you can give me you first thought. I posted this as an issue for the case someone else experiences the same and can lookup the solution.

Thanks!

Roy

HAP server with Home Kit Tester

can this HAP server be used to communicate with Home Kit tester(HAT V1.0) running in Mac book . ? I tried running but the home kit simulator is not discovering the accessories.

Also while running the server I face the following warning

pi@raspberrypi ~/HAP-NodeJS $ node Core.js
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister

is this warning blocks the HAT to discover.??

Multiple Accessories

Hi KhaosT,

I would like to add more accessories to the hub. Could you give some tips on how to achieve this?
I've tried a couple of this and concluded that the target port for accessories need to be 2 apart to account for the read and write (+1) port. Besides this, my guess is that the serial numbers have to be unique.
Are these assumptions correct? Are there any other things I should keep in mind? Please note that I'm quite new to NodeJS etc.

With my try now I get the following error after I try to add a second accessory in the HomeKitDemo app.
buffer.js:188
throw new TypeError('First argument needs to be a number, ' +
^
TypeError: First argument needs to be a number, array or string.
at new Buffer (buffer.js:188:15)
at Buffer (buffer.js:158:12)
at Object.processPairStepFive (/home/xbian/HAP-NodeJS/Server.js:319:27)
at Object.processPairStepFour (/home/xbian/HAP-NodeJS/Server.js:303:9)
at Object.processPairStepThree (/home/xbian/HAP-NodeJS/Server.js:286:8)
at Object.processPairSequence (/home/xbian/HAP-NodeJS/Server.js:221:11)
at IncomingMessage. (/home/xbian/HAP-NodeJS/Server.js:38:17)
at IncomingMessage.emit (events.js:95:17)
at IncomingMessage. (_stream_readable.js:764:14)
at IncomingMessage.emit (events.js:92:17)

After this I have to restore HomeKit on my phone to get the first accessory working again.

Hopefully you can give me some pointers in the right direction. Thanks again!

Roy

Post http from NodeJs

Does anyone know how would I change the Light_accessory.js file to post http commands to a web server when I use home kit to turn ON or OFF a device?
I think this is the area I would alter, am I on the right track?

cType: types.POWER_STATE_CTYPE,
onUpdate: function(value) { console.log("Change:",value); execute("Test Accessory 1", "light service", value); },
perms: ["pw","pr","ev"],
format: "bool",
initialValue: false,
supportEvents: false,
supportBonjour: false,
manfDescription: "Turn On the Light",
designedMaxLength: 1

I was doing something like shown below with the Mac Homekit app,
I'm just not at all familiar when it comes to json.

if(characteristic.boolValue == YES){

        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://10.10.10.10/RunEventQS.asp?sValue=on"]];

        // Create url connection and fire request
        (void)[[NSURLConnection alloc] initWithRequest:request delegate:nil];
    }else{
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://10.10.10.10/RunEventQS.asp?sValue=off"]];

        // Create url connection and fire request
        (void)[[NSURLConnection alloc] initWithRequest:request delegate:nil];  

Sorry to keep posting on here with my issues...
Thanks in advance ;)

Remote connection question?

Does anyone have this same issue, when I leave the wifi network it stays connected and works for a number of hours via my Apple TV which is signed into my iCloud account but then it suddenly disconnects. And I can't issue any commands anymore and the devices show red.

I have to usually restart the server and sometimes the iPhone and Apple TV also to get it working again.

I get this in the log when it happens.....
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected
Server Disconnected
Server Disconnected
Client Disconnected
Client Disconnected

I'm using it on Ubuntu on an Intel machine.

multiple lights

Superb progress @KhaosT....
I've setup a light yesterday, modifying the Light_accessory.js file, and it works fine.
I'm attempting to add another light so I've duplicated my modified Light_accessory.js file ...given it a unique username, and changed the name.
I can add the new light and via the iOS app can switch both lights on and off correctly.
When i use siri to switch the light...no matter which light i address, both lights get switched on or off together.
Can i setup more than one device for each service type? or have i done something wrong somewhere?

Build Issue with Curve

On a fresh Raspbian install (following the Raspi install doc) I'm running into an error when building Curve. I am able to successfully install node-gyp, but when I run npm rebuild it errors out on the curve module. It's worth noting that if I do a node-gyp rebuild from the curve module it builds fine.

root@raspberrypi:/home/pi/HAP-NodeJS# npm rebuild

[email protected] install /home/pi/HAP-NodeJS/node_modules/curve25519
node-gyp rebuild

gyp ERR! clean error
gyp ERR! stack Error: EACCES, unlink 'build'
gyp ERR! System Linux 3.12.35+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/HAP-NodeJS/node_modules/curve25519
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the curve25519 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls curve25519
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.12.35+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "rebuild"
npm ERR! cwd /home/pi/HAP-NodeJS
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/HAP-NodeJS/npm-debug.log
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.