# LED Output over serial (Adalight/TPM2)

**URL:** <https://wled.discourse.group/t/led-output-over-serial-adalight-tpm2/13875>\
**Category:** Enhancements\
**Created:** [January 11, 2025, 10:17pm UTC](https://wled.discourse.group/t/led-output-over-serial-adalight-tpm2/13875 "2025-01-11T22:17:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chefbauer](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@chefbauer](https://wled.discourse.group/u/chefbauer)\
**Post date:** [January 11, 2025, 10:17pm UTC](https://wled.discourse.group/t/led-output-over-serial-adalight-tpm2/13875/1 "2025-01-11T22:17:50Z")

</div>

Hello,

i need (would like to have) a **serial LED Output** connection without wifi!  
WLED =\> SERIAL (Adalight/TPM2) =\> ESPHOME (and other).  
Esphome is already capable getting Adalight data over serial  
([Light Component — ESPHome](https://esphome.io/components/light/index.html#adalight-effect))

Please consider enabling serial Adalight output similar to network output!

Edit: TPM2 is also ok, as there is already a TPM2 Output on Serial

```auto
LED data query

To get the colors currently displayed by LEDs:
    Send an uppercase 'L' (byte 0x4C) to request the current LED data as a tpm2 data packet in 24-bit RGB format.

```

EDIT: i can´t get more than 3 fps with 396px, does not matter with 1500000bps or 115200bps. Wled does not react when i increase the request rate. (wled moon modules self compiled (base on esp32S3\_4MB\_PSRAM\_M)  
EDIT2: found in MM when you send ‘O’ it already send a stream. ‘o’ stopps it.  
But is too fast, there should be serial\_fps option. 5 or 6 fps are possible.

If someone want, this is a function to output Adalight, almost the same to TPM2

```auto
void sendBytesAda(){
  byte check = 0x00;

  if (!pinManager.isPinAllocated(hardwareTX) || pinManager.getPinOwner(hardwareTX) == PinOwner::DebugOut) {
    if (!Serial) return; // WLEDMM avoid writing to unconnected USB-CDC
    Serial.write('A'); Serial.write('d'); Serial.write('a');
    uint16_t used = strip.getLengthTotal();
    uint16_t len = used*3;
    Serial.write(highByte(len));
    Serial.write(lowByte(len));
    check = highByte(len) ^ lowByte(len) ^ 0x55; //XOR
    Serial.write(check);  

    for (uint16_t i=0; i < used; i++) {
      uint32_t c = strip.getPixelColor(i);
      Serial.write(qadd8(W(c), R(c))); //R, add white channel to RGB channels as a simple RGBW -> RGB map
      Serial.write(qadd8(W(c), G(c))); //G
      Serial.write(qadd8(W(c), B(c))); //B
    }
    //Serial.write(0x36); Serial.write('\n'); # nix zum schluss!
  }
}

```

Reason:  
I have a working setup with wifi:  
Esphome on a ESP32, with a led matrix display (WS2812 396px).  
I switch data from esphome and WLED.  
with the DDP component ([GitHub - KaufHA/common: Common files between all products](https://github.com/KaufHA/common)) i can display wled data, it works great over wifi, thank you 🙂

If there is any other method getting the WLED LED data stream to esphome without wifi please let me know!

thanks,  
roman
