Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

HomeKit enabled firmware for the itead Sonoff TH10/16. Based on the OPEN ESP RTOS.

License

Notifications You must be signed in to change notification settings

cduvenhorst/sonoff-th-homekit

Repository files navigation

sonoff-th-homekit

An alternative firmware for the (6€) itead Sonoff TH10/TH16. This firmware supports the Apple HomeKit framework and the QR-Code pairing for it (PoC).

Prerequisites for building OTA-Update-Images is the presence of openssl and the esptool2 on your system.

Usage

  1. Install esp-open-sdk, build it with make toolchain esptool libhal STANDALONE=n, then edit your PATH and add the generated toolchain bin directory. The path will be something like /$HOME/path/to/esp-open-sdk/xtensa-lx106-elf/bin.

  2. Checkout esp-open-rtos and set SDK_PATH environment variable pointing to it. E.g. export SDK_PATH=$HOME/espressif/esp-open-rtos

  3. Initialize and sync all submodules (recursively):

git submodule update --init --recursive
  1. Install required python modules for QR-Code creation:
pip install pyqrcode pypng
  1. Create a new QR-Code for HomeKit pairing as every device on your network needs a unique setup id.:
make homekitSettings

Print the QR-code ('qrcode.png') and stick it on the device (or save it on a safe place for documentation). 6. Set your environment variables to match your needs:

  • Set ESPPORT environment variable pointing to USB device your ESP8266 is attached to (assuming your device is at /dev/tty.SLAB_USBtoUART):
    export ESPPORT=/dev/tty.SLAB_USBtoUART
  • Set your OTA-Update server environment variables.
    • Set the server

      export OTA_UPDATE_SERVER="192.168.1.2"
    • Set the port

      export OTA_UPDATE_PORT="8080"
    • Set the path on the server to the firmware files:

      export OTA_UPDATE_PATH="/ota/sonoff-th"
    • Name your firmware files (defaults to "latest"):

      export OTA_UPDATE_FIRMWARE_NAME="latest"
  1. To prevent any effects from previous firmware, it is highly recommended to erase flash:
        make erase_flash
    or, if you didn't set the ESPPORT environment variable:
        make erase_flash ESPPORT=/dev/tty.SLAB_USBtoUART
  2. Flash the firmware on the Sonoff TH10/TH16
    make -j4 test

or

    make -j4 flash
    make monitor

OTA-Updates

Again: Prerequisites for building OTA-Update-Images is the presence of openssl and the esptool2 on your system.

If you just (later) want to compile the OTA firmware images just enter

    make -j4 ota-images

and copy the compiled, linked and hashed firmware images to your update server (using the path you have chosen at compilation time).

You'll find the files in the firmware/ota directory. Copy ALL files to your webserver directory accessible via your chosen update server path.

To initiate an OTA update of the device, just long-press the device button (4 secs and on) on an already flashed device.

About

HomeKit enabled firmware for the itead Sonoff TH10/16. Based on the OPEN ESP RTOS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published