This is my take on Sonoff powered ceiling lights. Following projects inspired me, so be sure to check them out as well:
- https://github.com/Gruppio/Sonoff-Homekit
- https://github.com/maximkulkin/esp-homekit-demo
- https://github.com/maximkulkin/esp-homekit-demo/wiki/Build-instructions-ESP8266-(Docker)
Ensure Python is installed:
asdf install
pip install esptool pyserial
asdf reshim python
git submodule update --init --recursive
The Docker build will take a while (~30 min), so grab a coffee:
docker-compose build
Update the Wi-Fi config in src/wifi.h
:
#define WIFI_SSID "ssid"
#define WIFI_PASSWORD "password"
export ESPPORT=/dev/cu.usbserial-1420
The proper device can be found running ls /dev/*usb*
. For an ESP connected via
an UART use the /dev/cu.usbserial-*
device, for USB use
/dev/tty.usbserial-*
.
export SDK_PATH=`realpath ./esp-open-rtos`
docker-compose run --rm rtos make -C src all
Please ensure to put the Sonoff in flash/programming mode by pressing the button before connecting the UART cable.
make -C src flash
If there are any problems writing the firmware try resetting the Sonoff:
make -C src erase_flash
To monitor the Sonoff, you can use the following:
make -C src monitor