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

  • 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/sta…age_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

    • Go to the HyperionRGB folder and create a copy of ConfigStatic.h.example. Remove the .example suffix
    • 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


    • Open the HyperionRGB.ino the Arduino IDE
    • 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

  • 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?

  • my esp8266 strip blinks green every 10 seconds


    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.

  • 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.


    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).

  • I am converting my connected ambilight/hyperion to wifi with nodemcu. I have followed several guides all referencing SciLors code (great job btw). I am grabbing HDMI input from my AV Receiver. This has been working flawlessly for a few years now with just my RPi2 and traditional Ambilight hardware.


    My issue, now that I have introduced a PiZero and NodeMCU is that the TV image grab is not making it to the lpd8806 led strips I have behind the TV. I am able to set "effects" and they work sending the command from the PiZero to the NodeMCU. I can also use the Hyperion App and set the effected while connected to the PiZero. I am also able to grab the screen from HyperCon on my PC.


    I am not sure what the issue could be? The only LEDs I am controlling is the strip on the TV. Any help would be appreciated. TIA
    Here is a pastebin of my hyperion.config.json [MEDIA=pastebin]k9igyEW4[/MEDIA]

  • In the config both types of "grabbers" appear to be enabled. Only one needs to be enabled. [WIKI="HyperCon Grabber - Tab"]reference here[/WIKI]


    Hope it's of help.

  • Thank your for the reply. While it didn't fix it, it did eliminate a source of the trouble. I went back to one of the old config json files, one I know works, and the only difference in the grabber is that I am setting the width and height manually. I will test this out. Probably wouldn't have even noticed if you hadn't mentioned it.
    Cheers


    Edit: Changing the width and height down to a manageable size fixed the issue.
    "grabber-v4l2" :
    {
    "device" : "/dev/video0",
    "input" : 0,
    "standard" : "NTSC",
    "width" : 640,
    "height" : 480,
    "frameDecimation" : 2,
    "sizeDecimation" : 8,
    "priority" : 800,
    "mode" : "2D",
    "cropLeft" : 30,
    "cropRight" : 30,
    "cropTop" : 15,
    "cropBottom" : 0,
    "redSignalThreshold" : 0.1,
    "greenSignalThreshold" : 0.1,
    "blueSignalThreshold" : 0.1
    },

  • Thanks for sharing this tutorial. I'm also planning to install a second apa102 and I would like to control it manually with Hyperion or let it receive the colors of my main leds. I already made a poc with a 2nd pi (zero w) and this is working.
    What are the benefits of using an ESP instead?

  • Thanks for sharing this tutorial. I'm also planning to install a second apa102 and I would like to control it manually with Hyperion or let it receive the colors of my main leds. I already made a poc with a 2nd pi (zero w) and this is working.
    What are the benefits of using an ESP instead?


    The ESP variant is cheaper and you only need a power supply and no network cable.
    I use it even for my first ambilight, because otherwise you have a long unshielded cable that may be problematic during a thunderstorm. In my case it destroyed my AV/R, my raspberry and my LEDs.


  • I succeeded by following the guide to set everything and it works correctly. Finally I can only keep a small esp8266 behind the TV without having all those cables and boxes. Congratulations is really well done and simple to perform. I need only some clarification if it were possible for a single section of the configuration file, this:

    Code
    //OFF, HYPERION_UDP, STATIC_COLOR, RAINBOW, FIRE2012
    #define CONFIG_LED_STANDARD_MODE FIRE2012
    #define CONFIG_LED_HYPERION_AUTOSWITCH true
    #define CONFIG_LED_STANDARD_MODE_TIMEOUT_MS 5000


    It is not clear to me how it should work because the results I see do not allow me to understand how it is supposed to work.
    Thanks in advance and congratulations again for the excellent work.

    Hyperion Configuration:
    Sources --> Av Receiver --> HDMI splitter --> HDMI2AV --> easycap --> raspberry pi B+
    ESP8266 --> 172 x ws2812b LED
    5V10A power supply

  • I have everything up but monitoring serial port only shows refreshes. Anyone know how to fix this?


Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!