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:
    5
    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
    • Thank you Thank you x 1
  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:
    377
    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:
    5
    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:
    377
    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.
     
    • Like Like x 1
  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:
    377
    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 2
  13. MetricsGaming

    MetricsGaming New Member

    Messages:
    2
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    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
     
  14. Akriss

    Akriss Active Member

    Messages:
    377
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    In the config both types of "grabbers" appear to be enabled. Only one needs to be enabled. reference here

    Hope it's of help.
     
  15. MetricsGaming

    MetricsGaming New Member

    Messages:
    2
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    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
    },
     
    Last edited: 5 September 2018
  16. wars

    wars New Member

    Messages:
    5
    Hardware:
    RPi3, +nodeMCU/ESP8266
    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?
     
  17. SciLor

    SciLor Wireless extension DEV

    Messages:
    5
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    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.
     
  18. Supersimo88

    Supersimo88 New Member

    Messages:
    11
    Hardware:
    RPi1/Zero, +nodeMCU/ESP8266
    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.
     
  19. Akriss

    Akriss Active Member

    Messages:
    377
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Many Thanks SciLor.

    20181126_190530.jpg 20181126_190635.jpg
     
    • Like Like x 1