Code Monkey home page Code Monkey logo

sonoff-esp8266-homekit's Introduction

Sonoff-HomeKit implementation

Firmware to control your Sonoff natively and directly through HomeKit.

Only iTead Sonoff Basic is supported.

Build instructions for Sonoff-Homekit

Prerequisites

Build Instructions

Setting your WiFi

If you did not set up your WiFi, do so by uncommenting the first block of code in the user_init routine and filling the SSID and password. After, do not forget to to comment it out again and remove your password. Its bad for flash to write it each time and you would not want to upload your password to GitHub by accident.

Compiling

~$ export SDK_PATH=<your SDK directory>
~$ export BIN_PATH=<where your binaries will be>
~$ cd Sonoff-ESP8266-HomeKit
~/Sonoff-ESP8266-HomeKit$ ./gen_misc.sh

Use all the defaults or experiment with alternatives...
This will create (after several minutes) the files:

  • $BIN_PATH/eagle.flash.bin
  • $BIN_PATH/eagle.irom0text.bin

If you answer all the questions by default, ESP8266-HomeKit will need more space than originally foreseen in ESP8266_RTOS_SDK 1.5.0 which was to start irom at 0x20000. To address this it is needed to change the ESP8266_RTOS_SDK/ld/eagle.app.v6.ld file:

diff ld/eagle.app.v6.ld.0 ld/eagle.app.v6.ld
29c29,30
<   irom0_0_seg :                       	org = 0x40220000, len = 0x5C000
---
> /*irom0_0_seg :                       	org = 0x40220000, len = 0x5C000 */
>   irom0_0_seg :                       	org = 0x40214000, len = 0x67000

for convenience also change the master ESP8266_RTOS_SDK/Makefile:

diff ESP8266/source/ESP8266_RTOS_SDK-master-v1.5.0/Makefile Makefile 
271c271
< 	@echo "eagle.irom0text.bin---->0x20000"
---
> 	@echo "eagle.irom0text.bin---->0x14000"

Flashing:

esptool.py --baud 230400 -p /dev/yourUSBid write_flash 0x00000 $BIN_PATH/eagle.flash.bin 0x14000 $BIN_PATH/eagle.irom0text.bin

Usage:

  • After boot, if the device is not yet paired, an srp-key is calculated in about 25 seconds
  • After that the server starts and mulicastdns starts to advertize
  • The default pincode is 031-45-154
  • The code writes clients keys to sector 0x13000
  • After you unpair from the original device, the keys will be destroyed and you can pair again.
  • if something went wrong, go to the foundation, and change the signature string to something else and you can start from scratch

sonoff-esp8266-homekit's People

Watchers

 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.