ESP32 Thing Plus S2 WROOM and Thing Plus DMX to LED Shield

Hello all,

After a very crushing and frustrating weekend with my new toys I’m turning to the forums for support. I’ve read through as many posts about the SparkFun ESP32 Thing Plus DMX to LED Shield as I could find. I’ve googles as much as one can google, and I’m stumped hard.

I can not for the life of me get anything to happen with the SparkFun ESP32 Thing Plus DMX to LED Shield. I have two SparkFun ESP32 Thing Plus DMX to LED Shield, two LuMini matrixes, and two SparkFun Thing Plus - ESP32-S2 WROOM (which is recommended by SparkFun as the board to use on the website). Using a breadboard I can get my Lumini 8x8 matrices to work just fine with FastLED, but none of the examples sketches from SparkFunDMX have been successful. I’ve legitimately spent 20 hours this past weekend trying to get something to work.

This is the code I’m using for the breadboard, a SparkFun Thing Plus - ESP32-S2 WROOM, and two LuMini Matrixes:

#include <FastLED.h>

// How many leds in your chain? Change the value of NUM_BOARDS depending on your setup
#define NUM_BOARDS 2
#define NUM_LEDS 64 * NUM_BOARDS //64 LED's per board

// The LuMini matrices need two data pins connected, these two pins are common on many microcontrollers, but can be changed according to your setup
#define CLOCK_PIN SCK
#define DATA_PIN MOSI

CRGB color;
char colorToEdit;

// Define the array of leds
CRGB matrix[NUM_LEDS];

void setup() {
  Serial.begin(115200);
  Serial.println("resetting");
  LEDS.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(matrix, NUM_LEDS);
  LEDS.setBrightness(15);

  //Display our current color data
  Serial.print("Red Value: ");
  Serial.println(color[0]);
  Serial.print("Green Value: ");
  Serial.println(color[1]);
  Serial.print("Blue Value: ");
  Serial.println(color[2]);
  Serial.println();      
}

void loop()
{
  if (Serial.available()) //Check to see if we have new Serial data.
  {
    colorToEdit = Serial.read();
    switch (colorToEdit)
    {
      case 'R':
      case 'r':
        color[0] = Serial.parseInt();
        break;
      case 'G':
      case 'g':
        color[1] = Serial.parseInt();
        break;
      case 'B':
      case 'b':
        color[2] = Serial.parseInt();
        break;
    }
    //Display our current color data
    Serial.print("Red Value: ");
    Serial.println(color[0]);
    Serial.print("Green Value: ");
    Serial.println(color[1]);
    Serial.print("Blue Value: ");
    Serial.println(color[2]);
    Serial.println();
    for (int i = 0; i < NUM_LEDS; i++)
    {
      matrix[i] = color;
      FastLED.show();
      delay(10);
    }
  }
}

That code works 100% of the time, every time. I changed the Clock and Data pins to match the “Poke Home” connections on the “Documents” → “Hookup Guide” for the SparkFun ESP32 DMX to LED Shield,

https://learn.sparkfun.com/tutorials/sp … ncQAvD_BwE

So in theory, if SparkFun documentation is correct, using the same code should still pass the same results, without even using DMX, with the shield attached. I’ve tried with external power supply to the board, I’ve tried without external power supply to the board. No dice. I am reading 5v on the shield where I’d expect 5v to be present.

I can’t get unedited example 1 or 2 of the SparkFunDMX examples to compile, due to errors

“In member function ‘void SparkFunDMX::update()’:”

"error: ‘U2TXD_OUT_IDX’ was not declared in this scope

pinMatrixOutAttach(txPin, U2TXD_OUT_IDX, false, false);"

"note: suggested alternative: ‘U0TXD_OUT_IDX’

pinMatrixOutAttach(txPin, U2TXD_OUT_IDX, false, false);"

" U0TXD_OUT_IDX"

"exit status 1

Compilation error: exit status 1"

Which is why I’m not even trying to use the DMX function currently, because at this point I just want to see code passed through the shield.

Somebody…

Anybody…

If you’re out there…

Please help.

-James

Okay so more fun development in the journey,

While having a shower beer at 10:30am CST, because of surely unrelated reasons, I got the idea to just meter, with continuity, the DMX IO Shield to see what the Poke Home connections relate to on the ESP32 pins. Weirdly enough, Ground on the IO goes to GND on the ESP32, 5v goes to VUSB, and NONE of the D0-D2 or C0-C2 pass continuity directly to the main pinouts, but instead pass through a chip labeled

"YE04

15KG4

CJOE"

Which appears to be a “4-BIT BIDIRECTIONAL VOLTAGE-LEVEL TRANSLATOR WITH AUTOMATIC DIRECTION SENSING AND ±15-kV ESD PROTECTION”.

G - Trace 7

on the “bottom” of the chip

5V - Trace 1

D0 - Trace 3

D1 - Trace 2

D2 - Trace 4

C0-C2 - Trace 5

on the “top” of the chip

Which based off of this data sheet I found for what I think the chip is https://html.alldatasheet.com/html-pdf/ … /YE04.html it seems that the traces correspond to:

G - GND

5v - VCCB

D0 - B2

D1 - B1

D2 - B3

C0-C2 - B4

After hitting that chip, with or without power, I can’t find where the Data or Clock lines go as far as to the Thing Plus.

Hopfully this digging has helped some?

-James

Hello all,

I have exactly the same error:

C:\Users\xxx\Documents\Arduino\libraries\SparkFunDMX-master\src\SparkFunDMX.cpp: In member function 'void SparkFunDMX::update()':
C:\Users\xxx\Documents\Arduino\libraries\SparkFunDMX-master\src\SparkFunDMX.cpp:127:31: error: 'U2TXD_OUT_IDX' was not declared in this scope
     pinMatrixOutAttach(txPin, U2TXD_OUT_IDX, false, false);
                               ^~~~~~~~~~~~~
C:\Users\xxx\Documents\Arduino\libraries\SparkFunDMX-master\src\SparkFunDMX.cpp:127:31: note: suggested alternative: 'U0TXD_OUT_IDX'
     pinMatrixOutAttach(txPin, U2TXD_OUT_IDX, false, false);
                               ^~~~~~~~~~~~~
                               U0TXD_OUT_IDX

exit status 1

Compilation error: exit status 1

tried the suggested alternative ( ‘U0TXD_OUT_IDX’) without success.

Any idea on how to resolve it? Any help would be greatly appreciated:)

Thanks!

“ Once you have created your post a Technical Support Representative will review the topic shortly and will respond to the post in about 3 estimated business days if it fits our criteria for technical support eligibility.”

So do we just return the items or what?

I do not have a Tinhg Plus DMX to led shield but looked at the library. It looks to me this has to do with library incompatibities between the Sparkfun ESP32 library and “the big brother” from Expressif. Not sure which one you use.

Try this in SparkfunDMX.cpp, function update() around line 127:

If you are using the Expressif bigger brother (2.0.6) replace U2TXD_OUT_IDX with: UART_TX_SIGNAL(2)

else try to change U2TXD_OUT_IDX to 198 That is the number the variable will end up to be on a ThingPlus/ESP32. (On an ESP32S3 this will be 18)

else try to add in the top of SparkfunDMX.cpp : #define U2TXD_OUT_IDX 198

Let us know whether it works now

paulvha:
Let us know whether it works now

Well you got it to compile, nicely done there. In the Serial Monitor its reading this to me:

initialized...
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x8 (TG1WDT_SYS_RST),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40029b01
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x524
load:0x4004c000,len:0xa70
load:0x40050000,len:0x2914
entry 0x4004c18c
E (99) timer_group: timer_init(275): HW TIMER divider outside of [2, 65536] range error
E (100) timer_group: timer_set_counter_value(86): HW TIMER NEVER INIT ERROR
E (103) timer_group: timer_start(97): HW TIMER NEVER INIT ERROR
E (108) timer_group: timer_isr_callback_add(227): HW TIMER NEVER INIT ERROR
E (115) timer_group: timer_set_alarm_value(155): HW TIMER NEVER INIT ERROR
E (122) timer_group: timer_set_auto_reload(132): HW TIMER NEVER INIT ERROR
E (128) timer_group: timer_set_alarm(179): HW TIMER NEVER INIT ERROR

I tried hooking it up to a console for DMX control and no dice, so I’m not sure.

Thanks for the assist!

Edit: I JUST SEE THERE IS AN INTERRUPT TIMER IN SPARKFUN.CPP. Here is something missing it seems.

The call: timer = timerBegin(0, 1, true); in initread() is to ambitous.

0 = timer

1 = divider

true = countup

The 1 seems to be out of range as that is used for the divider and deemed out of range. In timerBegin() it will call for timer_init(). Looking at https://techtutorialsx.com/2017/10/07/e … nterrupts/ it looks like an interesting article. That can help.

Does this fail with example 1 already (the simplest ?)

If you are using the bigger Expressif library can you try to use the Sparkfun ESP32 and/OR the opposite? Make sure you have the latest versions of each (Expressif ESP32 2.0.6 and Sparkfun ESP32 1.0.1)

Apart from that there are articles on how to analyze the register dump. It might give a better glue where to look otherwise

The Thing Plus DMX to LED shield has two different (and unrelated) functions. It supports DMX (using the serial port on the ESP32). It also supports three LED clock/data style ports (using GPIO and level shifters to convert them to 5V levels. You need different software and libraries to talk to each of them.

The schematic can be found at https://cdn.sparkfun.com/assets/c/1/c/c … Shield.pdf

The LuMini is NOT a DMX device; it will work with the fastLED library or anything else that supports the AP102 LEDs. If you are not trying to drive any DMX devices, just ignore that part of the board and libraries to drive it.

/mike

What I’m trying to do is take DMX into the ESP32-S2 via the DMX shield from a lighting console to control LED lights, In this case the LuMini.

In my understanding of DMX, I should be able to take the Example 2 and then patch a 5 channel DMX fixture into my console that matches the 5 channels in the code and it works 1 to 1.

nlist is right that there are different libraries you can use with this board. I think you should be able to make some sort of combination of those. Let’s try to see if the earlier timer issue can be solved. (if not already with the previous thoughts)

Try to change the divider with a different value

timer = timerBegin(0, 1, true); to timer = timerBegin(0, 2, true); 

But as the clock will now trigger speed/2 also then line 72 from

timerAlarmWrite(timer, 320, true); to timerAlarmWrite(timer, 160, true);

Maybe try other divider-values and values as well.