1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Tutorial] Wireless LED extension with ESP8266/ESP32 for Hyperion

Discussion in 'Hyperion Extensions' started by SciLor, 6 May 2018.

  1. SciLor

    SciLor Wireless extension DEV

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    In 2016 I have started to develop a general wireless extension for Hyperion with a ESP8266. I needed that to put some LEDs under my bed and connect them to my hyperion ambilight.
    Currently I also use it for my normal Ambilights behind my TVs to only have one Raspberry PI with two grabbers and to seperate the LEDs completely from my hifi-equipment, as the LEDs can behave like a big antenna.

    In addition you can control the esp standalone with the hyperion app.

    There already is a german tutorial here.

    Hardware
    You will need an ESP8266 or ESP32. This can be am embedden module on a NodeMCU or LOLIN32, too.
    Obviously you will need some LEDs and a power supply. This should be similar to hyperion, so you should be familiar with that. You can use any LED that is supported within FastLED.

    Software(Hyperion)
    Now it depents. You will need your own Hyperion instance for every Wireless extension you use. If you only have one set of wireless LEDs you can just change the device in the hyperion configuration:

    Code:
    {
          "colorOrder" : "rgb",
          "maxpacket" : 1450,
          "name" : "AmbiSZ-ESP8266",
          "output" : "ESP8266:19446", ///ip-address of the esp8266/esp32
          "protocol" : 0,
          "rate" : 250000,
          "type" : "udp"
    }
    If you have multple instances of hyperion you will need to forward the grabbers data from the first instance to the others.
    Another example for that is found here.

    The primary instance should be configurated to push the data to other instances. They can be on the same device or a different rapberry
    Code:
    "forwarder" :
    {
      "proto" : [ "127.0.0.1:20445","192.168.178.88:19445" ],
    }
    The recieving instance (I will take the localhost/127.0.0.1 from the list needs a server config:
    Code:
    "protoServer" :
    {
      "port" : 20445
    },
    Software(Arduino)
    Please always check the readme on GitHub.

    To program your esp you will need a working Arduino build environment.
    -Arduino IDE 1.8.5

    Board libs for the esp8266/esp32
    • Start Arduino and open Preferences window.
    • Add the urls below to the Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
    • Open Boards Manager from Tools > Board menu and find esp8266/esp32 platform.
    • Select the version you need from a drop-down box.
    • Click install button.
    • Don't forget to select your ESP8266/ESP32 board from Tools > Board menu after installation.
    a) esp8266 2.4.1 http://arduino.esp8266.com/stable/package_esp8266com_index.json
    b) for esp32 https://github.com/espressif/arduino-esp32

    Addition libs
    • Start Arduino and open Preferences window.
    • Open LibraryManager from Sketch > Include Library > Manage Libraries...
    • Select the version you need from a drop-down box.
    • Click install button.
    a) ArduinoThread 2.1.1
    b) ArduinoJSON 5.12.0
    c) LinkedList 1.2.3
    d) FastLED 3.1.6
    e) Logging https://github.com/SciLor/Arduino-logging-library - install manually: Download zip from github and install via Arduino IDE, Sketch -> Include Library -> Add .ZIP Library
    f) ESP32 Webserver https://github.com/nhatuan84/esp32-webserver - install manually (for esp32 only)

    Now you can download my GitHub Repository to a location of you choice and open it via the Arduino IDE:
    https://github.com/SciLor/Hyperion_LED-Controller

    ESP Config
    1. Go to the HyperionRGB folder and create a copy of ConfigStatic.h.example. Remove the .example suffix
    2. Configure the ConfigStatic.h for your needs:
      • Select your LED chip type. All LEDs of the FastLed libraries are supported
      • Configure the used LED pins. You can also change the Pin Order. The NodeMCU order doesn't work sometimes to please also try the `RAW_PIN_ORDER``
      • Define the number of used LEDs
      • Define one of the standard modes which are active when your light is idle. Choose one from: OFF, HYPERION_UDP, STATIC_COLOR, RAINBOW, FIRE2012
      • You maydefine Wifi configuration but you can also change it from the Webinterface
    3. Open the HyperionRGB.ino the Arduino IDE
    4. Compile and upload to your board
    Now connect your LEDs and have fun!

    Like my work spread the word.
    http://www.scilor.com/donate.html
     
    Last edited: 6 May 2018
    • Like Like x 5
  2. Jose Ramon Espericueta

    Jose Ramon Espericueta Member

    Messages:
    66
    Hardware:
    RPi3, +Arduino
    This works in hyperion classic ?
     
  3. AmbiMod

    AmbiMod Member

    Messages:
    49
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +PhilipsHue, +AtmoOrb, +nodeMCU/ESP8266
    • Like Like x 1
  4. Akriss

    Akriss Active Member

    Messages:
    311
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  5. Jose Ramon Espericueta

    Jose Ramon Espericueta Member

    Messages:
    66
    Hardware:
    RPi3, +Arduino
  6. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    hello, first led on my esp8266 strip blinks green every 10 seconds (regardless of mode, even if all leds are black, also during effects or any mode)
    Why this happens? How can can turn off this behaviour please?
     
  7. SciLor

    SciLor Wireless extension DEV

    Messages:
    4
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    I don't think this is a problem with my software. Please tell us what stripes you use.
     
  8. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    I am using ws2812b and esp8266-01.
     
  9. Akriss

    Akriss Active Member

    Messages:
    311
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Do not use D4 pin it is tied to the onboard led. If you look at both the onboard led and the first you well notice they blink simultaneously.

    Hope it helps.
     
  10. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    oh, I don't have my esp8266-01 here right now, but this could be the issue. Thank you I will try it in the morning.
    My settings look like this:
    #define CONFIG_LED_DATAPIN 2
    #define CONFIG_LED_CLOCKPIN 0
    but probably I should set CONFIG_LED_DATAPIN to 0, and comment CONFIG_LED_CLOCKPIN line, because my ws2812b has just 3 wires (I don't know, if my assumption is correct, I must try it out).
     
    Last edited: 17 May 2018
  11. Akriss

    Akriss Active Member

    Messages:
    311
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  12. peter

    peter Member

    Messages:
    108
    Hardware:
    RPi1/Zero, RPi2, RPi3
    hi, my first led blinking was related to GPIO2 datapin. When I changed it to 0, no more blinking :)
     
    • Like Like x 1