Coder Social home page Coder Social logo

dominikhorn / esp8266-rgb-led-strip Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 5.0 20 KB

This software is able to power an ESP8266 driven RGB LED strip. It integrates with HomeKit natively (no bridge needed)

License: Other

Makefile 4.51% C 93.16% Shell 2.32%
homekit esp esp8266 iot custom rgb ledstrip led led-strips bridgeless

esp8266-rgb-led-strip's Introduction

Purpose of this software

This software is meant to be flashed on an esp8266, connected with an RGB LED strip. It is able to drive all colors of the strip from 0 to 100% dimmable via multichannel pwm.

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/DominikHorn/esp8266-rgb-led-strip.git
cd esp8266-rgb-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-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-led-strip
    make -C . erase_flash
  1. Upload firmware to ESP:
    cd esp-homekit-demo/examples/esp8266-rgb-led-strip
    make -C . test

or

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

or

    cd esp-homekit-demo/examples/esp8266-rgb-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-led-strip
    make -C . monitor

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

Circuitry

Bare in mind that I have not studied electronics engineering an am merely a software engineer with hobby interests in the subject. As far as I can tell my setup allows for max 3A at 12V, meaning with the LED Strip I used, 3m is the maximum possible length!

I roughly followed ideas from this tutorial/project.

My components/setup:

  • 1x esp8266. I prefer the NodeMCU version because it's PCB comes with a USB controlling unit and port built in. This allows for fast debugging and most importantly you may reflash easily even after soldering. Alternatively you can use a standard ESP8266 with a programmer unit, and solder only a mount to your custom pcb.
  • 1x RGB LED Strip
  • 1x DC Power Supply (12V, x Amps). Make sure this delivers enough power to drive you LED Strip length and doesn't exceed the maximum 3A at which the transistor, dc jack and step down module are rated!
  • 1x DC 12V 3A power jack female
  • 1x DC DC step-down module for driving esp8266 from 12V power supply
  • insulated electric wire (preferably multiple colors, makes your life easier)
  • 3x IRF3205 TO220 Hexfet power mosfet transistors
  • 1x prototype PCB

Optional

  • 1x SMD button if you wish to physically turn the strip on/off

I ordered my components from aliexpress.com. Bellow is a list of all things I ordered:

esp8266-rgb-led-strip's People

Contributors

dominikhorn avatar kenthinson avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

esp8266-rgb-led-strip's Issues

Some problems of build it

I hope all is well.I am an amateur.
When I saw your post, I found that I was attracted to it all at once, it was really cool, I wanted to learn it.
Your introduction is very detailed. I tried it many times according to it, but I still failed. I am very depressed. I really want to overcome the difficulties and then implement it.
I want to create a RGB light, but I really don't know what to do, so I am looking for your help, can you tell me the specific steps to establish? Maybe I have installed the environment, I pray that you give me an example, tell me how to build it, through video or article.
I would appreciate your help.I look forward to hearing from you.

Maybe you can help me.

Sorry to bother you again and express your greetings. I still didn't succeed in building my own firmware, so I want to help you build it. If you are convenient, it would be great, my WiFi name: Xiang; my WiFi password: 13277564899, they all include only letters and numbers, no symbols and no spaces. If you can help, I will thank you very much. I wish you a happy life. Thank you very much

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.