GithubHelp home page GithubHelp logo

particle-hap's Introduction

particle-hap

Particle HAP is proof of concept to connection Photon to Homekit, directly, without any in-the-middle HAP JS server.

BIG THANKS TO:

I've used lot of inspiration and code from this repositories. I would really thanks.

Video

Example video of pairing and handling.

Watch the video

Configuration

//TCP for handling server port
#define TCP_SERVER_PORT 5115
//Maximum pairings available. Apple recommends 16. But be aware, one pairings needs (36+32)B of your EEPROM
#define MAX_PAIRINGS 16
//if you are using EEPROM, you can set offset for Homekit to store pairings
#define EEPROM_STORAGE_ADDRESS_OFFSET 512

//ID of device, must be unique per device
#define deviceIdentity "5D:C6:5E:50:CE:38"
//Device name, which will be visible during pairing. Should be unique per device, so user can distinguish devices.
#define deviceName "particle"
//Pairing code, should be unique per device
#define devicePassword "523-12-643"

Also be aware that there's constant ACCESSORY_KEY (in HKConsts.h). Should be unique per device. I've used constant just to save memory. But it can be a security leak.

Integration

For integration with your project, look in particle-hap.ino.

HKServer hkServer;

void setup() {
  //call to setup TCP Server, Bonjour etc.
  hkServer.setup();
  //implement this method to create custom accessory
  initAccessorySet();

  //uncomment this to clean all paired devices, you will need this a lot when you will debug homekit ;)
  //hkServer.persistor->resetPersistor();
}

// loop() runs over and over again, as quickly as it can execute.
void loop() {
  //call this to handle incoming TCP connections
  hkServer.handle();
}

Dependencies

There are no library dependencies. All the crypto is based on WolfSSL, but highly customized to work on Photon.

Known major issues

  • no major issues currently known

What's planned:

  • stability issues - but minor ones
  • more accessory types in examples (programmable switch, sensors)

Goal:

  • integration with Nixie Clocks so it will support Non-commercial HAP.

Compiling project

When you're ready to compile your project, make sure you have the correct Particle device target selected and run particle compile <platform> in the CLI or click the Compile button in the Desktop IDE. The following files in your project folder will be sent to the compile service:

  • Everything in the /src folder, including your .ino application file
  • The project.properties file for your project

Contribution

Any contributions are more than welcomed. I would prefer to create PR instead of just posting an issues.

Hire us:

We are two guys, freelancers. We develop Android, iOS applications mostly. We also did some parts of FW for Nixie Clock and of course its iOS app. Just contact me at [email protected]

Licence

Copyright 2019 Lukas Jezny

Licensed under the GNU LPL license.

particle-hap's People

Contributors

ljezny avatar hbierau avatar

Watchers

James Cloos avatar

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.