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
- 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. - Install esptool.py and make it available on your PATH. If you used esp-open-sdk then this is done already.
- Checkout esp-open-rtos and set SDK_PATH environment variable pointing to it.
- 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
- Copy wifi.h.sample -> wifi.h and edit it with correct WiFi SSID and password:
cp wifi.h.sample wifi.h
vi wifi.h
- 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
- Configure settings:
- 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
- If you're debugging stuff, or have troubles and want to file issue and attach log, please enable DEBUG output:
export HOMEKIT_DEBUG=1
- Depending on your device, it might be required to change the flash mode:
(see issue #80)export FLASH_MODE=dout
- If you use ESP8266 with 4MB of flash (32m bit), then you're fine. If you have
- Build:
cd esp-homekit-demo/examples/esp8266-rgb-w-led-strip
make -C . all
- 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
- 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
- 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
- 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).