Coder Social home page Coder Social logo

andreacucci / sonoff-esp8266-homekit Goto Github PK

View Code? Open in Web Editor NEW
61.0 23.0 15.0 18 KB

Firmware to control your Sonoff natively and directly through HomeKit.

License: Apache License 2.0

Makefile 16.29% C 77.39% Shell 6.31%
homekit homekit-device sonoff esp8266 esp8266-homekit

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

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

Watchers

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

sonoff-esp8266-homekit's Issues

Set GPIO14 as a momentary toggle pin

It would be great if out of the gate this was configured to have GPIO14 as a momentary toggle pin.

This way we could solder pins onto 3.3V and GPIO14 and build out our own manual toggle switch.

This feature seems pretty useful. I understand that is is all pretty subjective but still valuable.

Support for Sonoff POW

hey, would it be possible to get this to work with the sonoff pow?
mainyl only the switching func would be cool.

Problems getting it to work

I can't seem to get the firmware working on a Sonoff THV1.1 (Sonoff Basic).

The firmware compiles just fine with 40Mhz SPI speed, but the Sonoff never connects to the network.
I edited user_main.c and turning on the LED just before it connects to the network and turn it off when the network has actually been connected.

However, the LED never turns on, not when powered from the mains connection and not when powered from the FTDI.

Flashing the simple blink program to it works fine. Adding the Arduino ESP Wifi library to that works as well. It successfully connects to the network.

If it has worked, what am I doing wrong? Could it be because the ESP seems to be an 8285 instead of an 8266 like the library was build for?

WiFi config

Hello,

Is it possible to change wifi configuration without reflashing?

Many thanks.

erase firmware and re-flash didn't work

Hi
I have problem with connecting sonoff device to the wi-fi network
I try to erase flash with command
esptool.py --port /dev/ttyUSB0 erase_flash
after that, I upload firmware again but now it continuously reset
I try to upload other firmware like espurna, it work ok without problem
connect to wifi without a problem
burned compiled home kit flash again, and it again continuously reset
Also, try flash empty 1mb_bin to address 0x000000
how described on this page http://www.pratikpanda.com/completely-format-erase-esp8266-flash-memory/
and reflash home kit firmware again, it again continuously reset
I try to do the same on 2 unit
and both units didn't connect to the network when I first flash home kit firmware
and both continuously reset after erase_flash command
Someone know why I cant upload homekit firmware after erase_flash ?

any plans for other sonoff devices?

are there any plans for implementing other similar sonoff devices?

detailed instructions how to start off from a bare linux machine would be also very helpful

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.