Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Xlights with ESP2866 NodeMCU

  1. #1
    Join Date
    Oct 2015
    Location
    Hastings, New Zealand
    Posts
    45
    Post Thanks / Like

    Default Xlights with ESP2866 NodeMCU

    Hi
    I've finally nailed down what configuration I'll use as follows:
    Software: Xlights
    Hardware: NodeMCU ESP2866
    Lights: 12v 5m 150 nodes per string RGB

    The problem I'm having is this. Two issues in fact Second Issue is at the bottom of this Thread.
    I know there is a lot here but I would really appreciate your help. I feel light I have watch every YouTube video, Clicked every Google link for help. But I know I missing something and need some guidance please.

    Issue 1:
    I can run multiple lights off one board but I'm having an issue coding the NodeMCU.
    I'm getting confused with channels and universes and matching them in Xlights. I can't seem to make the channels line up from the board to xlights.
    How should I program the channels? By channel number, universe or model?
    start.png


    This is the code I'm using on the Node MCU:
    /*
    * ESP8266_NeoPixel.ino - Simple sketch to listen for E1.31 data on an ESP8266
    * and drive WS2811 LEDs using the NeoPixel Library
    *
    * == Requires Adafruit_NeoPixel - http://github.com/adafruit/Adafruit_NeoPixel
    *
    * Project: E131 - E.131 (sACN) library for Arduino
    * Copyright (c) 2015 Shelby Merrick
    * http://www.forkineye.com
    *
    * This program is provided free for you to use in any way that you wish,
    * subject to the laws and regulations where you are using it. Due diligence
    * is strongly suggested before using this code. Please give credit where due.
    *
    * The Author makes no warranty of any kind, express or implied, with regard
    * to this program or the documentation contained in this document. The
    * Author shall not be liable in any event for incidental or consequential
    * damages in connection with, or arising out of, the furnishing, performance
    * or use of these programs.
    *
    */

    #include <ESP8266WiFi.h>
    #include <E131.h>
    #include <Adafruit_NeoPixel.h>

    #define LOG_PORT Serial /* Serial port for console logging */
    #define CONNECT_TIMEOUT 15000 /* 15 seconds */

    #define NUM_PIXELS_A 150 /* roofline Number of pixels */
    #define UNIVERSE_A 1 /* Universe to listen for */
    #define CHANNEL_START_A 1 /* Channel to start listening at */
    #define DATA_PIN_A 5 /* Pixel output - GPIO2 / nodeMCU D1 */

    #define NUM_PIXELS_B 150/* Number of pixels */
    #define UNIVERSE_B 1 /* Universe to listen for */
    #define CHANNEL_START_B 451 /* Channel to start listening at */
    #define DATA_PIN_B 4 /* Pixel output - GPIO1 / nodeMCU D2 */

    #define NUM_PIXELS_C 150 /* Number of pixels */
    #define UNIVERSE_C 2 /* Universe to listen for */
    #define CHANNEL_START_C 901 /* Channel to start listening at */
    #define DATA_PIN_C 14 /* Pixel output - GPIO4 / nodeMCU D5 */

    #define NUM_PIXELS_D 150 /* Number of pixels */
    #define UNIVERSE_D 1 /* Universe to listen for */
    #define CHANNEL_START_D 1051 /* Channel to start listening at */
    #define DATA_PIN_D 12 /* Pixel output - GPIO5 / nodeMCU D6 */

    const char ssid[] = "hidden"; /* Replace with your SSID */
    const char passphrase[] = "hidden"; /* Replace with your WPA2 passphrase */

    E131 e131;

    Adafruit_NeoPixel pixels_a = Adafruit_NeoPixel(NUM_PIXELS_A, DATA_PIN_A, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_b = Adafruit_NeoPixel(NUM_PIXELS_B, DATA_PIN_B, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_c = Adafruit_NeoPixel(NUM_PIXELS_C, DATA_PIN_C, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_d = Adafruit_NeoPixel(NUM_PIXELS_D, DATA_PIN_D, NEO_BRG + NEO_KHZ800);

    int initWifi() {
    /* Switch to station mode and disconnect just in case */
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(secureRandom(100,500));


    LOG_PORT.println("");
    LOG_PORT.print(F("Connecting to "));
    LOG_PORT.println(ssid);

    WiFi.begin(ssid, passphrase);


    uint32_t timeout = millis();
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    LOG_PORT.print(".");
    if (millis() - timeout > CONNECT_TIMEOUT) {
    LOG_PORT.println("");
    LOG_PORT.println(F("*** Failed to connect ***"));
    break;
    }
    }

    if (WiFi.status() == WL_CONNECTED) {
    LOG_PORT.println("");
    LOG_PORT.print(F("Connected with IP: "));
    LOG_PORT.println(WiFi.localIP());

    e131.begin(E131_MULTICAST, UNIVERSE_A, UNIVERSE_B - UNIVERSE_A + 1);
    }

    return WiFi.status();
    }

    void setup() {
    LOG_PORT.begin(115200);
    delay(10);



    /* Choose one to begin listening for E1.31 data */
    e131.begin(ssid, passphrase); /* via Unicast on the default port */
    //e131_a.beginMulticast(ssid, passphrase, UNIVERSE_A); /* via Multicast for Universe 1 */
    initWifi();

    /* Initialize output */
    pixels_a.begin();
    pixels_a.show();
    pixels_b.begin();
    pixels_b.show();
    pixels_c.begin();
    pixels_c.show();
    pixels_d.begin();
    pixels_d.show();
    }

    void loop() {
    /* Parse a packet and update pixels */
    if(e131.parsePacket())
    {
    if (e131.universe == UNIVERSE_A) {
    for (int i = 0; i < NUM_PIXELS_A; i++) {
    int j = i * 3 + (CHANNEL_START_A - 1);
    pixels_a.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_a.show();
    }
    if (e131.universe == UNIVERSE_B) {
    for (int i = 0; i < NUM_PIXELS_B; i++) {
    int j = i * 3 + (CHANNEL_START_B - 1);
    pixels_b.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_b.show();
    }
    if (e131.universe == UNIVERSE_C) {
    for (int i = 0; i < NUM_PIXELS_C; i++) {
    int j = i * 3 + (CHANNEL_START_C - 1);
    pixels_c.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_c.show();
    }
    if (e131.universe == UNIVERSE_D) {
    for (int i = 0; i < NUM_PIXELS_D; i++) {
    int j = i * 3 + (CHANNEL_START_D - 1);
    pixels_d.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_d.show();
    }

    }
    }

    And this is the layout so far:layout.png
    And my setup setup.png

    Issue 2: This could be related to the above but when the lights are not having a sequence running. Some of them have lights on and flickering. AS per video.
    https://photos.app.goo.gl/8fR775A9k8V1ef5r7

    Thanks for having a look.

  2. #2
    Join Date
    Dec 2011
    Posts
    6,072
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    You may be better off using espixelstick firmware >>

    https://github.com/forkineye/ESPixelStick/releases

  3. #3
    Join Date
    Oct 2015
    Location
    Hastings, New Zealand
    Posts
    45
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    I thought about that. I downloaded it and ran the flash tool, but I couldn't get the NodeMCU into programming mode.
    If its the best way forward I can invest some time in sorting that out.

    Thanks for the reply

  4. #4
    Join Date
    Dec 2011
    Posts
    6,072
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    What ver of nodemcu are you using ?
    I use a couple of the v3 to test with and they seem to just program automatically using Arduino IDE or the esp tool .

    Have now switched to wemos as suggested by a member here .

  5. #5
    Join Date
    Dec 2011
    Posts
    6,072
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    Also , in your testing with that code were you able to output different effects to your configured gpio's .

    I like the idea of a separate univers per i/o .

  6. #6
    Join Date
    Oct 2015
    Location
    Hastings, New Zealand
    Posts
    45
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    For the most part, yes. At one point I had programmed 3 test sections for each of my 3 test strips and had different effects. But because I couldn't line up the channels and universes only some of each strip was working.

  7. #7
    Join Date
    Dec 2011
    Posts
    6,072
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    I noticed in your code that you selected Multicast on line 91 yet on line 104 set Unicast .
    Also on line 42 you have #define UNIVERSE_C 2 /* Universe to listen for */
    with all other defines set to 1 .

    I tested part of your code and with a few changes this worked perfectly.


    Code:
    #include <ESP8266WiFi.h>
    #include <E131.h>
    #include <Adafruit_NeoPixel.h>
    
    #define NUM_PIXELS 3   /* Number of pixels */
    #define UNIVERSE 1   /* Universe to listen for */
    #define CHANNEL_START 1   /* Channel to start listening at */
    #define DATA_PIN 2  /* Pixel output - GPIO 2 */
    
    #define NUM_PIXELS_B 5   /* Number of pixels */
    #define UNIVERSE 2   /* Universe to listen for */
    #define CHANNEL_START_B 1   /* Channel to start listening at */
    #define DATA_PIN_B 0   /* Pixel output - GPIO 0  */
    
    const char ssid[] = "your router id";   /* Replace with your SSID */
    const char passphrase[] = "your password";    /* Replace with your WPA2 passphrase */
    
    //IPAddress ip(0, 0, 0, 0); //set static ip
    //IPAddress gateway(0, 0, 0, 0); //set gateway
    //IPAddress subnet(255, 255, 255, 0);//set subnet
    
    E131 e131;
    
    Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_PIXELS, DATA_PIN, NEO_GRB + NEO_KHZ800);
    Adafruit_NeoPixel pixels_b = Adafruit_NeoPixel(NUM_PIXELS_B, DATA_PIN_B, NEO_GRB + NEO_KHZ800);
    
    void setup() {
        Serial.begin(115200);
        delay(10);
    
        // Initial pin states
        pinMode(DATA_PIN, OUTPUT);
        digitalWrite(DATA_PIN, LOW);
        pinMode(DATA_PIN_B, OUTPUT);
        digitalWrite(DATA_PIN_B, LOW);
         
    
        /* Choose one to begin listening for E1.31 data */
        e131.begin(ssid, passphrase);   /* via Unicast on the default port */
        //WiFi.config(ip, gateway, subnet); // uncomment for static ip
        //e131.beginMulticast(ssid, passphrase, UNIVERSE);  /* via Multicast for Universe 1 */
    
        /* Initialize output */
        pixels.begin();
        pixels.show();
        pixels_b.begin();
        pixels_b.show();
    }
    
    void loop() {
        /* Parse a packet and update pixels */
        if(e131.parsePacket()) {
            if (e131.universe == 1) {
                for (int i = 0; i < NUM_PIXELS; i++) {
                    int j = i * 3 + (CHANNEL_START - 1);
                    pixels.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
                }
                pixels.show();
     
            }
            if (e131.universe == 2) {
                for (int i = 0; i < NUM_PIXELS_B; i++) {
                    int j = i * 3 + (CHANNEL_START_B - 1);
                    pixels_b.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
                }
                pixels_b.show();
            }
        }
    }
    I also tested with this to mirror your pixel counts and start channels , which also works .

    Code:
    #include <ESP8266WiFi.h>
    #include <E131.h>
    #include <Adafruit_NeoPixel.h>
    
    #define NUM_PIXELS 150  /* Number of pixels */
    #define UNIVERSE 1   /* Universe to listen for */
    #define CHANNEL_START 1   /* Channel to start listening at */
    #define DATA_PIN 2   /* Pixel output - GPIO 2 */
    
    #define NUM_PIXELS_B 150   /* Number of pixels */
    #define UNIVERSE 2   /* Universe to listen for */
    #define CHANNEL_START_B 451    /* Channel to start listening at */
    #define DATA_PIN_B 0   /* Pixel output - GPIO 0 */
    
    const char ssid[] = "your router id";    /* Replace with your SSID */
    const char passphrase[] = "your password";    /* Replace with your WPA2 passphrase */
    
    E131 e131;
    
    Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_PIXELS, DATA_PIN, NEO_GRB + NEO_KHZ800);
    Adafruit_NeoPixel pixels_b = Adafruit_NeoPixel(NUM_PIXELS_B, DATA_PIN_B, NEO_GRB + NEO_KHZ800);
    
    void setup() {
        Serial.begin(115200);
        delay(10);
    
        /* Choose one to begin listening for E1.31 data */
        e131.begin(ssid, passphrase);   /* via Unicast on the default port */
        //e131.beginMulticast(ssid, passphrase, UNIVERSE);  /* via Multicast for Universe 1 */
    
        /* Initialize output */
        pixels.begin();
        pixels.show();
        pixels_b.begin();
        pixels_b.show();
    }
    
    void loop() {
        /* Parse a packet and update pixels */
        if(e131.parsePacket()) {
            if (e131.universe == 1) {
                for (int i = 0; i < NUM_PIXELS; i++) {
                    int j = i * 3 + (CHANNEL_START - 1);
                    pixels.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
                }
                pixels.show();
     
            }
            if (e131.universe == 2) {
                for (int i = 0; i < NUM_PIXELS_B; i++) {
                    int j = i * 3 + (CHANNEL_START_B - 451);
                    pixels_b.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
                }
                pixels_b.show();
            }
        }
    }
    Here is your code revised for Unicast , just add your nodemcu's ip address where it is required in your xlights configuration

    Code:
    This is the code I'm using on the Node MCU:
    /*
    * ESP8266_NeoPixel.ino - Simple sketch to listen for E1.31 data on an ESP8266
    * and drive WS2811 LEDs using the NeoPixel Library
    *
    * == Requires Adafruit_NeoPixel - http://github.com/adafruit/Adafruit_NeoPixel 
    *
    * Project: E131 - E.131 (sACN) library for Arduino
    * Copyright (c) 2015 Shelby Merrick
    * http://www.forkineye.com
    *
    * This program is provided free for you to use in any way that you wish,
    * subject to the laws and regulations where you are using it. Due diligence
    * is strongly suggested before using this code. Please give credit where due.
    *
    * The Author makes no warranty of any kind, express or implied, with regard
    * to this program or the documentation contained in this document. The
    * Author shall not be liable in any event for incidental or consequential
    * damages in connection with, or arising out of, the furnishing, performance
    * or use of these programs.
    *
    */
    
    #include <ESP8266WiFi.h>
    #include <E131.h>
    #include <Adafruit_NeoPixel.h>
    
    #define LOG_PORT Serial /* Serial port for console logging */
    #define CONNECT_TIMEOUT 15000 /* 15 seconds */
    
    #define NUM_PIXELS_A 150 /* roofline Number of pixels */
    #define UNIVERSE 1 /* Universe to listen for */
    #define CHANNEL_START_A 1 /* Channel to start listening at */
    #define DATA_PIN_A 5 /* Pixel output - GPIO2 / nodeMCU D1 */
    
    #define NUM_PIXELS_B 150/* Number of pixels */
    #define UNIVERSE 2 /* Universe to listen for */
    #define CHANNEL_START_B 451 /* Channel to start listening at */
    #define DATA_PIN_B 4 /* Pixel output - GPIO1 / nodeMCU D2 */
    
    #define NUM_PIXELS_C 150 /* Number of pixels */
    #define UNIVERSE 3 /* Universe to listen for */
    #define CHANNEL_START_C 901 /* Channel to start listening at */
    #define DATA_PIN_C 14 /* Pixel output - GPIO4 / nodeMCU D5 */
    
    #define NUM_PIXELS_D 150 /* Number of pixels */
    #define UNIVERSE 4 /* Universe to listen for */
    #define CHANNEL_START_D 1351 /* Channel to start listening at */
    #define DATA_PIN_D 12 /* Pixel output - GPIO5 / nodeMCU D6 */
    
    const char ssid[] = "hidden"; /* Replace with your SSID */
    const char passphrase[] = "hidden"; /* Replace with your WPA2 passphrase */
    
    E131 e131;
    
    Adafruit_NeoPixel pixels_a = Adafruit_NeoPixel(NUM_PIXELS_A, DATA_PIN_A, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_b = Adafruit_NeoPixel(NUM_PIXELS_B, DATA_PIN_B, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_c = Adafruit_NeoPixel(NUM_PIXELS_C, DATA_PIN_C, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_d = Adafruit_NeoPixel(NUM_PIXELS_D, DATA_PIN_D, NEO_BRG + NEO_KHZ800);
    
    int initWifi() {
    /* Switch to station mode and disconnect just in case */
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(secureRandom(100,500));
    
    
    LOG_PORT.println("");
    LOG_PORT.print(F("Connecting to "));
    LOG_PORT.println(ssid);
    
    WiFi.begin(ssid, passphrase);
    
    
    uint32_t timeout = millis();
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    LOG_PORT.print(".");
    if (millis() - timeout > CONNECT_TIMEOUT) {
    LOG_PORT.println("");
    LOG_PORT.println(F("*** Failed to connect ***"));
    break;
    }
    }
    
    if (WiFi.status() == WL_CONNECTED) {
    LOG_PORT.println("");
    LOG_PORT.print(F("Connected with IP: "));
    LOG_PORT.println(WiFi.localIP());
    
    //e131.begin(E131_MULTICAST, UNIVERSE_A, UNIVERSE_B - UNIVERSE_A + 1);
    }
    
    return WiFi.status();
    }
    
    void setup() {
    LOG_PORT.begin(115200);
    delay(10);
    
    
    
    /* Choose one to begin listening for E1.31 data */
    e131.begin(ssid, passphrase); /* via Unicast on the default port */
    //e131_a.beginMulticast(ssid, passphrase, UNIVERSE_A); /* via Multicast for Universe 1 */
    initWifi();
    
    /* Initialize output */
    pixels_a.begin();
    pixels_a.show();
    pixels_b.begin();
    pixels_b.show();
    pixels_c.begin();
    pixels_c.show();
    pixels_d.begin();
    pixels_d.show();
    }
    
    void loop() {
    /* Parse a packet and update pixels */
    if(e131.parsePacket())
    {
    if (e131.universe == 1) {
    for (int i = 0; i < NUM_PIXELS_A; i++) {
    int j = i * 3 + (CHANNEL_START_A - 1);
    pixels_a.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_a.show();
    }
    if (e131.universe == 2) {
    for (int i = 0; i < NUM_PIXELS_B; i++) {
    int j = i * 3 + (CHANNEL_START_B - 451);
    pixels_b.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_b.show();
    }
    if (e131.universe == 3) {
    for (int i = 0; i < NUM_PIXELS_C; i++) {
    int j = i * 3 + (CHANNEL_START_C - 901);
    pixels_c.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_c.show();
    }
    if (e131.universe == 4) {
    for (int i = 0; i < NUM_PIXELS_D; i++) {
    int j = i * 3 + (CHANNEL_START_D - 1351);
    pixels_d.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_d.show();
    }
    
    }
    }
    And if Multicast ..

    Note: I noticed random sequence errors while running effects in multicast .
    Did not see any errors in Unicast

    Code:
    /*This is the code I'm using on the Node MCU:
    
    * ESP8266_NeoPixel.ino - Simple sketch to listen for E1.31 data on an ESP8266
    * and drive WS2811 LEDs using the NeoPixel Library
    *
    * == Requires Adafruit_NeoPixel - http://github.com/adafruit/Adafruit_NeoPixel 
    *
    * Project: E131 - E.131 (sACN) library for Arduino
    * Copyright (c) 2015 Shelby Merrick
    * http://www.forkineye.com
    *
    * This program is provided free for you to use in any way that you wish,
    * subject to the laws and regulations where you are using it. Due diligence
    * is strongly suggested before using this code. Please give credit where due.
    *
    * The Author makes no warranty of any kind, express or implied, with regard
    * to this program or the documentation contained in this document. The
    * Author shall not be liable in any event for incidental or consequential
    * damages in connection with, or arising out of, the furnishing, performance
    * or use of these programs.
    *
    */
    
    #include <ESP8266WiFi.h>
    #include <E131.h>
    #include <Adafruit_NeoPixel.h>
    
    #define LOG_PORT Serial /* Serial port for console logging */
    #define CONNECT_TIMEOUT 15000 /* 15 seconds */
    
    #define NUM_PIXELS_A 150 /* roofline Number of pixels */
    #define UNIVERSE 1 /* Universe to listen for */
    #define CHANNEL_START_A 1 /* Channel to start listening at */
    #define DATA_PIN_A 5 /* Pixel output - GPIO2 / nodeMCU D1 */
    
    #define NUM_PIXELS_B 150/* Number of pixels */
    #define UNIVERSE 2 /* Universe to listen for */
    #define CHANNEL_START_B 451 /* Channel to start listening at */
    #define DATA_PIN_B 4 /* Pixel output - GPIO1 / nodeMCU D2 */
    
    #define NUM_PIXELS_C 150 /* Number of pixels */
    #define UNIVERSE 3 /* Universe to listen for */
    #define CHANNEL_START_C 901 /* Channel to start listening at */
    #define DATA_PIN_C 14 /* Pixel output - GPIO4 / nodeMCU D5 */
    
    #define NUM_PIXELS_D 150 /* Number of pixels */
    #define UNIVERSE 4 /* Universe to listen for */
    #define CHANNEL_START_D 1351 /* Channel to start listening at */
    #define DATA_PIN_D 12 /* Pixel output - GPIO5 / nodeMCU D6 */
    
    const char ssid[] = "hidden"; /* Replace with your SSID */
    const char passphrase[] = "hidden"; /* Replace with your WPA2 passphrase */
    
    E131 e131;
    
    Adafruit_NeoPixel pixels_a = Adafruit_NeoPixel(NUM_PIXELS_A, DATA_PIN_A, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_b = Adafruit_NeoPixel(NUM_PIXELS_B, DATA_PIN_B, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_c = Adafruit_NeoPixel(NUM_PIXELS_C, DATA_PIN_C, NEO_BRG + NEO_KHZ800);
    Adafruit_NeoPixel pixels_d = Adafruit_NeoPixel(NUM_PIXELS_D, DATA_PIN_D, NEO_BRG + NEO_KHZ800);
    
    int initWifi() {
    /* Switch to station mode and disconnect just in case */
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(secureRandom(100,500));
    
    
    LOG_PORT.println("");
    LOG_PORT.print(F("Connecting to "));
    LOG_PORT.println(ssid);
    
    WiFi.begin(ssid, passphrase);
    
    
    uint32_t timeout = millis();
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    LOG_PORT.print(".");
    if (millis() - timeout > CONNECT_TIMEOUT) {
    LOG_PORT.println("");
    LOG_PORT.println(F("*** Failed to connect ***"));
    break;
    }
    }
    
    if (WiFi.status() == WL_CONNECTED) {
    LOG_PORT.println("");
    LOG_PORT.print(F("Connected with IP: "));
    LOG_PORT.println(WiFi.localIP());
    
    //e131.begin(E131_MULTICAST, UNIVERSE_A, UNIVERSE_B - UNIVERSE_A + 1);
    }
    
    return WiFi.status();
    }
    
    void setup() {
    LOG_PORT.begin(115200);
    delay(10);
    
    
    
    /* Choose one to begin listening for E1.31 data */
    //e131.begin(ssid, passphrase); /* via Unicast on the default port */
    e131_a.beginMulticast(ssid, passphrase, 1, 2, 3, 4); /* via Multicast for Universe 1 */
    initWifi();
    
    /* Initialize output */
    pixels_a.begin();
    pixels_a.show();
    pixels_b.begin();
    pixels_b.show();
    pixels_c.begin();
    pixels_c.show();
    pixels_d.begin();
    pixels_d.show();
    }
    
    void loop() {
    /* Parse a packet and update pixels */
    if(e131.parsePacket())
    {
    if (e131.universe == 1) {
    for (int i = 0; i < NUM_PIXELS_A; i++) {
    int j = i * 3 + (CHANNEL_START_A - 1);
    pixels_a.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_a.show();
    }
    if (e131.universe == 2) {
    for (int i = 0; i < NUM_PIXELS_B; i++) {
    int j = i * 3 + (CHANNEL_START_B - 451);
    pixels_b.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_b.show();
    }
    if (e131.universe == 3) {
    for (int i = 0; i < NUM_PIXELS_C; i++) {
    int j = i * 3 + (CHANNEL_START_C - 901);
    pixels_c.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_c.show();
    }
    if (e131.universe == 4) {
    for (int i = 0; i < NUM_PIXELS_D; i++) {
    int j = i * 3 + (CHANNEL_START_D - 1351);
    pixels_d.setPixelColor(i, e131.data[j], e131.data[j+1], e131.data[j+2]);
    }
    pixels_d.show();
    }
    
    }
    }
    Last edited by angus40; 08-13-2019 at 08:38 PM.

  8. #8
    Join Date
    Dec 2011
    Posts
    6,072
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    Ps. I think we need to use code blocks .

    [?CODE] << type this without the ?
    <<<<<<<<<<<<<< paste your code here
    [?/CODE] << type this without the ?

    cheers
    Last edited by angus40; 07-31-2019 at 04:27 AM.

  9. #9
    Join Date
    Oct 2015
    Location
    Hastings, New Zealand
    Posts
    45
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    Dude. I sent you a PM

  10. #10
    Join Date
    Jan 2012
    Location
    Chambersburg, PA
    Posts
    703
    Post Thanks / Like

    Default Re: Xlights with ESP2866 NodeMCU

    Angus,

    Wow, talk about going above and beyond! That was awesome!
    2012 - 1st year 64 Channels - 7500 LED lights - 5 sequences
    2013 - 128 Channels - 10,000 LED lights - 7 sequences (2 New)
    2014 - 201 Channels - upgrading 8 Arches to dumb RGB - 8+ sequences (1+ New)
    2015 - 240 Channels + 8 Universes - sequences TBD
    2016 - No Display
    2017 - Back in the Game - 240 Renard Channels + 12 Universes
    2018 - 256 Renard and 9 Falcon Outputs of Pixels - 16 sequences shown over 2 nights

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •