Skip to content

Dual RBG and White LED strip HomeKit controller on one ESP8266

License

Notifications You must be signed in to change notification settings

EG-Julien/esp8266-rgb-w-led-strip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose of this software

This software is meant to be flashed on an esp8266, connected with an RGB LED strip and a White LED strip. It is able to drive all colors of the strip from 0 to 100% dimmable via multichannel pwm. Warning : White LED Strip command is inverted ! (N-Channel MOSFET used)

Homekit integration

No bridge is required. Instead, this project uses the esp-homekit implementation found here: https://github.com/maximkulkin/esp-homekit to directly connect with homekit controller devices.

Installation

  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 /path/to/esp-open-sdk/xtensa-lx106-elf/bin.
  2. Install esptool.py and make it available on your PATH. If you used esp-open-sdk then this is done already.
  3. Checkout esp-open-rtos and set SDK_PATH environment variable pointing to it.
  4. Clone esp-homekit-demo (for archive purposes forked here) and initialize all submodules (recursively):
git clone https://github.com/maximkulkin/esp-homekit-demo
cd esp-homekit-demo
git submodule update --init --recursive
  1. Copy wifi.h.sample -> wifi.h and edit it with correct WiFi SSID and password:
cp wifi.h.sample wifi.h
vi wifi.h
  1. Clone this project into the examples subfolder and copy config.h.sample -> config.h. Set correct config options afterwards:
cd examples
git clone https://github.com/EG-Julien/esp8266-rgb-w-led-strip.git
cd esp8266-rgb-w-led-strip
cp config.h.sample config.h
vi config.h
  1. Configure settings:
    1. If you use ESP8266 with 4MB of flash (32m bit), then you're fine. If you have 1MB chip, you need to set following environment variables:
    export FLASH_SIZE=8
    export HOMEKIT_SPI_FLASH_BASE_ADDR=0x7a000
    1. If you're debugging stuff, or have troubles and want to file issue and attach log, please enable DEBUG output:
    export HOMEKIT_DEBUG=1
    1. Depending on your device, it might be required to change the flash mode:
    export FLASH_MODE=dout
    (see issue #80)
  2. Build:
cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
make -C . all
  1. 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
  1. To prevent any effects from previous firmware (e.g. firmware crashing right at start), highly recommend to erase flash:
    cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
    make -C . erase_flash
  1. Upload firmware to ESP:
    cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
    make -C . test

or

    cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
    make -C flash
    make -C monitor

or

    cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
    ./build.sh
  1. Open Home app on your device, and click '+'. If Home does not recognize the ESP8266, proceed to adding device anyways by entering code.

Troubleshooting

Try to monitor the ESP8266 while it's executing the software:

    cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
    make -C . monitor

It is often also a good idea to reset the ESP (cutoff power).