Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

physical DMX-out on ESP32-C3 (found possible fix) #4239

Open
1 task done
5t0n3r1pp3r opened this issue Nov 1, 2024 · 2 comments
Open
1 task done

physical DMX-out on ESP32-C3 (found possible fix) #4239

5t0n3r1pp3r opened this issue Nov 1, 2024 · 2 comments
Labels
documentation documentation should be updated to explain behaviour enhancement

Comments

@5t0n3r1pp3r
Copy link

What happened?

When compiling any version of wled from source(vscode Dev Container)

The DMX pin does not allocate and flickers an led but no DMX is sent reliably. No Light turns on from DMX

I tested the circuit and confirmed the rs485 chip works fine on nodeMCU.

To Reproduce Bug

Compile any 0.15 WLED with DMX on for ESP32-C3-Mini-1 and connect a MAX485 circuit to pin 2.

Expected Behavior

The board should control and send proper DMX on the selected PIN

Install Method

Self-Compiled

What version of WLED?

WLED 0.15.0-b6

Which microcontroller/board are you seeing the problem on?

ESP32-C3

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@5t0n3r1pp3r 5t0n3r1pp3r added the bug label Nov 1, 2024
@5t0n3r1pp3r
Copy link
Author

5t0n3r1pp3r commented Nov 1, 2024

Found a solution
After more testing it seems like the pin is being taken over by another process. If i change the pin the odd blink follows it and i cannot get the pin to output correctly
after further testing from adding explicit pin selections in:
ESPDMX.cpp

// Initialize Serial1 with the specified TX pin (2) and no RX
  Serial1.begin(DMXSPEED, DMXFORMAT, -1, sendPin);

This made the DMX start working. I can still see the led flash but the dmx is working on C3- Mini.

Should this line be changed if someone wants to use a different pin?

#ifdef WLED_ENABLE_DMX //reserve GPIO2 as hardcoded DMX pin
  PinManager::allocatePin(2, true, PinOwner::DMX);
#endif

this is found in wled.ccp line 416

@softhack007
Copy link
Collaborator

softhack007 commented Nov 1, 2024

@5t0n3r1pp3r not sure what you're doing .... ESPDMX.cpp is only for 8266. Whatever you change there won't affect your -C3 board.


For esp32 boards, we use the sparkFun DMX driver:

Unfortunately the sparkFun driver needs serial2 which is not availeable on -C3 or -S2.

// Some new MCUs (-S2, -C3) don't have HardwareSerial(2)
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
#if SOC_UART_NUM < 3
#error DMX output is not possible on your MCU, as it does not have HardwareSerial(2)
#endif
#endif
static HardwareSerial DMXSerial(2);
/* Interrupt Timer for DMX Receive */
#if !defined(DMX_SEND_ONLY)


Compile any 0.15 WLED with DMX on for ESP32-C3-Mini-1 and connect a MAX485 circuit to pin 2.
The board should control and send proper DMX on the selected PIN

As consequence of what I explained, currently you can't have DMX serial output from WLED on the -C3 board, sorry. Same for -S2. However -S3 mini or -S3 zero might work, if you are looking for a small board.

@softhack007 softhack007 changed the title DMX on ESP32-C3-Mini-1 not working (found fix) physical DMX-out on ESP32-C3 (found fix?) Nov 1, 2024
@softhack007 softhack007 added the documentation documentation should be updated to explain behaviour label Nov 2, 2024
@5t0n3r1pp3r 5t0n3r1pp3r changed the title physical DMX-out on ESP32-C3 (found fix?) physical DMX-out on ESP32-C3 (found possible fix) Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation should be updated to explain behaviour enhancement
Projects
None yet
Development

No branches or pull requests

2 participants