Back to engineering archive

Record 055 / Connected systems

Art-Net UDP lighting interface

A lighting interface using Art-Net and UDP communication.

Firmware module
Art-NetUDPLighting control

Firmware flow

How lighting data becomes an LED frame

An Art-Net universe is a group of lighting channels. This flow checks whether the expected groups have arrived.

Check packet tracking, place the RGB values into the LED buffer and update the remembered packet length. Display the frame and reset tracking only when the frame-ready flag is set.

The excerpt begins after earlier callback setup. It does not show how the frame-ready flag is initially set or how missing packets are recovered.

Read the implementation

onDmxFrame excerpt · selected source lines 72–94. Source inspection is not a hardware test.

  // Check that all universes have been received
  for (int i = 0; i < maxUniverses; i++) {
    if (!universesReceived[i]) {
      Serial.println("Something is broken...");
      sendFrame = false;
      break;
    }
  }

  // Map the DMX data to the appropriate LED(s) on the strip.
  for (int i = 0; i < length / 3; i++) {
    int led = i + (universe - startUniverse) * (previousDataLength / 3);
    if (led < numLeds)
      leds.setPixelColor(led, data[i * 3], data[i * 3 + 1], data[i * 3 + 2]);
  }
  previousDataLength = length;

  // Once all universes have been received, update the LED strip and reset the tracking array.
  if (sendFrame) {
    leds.show();
    memset(universesReceived, 0, sizeof(universesReceived));
  }
}
Open the exact source-level diagram
ActionCheck the tracked lighting packetsIf data for an expected Art-Net universe is missing, the frame is marked incomplete.
ActionMap RGB bytes to LED positionsOnly positions below the LED count are written.
ActionRemember this packet length
Result · YesDisplay the frame and clear packet tracking
Result · NoKeep the buffered values without displaying

Technical notes

Art-Net reception

Art-Net carries lighting data over UDP into the embedded application.

Network and output handling

Network reception and local lighting output are separate parts of the interface.

Protocol integration

The module connects incoming lighting-protocol data with the firmware that controls the output.

Engineering archiveArchive record

Project enquiries

Discuss your project.

Tell us what you’re developing and where you need engineering support.

Discuss your project