Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: ESP Async E131 test.ino

  1. #11
    Join Date
    Dec 2011
    Post Thanks / Like

    Default Re: ESP Async E131 test.ino

    For me , This sketch that Shelby provided was a god send for learning .
    I cannot thank him enough for this .
    When I first seen the Esp32 a few years back I had thought it would be awesome if there was a way for me to understand how to use it .

    Now to add a esp32 camera to the mix

    Amazing sketch !!
    Thank you very much .
    Last edited by angus40; 02-21-2020 at 05:39 PM.

  2. #12
    Join Date
    Dec 2011
    Post Thanks / Like

    Default Re: ESP Async E131 test.ino

    FastLed Code for the Esp32 for anyone wanting to play with their device .

      E131_Test.ino - Simple sketch to listen for E1.31 data on an ESP32
                       and print some statistics.
      Project: ESPAsyncE131 - Asynchronous E.131 (sACN) library for Arduino ESP8266 and ESP32
      Copyright (c) 2019 Shelby Merrick
       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 <ESPAsyncE131.h>
    #include <FastLED.h>
    #include <WiFi.h>
    #define UNIVERSE 1                      // First DMX Universe to listen for
    #define UNIVERSE_COUNT 2                // Total number of Universes to listen for, starting at UNIVERSE
    #define CHANNEL_START 1
    #define NUM_LEDS_PER_STRIP 170
    const char ssid[] = "ESP32";         // Replace with your SSID
    const char passphrase[] = "FASTLED";   // Replace with your WPA2 passphrase
    // ESPAsyncE131 instance with UNIVERSE_COUNT buffer slots
    ESPAsyncE131 e131(2);
    void setup() {
      // tell FastLED there's 170 NEOPIXEL leds on pin 12
      FastLED.addLeds<NEOPIXEL, 12>(Leds, NUM_LEDS_PER_STRIP);
      // Make sure you're in station mode
      Serial.print(F("Connecting to "));
      if (passphrase != NULL)
        WiFi.begin(ssid, passphrase);
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(F("Connected with IP: "));
      // Choose one to begin listening for E1.31 data
      //if (e131.begin(E131_UNICAST))                               // Listen via Unicast
      if (e131.begin(E131_MULTICAST, UNIVERSE, UNIVERSE_COUNT))   // Listen via Multicast
        Serial.println(F("Listening for data..."));
        Serial.println(F("*** e131.begin failed ***"));
    void loop() {
      while (!e131.isEmpty()) {
        e131_packet_t packet;
        e131.pull(&packet);     // Pull packet from ring buffer
        uint16_t universe = htons(packet.universe);
        if (universe == 1) {
          if (packet.property_values[(CHANNEL_START - 1)] < NUM_LEDS_PER_STRIP) {
            for (int n = 0; n < NUM_LEDS_PER_STRIP; n++) {
              int j = n * 3 + (CHANNEL_START);
              Leds[n] = (n, (CRGB(packet.property_values[j] , packet.property_values[j + 1], packet.property_values[j + 2])));
            /*   Serial.printf("Universe %u / %u Channels | Packet#: %u / Errors: %u / CH1: %u\n",
                       htons(packet.universe),                 // The Universe for this packet
                       htons(packet.property_value_count) - 1, // Start code is ignored, we're interested in dimmer data
                       e131.stats.num_packets,                 // Packet counter
                       e131.stats.packet_errors,               // Packet error counter
                       packet.property_values[1]);             // Dimmer data for Channel 1     */

Page 2 of 2 FirstFirst 12


Posting Permissions

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