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

DMX Read - Unstable packet.size depends on the number of DMX channels #121

Closed
DenkyTuna opened this issue Jan 16, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@DenkyTuna
Copy link

DenkyTuna commented Jan 16, 2024

Describe the bug

If the number of received DMX channels is certain amount near 512ch, packet.size will be unstable.

To reproduce

  • Board: M5Stack CoreS3 - a kind of ESP32-S3
  • IDE: Arduino IDE (with M5Unified.hpp installed)
  • esp_dmx: v3.1.0
  • Use DMXRead.ino sample, but just add Serial.printf("packet.size is %d and DMX_PACKET_SIZE is %d\n", packet.size, DMX_PACKET_SIZE); after Serial.printf("Start code is 0x%02X and slot 1 is 0x%02X\n", data[0], data[1]);
  • Input DMX Signal at various number of channels

Result

When the number of channel is 512, and slot 1 is fixed 0x97,
Start code is 0x00 and slot 1 is 0x97
packet.size is 52 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 396 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 142 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 487 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 257 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 27 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 370 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 192 and DMX_PACKET_SIZE is 513
.....
(sometimes Serial.println("DMX was disconnected."); is called and DMX input stops.)

When the number of channel is 511, and slot 1 is fixed 0x97,
Start code is 0x00 and slot 1 is 0x00
packet.size is 511 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x00
packet.size is 511 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x00
packet.size is 511 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x00
packet.size is 511 and DMX_PACKET_SIZE is 513
....

When the number of channel is 510, and slot 1 is fixed 0x97,
Start code is 0x00 and slot 1 is 0x97
packet.size is 511 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 511 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 511 and DMX_PACKET_SIZE is 513
...

When the number of channel is 500, and slot 1 is fixed 0x97,
Start code is 0x00 and slot 1 is 0x97
packet.size is 501 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 501 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 501 and DMX_PACKET_SIZE is 513
Start code is 0x00 and slot 1 is 0x97
packet.size is 501 and DMX_PACKET_SIZE is 513

Analysys

From above result, it can be said

  • 512ch input causes unstable packet.size, also unstable DMX input
  • 511ch input causes wrong reading of Slot 1 (it should be 0x97, but forced to 0x00)
  • 510ch or less input causes stable DMX input

I don't know if this is specific to M5Core or general ESP32-S3 issue.

Environment

OS: Windows 10
IDE &IDE Version: Arduino IDE 2.2.1
Repository Version: 3.1.0 (the newest one)

@someweisguy
Copy link
Owner

Thanks for the report. I am going to investigate this issue.

Using the base ESP32, I am unable to replicate this issue exactly. But I am seeing that when the ESP32 receives 512 slots, it reports the packet.size as 511. It reports this value consistently. I suspect these issue are related.

@someweisguy someweisguy added the bug Something isn't working label Jan 17, 2024
@DenkyTuna
Copy link
Author

For temporary solution, if there is a way to "regulate" the input channel count, that will work for the people who work with small shows and don't need full 512ch capability.

This was referenced Jan 27, 2024
@someweisguy
Copy link
Owner

I believe I have fixed this issue in v4.0.0. I ran some ad-hoc tests that passed. I'll close this for now; let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants