esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

WLED does not work with Hyperion as a UDP device #1403

Closed asonjay90 closed 4 years ago

asonjay90 commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

Hass.io

ESP (ESP32/ESP8266, Board/Sonoff):

NodeMCU - ESP8266

Affected component:

wled

Description of problem: https://beta.esphome.io/components/light/index.html I am unable to get Hyperion to successfully output to a nodeMCU setup with esphome (beta) using the wled component. Its not immediately clear if this is supported, however it is explicitly mentioned in the WLED documentation: https://github.com/Aircoookie/WLED/wiki/UDP-Realtime-Control (which is also called out in the wled_light_effect.cpp#L17

Using protocol 0 and type udp (or udpraw), I am unable to get the LEDs to turn on. The following is endlessly seen in the log while the Hyperion server is enabled. Stopping the Hyperion service results in this messages no longer being written to the log, so I am confident I have this setup correctly.

[23:41:30][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).

Problem-relevant YAML-configuration entries:

livingroom_tv_leds.yaml

esphome:
  name: livingroom_tv_leds
  platform: ESP8266
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wled:

# LED Config
light:
  - platform: neopixelbus
    name: "TV LEDs"
    id: TV_leds
    variant: WS2812X
    pin: GPIO3
    num_leds: 298
    type: GRB
    effects:
    - wled

The YAML is shortened to the relevant parts.

Logs (if applicable):

INFO Reading configuration /config/esphome/livingroom_tv_leds.yaml...
INFO Starting log output from livingroom_tv_leds.local using esphome API
INFO Connecting to livingroom_tv_leds.local:6053 (10.10.0.63)
INFO Successfully connected to livingroom_tv_leds.local
[23:49:52][I][app:105]: ESPHome version 1.16.0-dev compiled on Aug  7 2020, 23:16:47
[23:49:52][C][wifi:443]: WiFi:
[23:49:52][C][wifi:303]:   SSID: [redacted]
[23:49:52][C][wifi:304]:   IP Address: 10.10.0.63
[23:49:52][C][wifi:306]:   BSSID: [redacted]
[23:49:52][C][wifi:307]:   Hostname: 'livingroom_tv_leds'
[23:49:52][C][wifi:311]:   Signal strength: -61 dB ▂▄▆█
[23:49:52][C][wifi:315]:   Channel: 6
[23:49:52][C][wifi:316]:   Subnet: 255.255.255.0
[23:49:52][C][wifi:317]:   Gateway: 10.10.0.1
[23:49:52][C][wifi:318]:   DNS1: 10.10.0.2
[23:49:52][C][wifi:319]:   DNS2: (IP unset)
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:52][C][logger:185]: Logger:
[23:49:52][C][logger:186]:   Level: DEBUG
[23:49:52][C][logger:187]:   Log Baud Rate: 115200
[23:49:52][C][logger:188]:   Hardware UART: UART0
[23:49:52][C][light:177]: Light 'TV LEDs'
[23:49:52][C][light:179]:   Default Transition Length: 1.0s
[23:49:52][C][light:180]:   Gamma Correct: 2.80
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:52][C][light:177]: Light 'TV LED Top'
[23:49:52][C][light:179]:   Default Transition Length: 1.0s
[23:49:52][C][light:180]:   Gamma Correct: 2.80
[23:49:52][C][light:177]: Light 'TV LED Left'
[23:49:52][C][light:179]:   Default Transition Length: 1.0s
[23:49:52][C][light:180]:   Gamma Correct: 2.80
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:52][C][light:177]: Light 'TV LED Bottom'
[23:49:52][C][light:179]:   Default Transition Length: 1.0s
[23:49:52][C][light:180]:   Gamma Correct: 2.80
[23:49:52][C][light:177]: Light 'TV LED Right'
[23:49:52][C][light:179]:   Default Transition Length: 1.0s
[23:49:52][C][light:180]:   Gamma Correct: 2.80
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:52][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][C][captive_portal:169]: Captive Portal:
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][C][ota:029]: Over-The-Air Updates:
[23:49:53][C][ota:030]:   Address: livingroom_tv_leds.local:8266
[23:49:53][C][api:095]: API Server:
[23:49:53][C][api:096]:   Address: livingroom_tv_leds.local:6053
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
[23:49:53][D][wled_light_effect:067]: Frame: Invalid (size=894, first=0x00).
....

Additional information and things you've tried:

This is my Hyperion device config:

        // DEVICE CONFIGURATION 
        "device" :
        {
                "name"       : "Livingroom-TV",
                "type"       : "udpraw",
                "output"     : "10.10.0.63:21324",
                "rate"     : 1000000,
                "maxpacket"     : 1450,
                "protocol"     : 0,
                "colorOrder" : "rgb"
        },

I have 298 leds setup, so I am clearly only including the relevant part here.

https://hyperion-project.org/wiki/UDP-Device Looking at Hyperion documentation, its clear the expected information is being sent for protocol 0:

Packet Format protocol 0: 3 bytes per LED as R, G, B

298 LEDs * 3 bytes per LED = 894

Additionally, i know I have this (somewhat) working correctly as when I use protocol 2 (DRGB) I am able to get the leds to light the expected color. However the refresh rate is extremely slow (1fps) and the leds flash funky colors in between transitions.

close-issue-app[bot] commented 4 years ago

This issue was auto-closed because the issue template was not filled out. The ESPHome developers invest lots of time to maintain this project, so please at least fill out the issue template so that a bunch of standard questions don't need to be asked again each time. Thank you for taking the time to report a bug, hopefully it can be resolved soon.