Issue with Thing Plus DMX to LED Shield and ESP32 Thing Plus

I have 2 pair of the above mentioned boards. The work the same.

I am trying to receive DMX from a Enttec USB DMX device. I have tested this on other DMX devices and it works.

I am trying the simplest DMX receive example and sending the DMX data to the serial port. I am pulling RGB elements from channels 1-3.

The data read seems random and does not reflect the DMX data.

I find it unlikely I have 2 sets of bad boards.

I am using the Sparkfun ESP32 profile and I have tried the Adafruit ESP 32 profile.

I am stuck and could use advice.

Thank you,

Greg

Simplified code

/*

Read the 5 Channels of DMX Data coming from an ESP32 shield running Example 1

By: Andy England

SparkFun Electronics

Date: , 2018

License: GNU. See license file for more information but you can

basically do whatever you want with this code.

This example runs two servos and a number of LED’s off of 5 DMX channels

Feel like supporting open source hardware?

Buy a board from SparkFun! https://www.sparkfun.com/products/15110

Hardware Connections:

Connect pan/tilt servos to pins DATA1 and DATA2, connect LEDs to CLOCK and DATA0. Connect a DMX XLR-3 Cable in between the Output and Input shields

*/

#include <SparkFunDMX.h>

// #include <FastLED.h>

SparkFunDMX dmx;

//Pin Definitions for ESP32 WROOM

//Channel Defintions

#define TOTAL_CHANNELS 16

#define RED_CHANNEL 11

#define GREEN_CHANNEL 12

#define BLUE_CHANNEL 13

void setup()

{

Serial.begin(115200);

dmx.initRead(TOTAL_CHANNELS); // initialization for complete bus

Serial.println(“initialized…”);

}

void loop()

{

dmx.update();

Serial.print(dmx.read(RED_CHANNEL)); Serial.print(" ");

Serial.print(dmx.read(GREEN_CHANNEL)); Serial.print(" ");

Serial.println(dmx.read(BLUE_CHANNEL)); Serial.print(" ");

delay(10);

}

// garbage data

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

63 35 0

63 35 0

63 35 0

35 0 0

0 0 0

0 0 0

0 0 0

0 0 0

35 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

96 0 0

96 0 0

96 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 63 35

0 63 35

0 63 35

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 192

0 0 192

0 0 192

0 0 192

0 0 192

0 0 192

0 0 192

0 0 192

0 0 192

0 0 0

63 35 0

63 35 0

63 35 0

63 35 0

63 35 0

0 0 0

0 0 0

35 0 0

35 0 0

35 0 0

35 0 0

0 0 0

63 35 0

63 35 0

63 35 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

Support, still need assistance with this issue! Please advise!

You say that you are looking at DMX channels 1-3 but the code looks at 11-13

/mike

I agree with n1ist. Also,

What product are you using exactly? On some modules, it seems that their could be communication issues outside of using provided USB or other computer interface methods. My guess would be that the DMX Shield is operational but the communication lines could be screwy.

Your 2 products.

https://www.sparkfun.com/products/15110

https://www.sparkfun.com/products/15663

Sending dmx works fine. Receiving is messed up. No WiFi involved. The channels are incorrect, debugging side effect. But still does not work.

Please verify your example code is correct, and advise which board you built against. What is the recommendation for the ESP32 plus?

Greg

What

By the way. It appears that the schematic for the DMX board is incorrect. I think the TX and RX signals are swapped.

Greg

“We’ve also moved a few pins around to make the board compatible with the Adafruit Huzzah32 – ESP32 Feather Board such that you can use all of those lovely shields available out there!”. Is it possible the changes effected DMX receive?

It appears that the schematic for the DMX board is incorrect. I think the TX and RX signals are swapped.

Where do you see this? In the schematics, it seems that the ESP pin 16 (RX) matches the DMX pin 14 (TX). Those should be correct.

I am trying to receive DMX from a Enttec USB DMX device

When I was saying that there could be some communication issues was for the device you mentioned in your original post.

Please advise as to the esp-32 board configuration that is a known to work.

How can we escalate to resolve this. I am not a beginner.

Greg

We haven’t had an issue with our current designs relating to this issue. Unfortunately, I can’t replicate your setup. Can you try providing images of your setup?

I have attached the DMX schematic that I believe is incorrect. It has notes on it.

I will try and get 2 DMX boards talking to each other, one transmitting DMX over the DMX cable, and one receiving DMX from the DMX cable. Is there any reason that should not work? Could someone verify that works at your end, and let me know which board options were used.

Thank you,

Greg

You’re attachment didn’t upload successfully. Please make sure next time the attachment has a green checkmark to the right.

Aside from that, you can try to use the GitHub repository: https://github.com/claudeheintz/LXESP32DMX. We haven’t experienced this issue and haven’t been able to replicate it.

I am very frustrated with this situation. I spent the day trying again to make this work.

I have taken 2 sets of the DMX Shield with the ESP32 Thing Plus. I connected them together with a single DMX cable. I have added a DMX terminator.

I have attached 3 files, the marked up schematic, a picture of my setup, and a screen shot of the feather profile I am using.

PLEASE HELP. This is something that is part of a large project. This has been nagging for more than a month. Please verify on your end that this works. PLEASE. I am suspicious that DMX receive library is broken. Please verify that you can send and receive from your own products. It should be a 15 minute project to validate on your side. I know Covid is an issue but I have done everything to validate this test case I can think of. The board has lots of applications including WIFI, DMX and LED strips. It seems possible that no one has tried receiving wired DMX.

I have written minimal sketch for sending a single channel.

//Blink DMX Test

// Simple Send

#define TOTAL_CHANNELS 10

#include <SparkFunDMX.h>

SparkFunDMX dmx;

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin LED_BUILTIN as an output.

pinMode(LED_BUILTIN, OUTPUT);

dmx.initWrite(TOTAL_CHANNELS); // setup DMX for 10 channels

}

int count = 0;

// the loop function runs over and over again forever

void loop() {

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay(500); // wait for a second

digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

delay(500); // wait for a second

dmx.write(1, count); // update channel 1

dmx.update(); // write it out

count +=10; // increment count by 10;

if (count>250) // update count by 10

count = 0;

}

I have also written a simple receive program

//Blink DMX Test

// Simple Receive

#include <SparkFunDMX.h>

#define TOTAL_CHANNELS 10

//Pin Definitions for ESP32 WROOM DMX to LED Shield

#define CLOCK = 5;

#define DATA0 = 19;

#define DATA1 = 18;

#define DATA2 = 27;

SparkFunDMX dmx;

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin LED_BUILTIN as an output.

Serial.begin(115200);

while(!Serial)

;

delay(3000);

Serial.println(“DMX Receive started…”);

dmx.initRead(TOTAL_CHANNELS);

pinMode(LED_BUILTIN, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

int temp = dmx.read(1); // read channel 1

if (temp>0) // if the value is not 0…

{

Serial.println();

Serial.println(“SCORE!!!”); //

Serial.print(temp); Serial.println(" ");

}

else

{

Serial.print(“.”);

}

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

delay(100); // wait for a second

digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

delay(100); // wait for a second

}

BTW. The result is ALWAYS 0

You should try using this library instead and see if it fixes the issue:

https://github.com/claudeheintz/LXESP32DMX

I will go ahead and let our engineering team know that the SparkFun libraries for this product need to be reviewed. This task should get prioritized soon.

Please let me know if I can do anything else and I hope you have a wonderful day.

“BTW. The result is ALWAYS 0”

I had the same issue, I have to add 1 to whatever channel I’m reading. So if I want to read channel 1 of the DMX receive, I need to write: dmx.read(2). This is a bug in their library. I have your setup running using the demo code, and besides that +1 issue, it seems to work fine. I am using an Elation DMX board as a DMX source. It’s possible the enttec USB DMX source is wonky and is sending out code that isn’t within DMX spec, but the DMX devices are accepting it.

Regarding the schematic error, I saw the same thing, but Tx and Rx are relative. In this case I believe TX/RX is from the point of view of the DMX board, not the ESP32.

This still doesn’t fix your garbage data problem reading all zeros. If I had to guess, either you are trying to parse garbage, or your stream is getting shifted. Occasionally on my setup, I get channel 2 popping into channel 1 on my receive. You’re either reading frames too quickly, or too far apart. Try adjusting your delay to 0 and up to maybe 100.

If it’s not that, try a different DMX source. Those enttec ones are software driven and it’s possible it’s running on one edge of the spec and the sparkfun library is riding on the other edge. Specifically on the start code timing. If you go into the SparkFunDMX.cpp file and look for the following:

	if (_interruptCounter > 9)
	{	
		portENTER_CRITICAL_ISR(&timerMux);
		_startCodeDetected = true;
		DMXSerial.begin(DMXSPEED, DMXFORMAT, rxPin, txPin);
		portEXIT_CRITICAL_ISR(&timerMux);
		_interruptCounter = 0;}

You can change the 9 to a higher or lower value to adjust for the timing of the start code. May or may not work, but those are the knobs I would turn if I was trying to get it to work.

Good luck!