xmas:esp8266
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| xmas:esp8266 [2025/11/30 22:04] – mlivolsi | xmas:esp8266 [2025/11/30 22:54] (current) – mlivolsi | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Xlights with ESP8266 as an Infrared Transmitter ==== | + | ======= Xlights with ESP8266 as an Infrared Transmitter |
| WARNING: This article is going to be HUGE.. Huge Jerry .. Huge !!! | WARNING: This article is going to be HUGE.. Huge Jerry .. Huge !!! | ||
| - | Terminology: | + | **Terminology: |
| IR - Infrared | IR - Infrared | ||
| - | Hacks will be denoted by: {{: | + | Hacks will be denoted by: {{: |
| Target Audience: You got these cool piece of LED hardware (in my case, floodlights), | Target Audience: You got these cool piece of LED hardware (in my case, floodlights), | ||
| - | === Grabbing the IR Codes === | + | ===== Grabbing the IR Codes ===== |
| NOTE: The setup is totally throw-away. You only need the IR codes | NOTE: The setup is totally throw-away. You only need the IR codes | ||
| Line 22: | Line 22: | ||
| * Arduino IDE | * Arduino IDE | ||
| * Your piece of crap IR transmitter | * Your piece of crap IR transmitter | ||
| - | {{: | + | {{: |
| - | Wiring the breadboard | + | ===== Wiring the breadboard |
| - | {{: | + | {{: |
| EE people.. Please don’t beat up on me.. For the love of Pete. | EE people.. Please don’t beat up on me.. For the love of Pete. | ||
| - | Arduino Sketch | + | |
| + | |||
| + | ===== Arduino Sketch | ||
| My sketch isn’t mine. It was written by someone FAR FAR smarter than me.. I have a slightly modified version of it here: | My sketch isn’t mine. It was written by someone FAR FAR smarter than me.. I have a slightly modified version of it here: | ||
| - | https:// | + | |
| + | [[https:// | ||
| Once you have everything running, go to your serial monitor and record the hex codes. | Once you have everything running, go to your serial monitor and record the hex codes. | ||
| - | WARNING: Each transmitter will be different. For my reference, the codes were as follows: | + | |
| - | Red | + | **WARNING**: Each transmitter will be different. For my reference, the codes were as follows: |
| - | 0xC | + | |
| - | Yellow | + | ^ Color ^ Code ^ |
| - | 0x5E | + | | Red | 0xC | |
| - | Green | + | | Yellow |
| - | 0x4A | + | | Green | 0x4A | |
| - | Blue | + | | Blue | 0x42 | |
| - | 0x42 | + | | On | 0x47 | |
| - | On | + | | Off | 0x43 | |
| - | 0x47 | + | | Brighter |
| - | Off | + | | Dim | 0x46 | |
| - | 0x43 | + | | Red Built in Effect |
| - | Brighter | + | | Blue Built in Effect |
| - | 0x45 | + | | Green Built in Effect |
| - | Dim | + | | Bright White | 0x1C | |
| - | 0x46 | + | | Cycle Colors |
| - | Red Built in Effect | + | | Teal | 0x15 | |
| - | 0x16 | + | | Orange |
| - | Blue Built in Effect | + | |
| - | 0x19 | + | |
| - | Green Built in Effect | + | |
| - | 0xD | + | |
| - | Bright White | + | |
| - | 0x1C | + | |
| - | Cycle Colors | + | |
| - | 0x40 | + | |
| - | Teal | + | |
| - | 0x15 | + | |
| - | Orange | + | |
| - | 0x7 | + | |
| Cool Feature: The sketch will give you the instructions on how to transmit | Cool Feature: The sketch will give you the instructions on how to transmit | ||
| - | Wiring the ESP8266 | + | ===== Wiring the ESP8266 |
| - | {{: | + | {{: |
| + | |||
| + | Again EE people.. I know.. I know..byte me. Pin D6 transmits at 3.3V, and just putting that resistor seemed to keep the diode from blowing up. The transmitter is weaker than I’d like, but I’d rather protect it and it’s tolerable. | ||
| + | Programing the ESP8266 | ||
| + | |||
| + | “My pain is your gain” | ||
| + | |||
| + | The ESP8266 will act as a web-server and an IR transmitter. | ||
| + | The codely goodness can be found here: | ||
| + | https:// | ||
| + | |||
| + | IF YOU DONT WANT TO READ THE COMMENTS BELOW, FINE.. BE LIKE THAT.. JUST REMEMBER TO CHANGE THE WIFI SID AND PASSWORD | ||
| + | |||
| + | There are plenty of examples of running a web server on the NodeMCU, just some notes about the web aspect. | ||
| + | Xlights “talks” when using OPC on port 7890 | ||
| + | The manufacturer of my unit (esp8266) | ||
| + | OPC - Open Pixel Control | ||
| + | |||
| + | Before writing the program above, ChatGPT gave me an example program to run on Linux as an OPC server. I took that code, tested it with Xlights, | ||
| + | |||
| + | There’s a good article about OPC here: | ||
| + | http:// | ||
| + | Caveats: | ||
| + | | ||
| + | Data lengths should always be a multiple of 3. In my case, I specified 12, but I’m only using 3 bytes | ||
| + | |||
| + | {{: | ||
| + | In the first set of RGB colors (the 3 integers), if the first int (red) is less than or equal to 5, that’s an instruction to turn ON the LEDS. | ||
| + | In the first set of RGB colors (the 3 integers), if the third (blue) int is less than or equal to 5, that’s an instruction to turn OFF the LEDS. | ||
| + | |||
| + | ===== Programing Xlights ===== | ||
| + | |||
| + | The Arduino script gave me the IP address, but you can also check your router for the IP address (dhcp). | ||
| + | **NOTE:** The message data size is 12, but I only configured 2 models, so I’m only sending 6 bytes in the message (see OPC protocol above) | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Mode Specification ==== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Sequencing: | ||
| + | |||
| + | In Xlights, I start the channel with a value of ‘1’ using the fade tool with a color of RED. This instructs the code to run the LED command to power on the floodlights | ||
| + | I end with a value of ‘1’ for color blue, which instructs the code to send an “off” command to the floodlights. | ||
| + | |||
| + | |||
| + | **Other thoughts** | ||
| + | |||
| + | I should have added an LED to my box to give me a visual if I’m connected to the Internet. | ||
| + | I created these tamponish looking devices to transmit to the RGB floodlights. I split the signal in two to control two flood lights (and that way, they’ll always be synched). | ||
| + | |||
| + | {{: | ||
xmas/esp8266.1764540246.txt.gz · Last modified: by mlivolsi
