WS2812 only works after programming, not after replugging

Hi there, i have a strang problem:

i am using a esp devikit 01 and want to drive two WS2812 LEDs in a row. to do so i am using this yaml:

esphome:
  name: led

esp32:
  board: esp32doit-devkit-v1

wifi:
  ssid: "essid"
  password: "pass"
  ap:
    ssid: "fallback ESP01"
    password: "pass"

captive_portal:
logger:
api:

light:
  - platform: fastled_clockless
    chipset: WS2812
    pin: GPIO13
    num_leds: 2
    rgb_order:  GRB
    name: "led"

wich works when i have just programmed it via esphome. when i unplug the device and then replug it, i the esp and its light shows up in homeassistant, but the leds do not light up anymore.

I have tried several GPIO pins because i feared that some pullup or similar could prevent it from working, but i have no clue anymore.

Booting first time after programming works and i can set colors etc, after unplugging and replugging it does not - but is connected to wifi and also is available in homeassistant (i can also move the slider in homeassistant but nothing happens…)

any help would be appriciated!! Thanks a lot!

Post your logs

Wich logs - from the esp? or from Homeassistant?
sorry for beeing a little stupid, i am just starting with the whole homeassistant / esphome thing :slight_smile:

From esphome

Hi, sorry for the stupid question, but how can i see the logs when its not connected anymore? is there any way to get it wireless?

Cheers and thanks!

Via serial.

Are you using the ESPHome add-on? I can’t help with that, but if you have a terminal you can run esphome logs <yaml_file>.

Hi there, i have some logs now: it represents the run directly after programming (until time 21:53:00). the led works flawlessly. then 21:53:12 i reboot the device by by pressing the reboot botton on the esp. The led does not work anymore, but shows as working in the logs and the home assistant ui.
Is there anything strange with the fastled_clockless implementation?

Any idea would be awesome!!

Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 492.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/cu.usbserial-0001 with baud rate 115200
[21:52:25][I][logger:268]: Log initialized
[21:52:25][I][app:029]: Running through setup()...
[21:52:25][C][fastled:012]: Setting up FastLED light...
[21:52:25][C][light:035]: Setting up light 'StarsternLED'...
[21:52:25][D][light:036]: 'StarsternLED' Setting:
[21:52:25][D][light:041]:   Color mode: RGB
[21:52:25][D][light:085]:   Transition length: 1.0s
[21:52:25][C][wifi:038]: Setting up WiFi...
[21:52:25][C][wifi:051]: Starting WiFi...
[21:52:25][C][wifi:052]:   Local MAC: ...............
[21:52:25][D][wifi:428]: Starting scan...
[21:52:31][D][wifi:443]: Found networks:
[21:52:31][I][wifi:487]: - 'WIFI' (....................) ▂▄▆█
[21:52:31][D][wifi:488]:     Channel: 6
[21:52:31][D][wifi:489]:     RSSI: -48 dB
[21:52:31][I][wifi:487]: - 'WIFI' (..........) ▂▄▆█
[21:52:31][D][wifi:488]:     Channel: 6
[21:52:31][D][wifi:489]:     RSSI: -69 dB
[21:52:31][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'TARDIS' (........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'Vodafone Homespot' (...........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'fritz' (............) ▂▄▆█
[21:52:31][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'KabelBox-B1E8' (.........) ▂▄▆█
[21:52:31][D][wifi:492]: - 'YARVIS MK III' (.........) ▂▄▆█
[21:52:31][I][wifi:277]: WiFi Connecting to 'WIFI'...
[21:52:32][W][wifi_esp32:465]: Event: Disconnected ssid='WIFI' bssid=.................... reason='Authentication Failed'
[21:52:32][W][wifi:612]: WiFi Unknown connection status 0
[21:52:32][I][wifi:277]: WiFi Connecting to 'WIFI'...
[21:52:32][W][wifi_esp32:465]: Event: Disconnected ssid='WIFI' bssid=.................... reason='Association Failed'
[21:52:37][D][wifi:428]: Starting scan...
[21:52:39][D][wifi:443]: Found networks:
[21:52:39][I][wifi:487]: - 'WIFI' (..........) ▂▄▆█
[21:52:39][D][wifi:488]:     Channel: 6
[21:52:39][D][wifi:489]:     RSSI: -71 dB
[21:52:39][I][wifi:487]: - 'WIFI' (....................) ▂▄▆█
[21:52:39][D][wifi:488]:     Channel: 6
[21:52:39][D][wifi:489]:     RSSI: -41 dB
[21:52:39][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'TARDIS' (........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone Homespot' (...........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'fritz' (............) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone-02D4' (..............) ▂▄▆█
[21:52:39][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:52:39][I][wifi:277]: WiFi Connecting to 'WIFI'...
[21:52:39][W][wifi:591]: Error while connecting to network.
[21:52:39][W][wifi:627]: Restarting WiFi adapter...
[21:52:39][I][wifi:277]: WiFi Connecting to 'WIFI'...
[21:52:40][I][wifi:560]: WiFi Connected!
[21:52:40][C][wifi:382]:   Local MAC: ...............
[21:52:40][C][wifi:383]:   SSID: 'WIFI'
[21:52:40][C][wifi:384]:   IP Address: 192.168.1.139
[21:52:40][C][wifi:386]:   BSSID: ..........
[21:52:40][C][wifi:387]:   Hostname: 'Starstern'
[21:52:40][C][wifi:389]:   Signal strength: -71 dB ▂▄▆█
[21:52:40][C][wifi:393]:   Channel: 6
[21:52:40][C][wifi:394]:   Subnet: 255.255.255.0
[21:52:40][C][wifi:395]:   Gateway: 192.168.1.1
[21:52:40][C][wifi:396]:   DNS1: 192.168.1.1
[21:52:40][C][wifi:397]:   DNS2: 0.0.0.0
[21:52:40][D][wifi:569]: Disabling AP...
[21:52:40][C][api:025]: Setting up Home Assistant API server...
[21:52:40][I][app:062]: setup() finished successfully!
[21:52:40][I][app:102]: ESPHome version 2023.9.2 compiled on Dec 28 2023, 21:51:57
[21:52:40][C][wifi:546]: WiFi:
[21:52:40][C][wifi:382]:   Local MAC: ...............
[21:52:40][C][wifi:383]:   SSID: 'WIFI'
[21:52:40][C][wifi:384]:   IP Address: 192.168.1.139
[21:52:40][C][wifi:386]:   BSSID: ..........
[21:52:40][C][wifi:387]:   Hostname: 'Starstern'
[21:52:40][C][wifi:389]:   Signal strength: -72 dB ▂▄▆█
[21:52:40][C][wifi:393]:   Channel: 6
[21:52:40][C][wifi:394]:   Subnet: 255.255.255.0
[21:52:40][C][wifi:395]:   Gateway: 192.168.1.1
[21:52:40][C][wifi:396]:   DNS1: 192.168.1.1
[21:52:40][C][wifi:397]:   DNS2: 0.0.0.0
[21:52:40][C][logger:357]: Logger:
[21:52:40][C][logger:358]:   Level: DEBUG
[21:52:40][C][logger:359]:   Log Baud Rate: 115200
[21:52:40][C][logger:361]:   Hardware UART: UART0
[21:52:40][C][fastled:021]: FastLED light:
[21:52:40][C][fastled:022]:   Num LEDs: 2
[21:52:40][C][fastled:023]:   Max refresh rate: 400
[21:52:40][C][light:103]: Light 'StarsternLED'
[21:52:40][C][light:105]:   Default Transition Length: 1.0s
[21:52:40][C][light:106]:   Gamma Correct: 2.80
[21:52:40][C][captive_portal:088]: Captive Portal:
[21:52:40][C][mdns:115]: mDNS:
[21:52:40][C][mdns:116]:   Hostname: Starstern
[21:52:40][C][api:138]: API Server:
[21:52:40][C][api:139]:   Address: Starstern.local:6053
[21:52:40][C][api:143]:   Using noise encryption: NO
[21:52:42][D][api:102]: Accepted 192.168.1.123
[21:52:42][D][api.connection:1031]: Home Assistant 2023.6.3 (192.168.1.123): Connected successfully
[21:52:57][D][light:036]: 'StarsternLED' Setting:
[21:52:57][D][light:047]:   State: ON
[21:52:57][D][light:051]:   Brightness: 51%
[21:52:57][D][light:085]:   Transition length: 1.0s
[21:52:59][D][light:036]: 'StarsternLED' Setting:
[21:52:59][D][light:051]:   Brightness: 72%
[21:52:59][D][light:085]:   Transition length: 1.0s
[21:53:00][D][light:036]: 'StarsternLED' Setting:
[21:53:00][D][light:051]:   Brightness: 100%
[21:53:00][D][light:085]:   Transition length: 1.0s
[21:53:12]ets Jun  8 2016 00:22:57
[21:53:12]
[21:53:12]rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[21:53:12]configsip: 0, SPIWP:0xee
[21:53:12]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[21:53:12]mode:DIO, clock div:2
[21:53:12]load:0x3fff0030,len:1184
[21:53:12]load:0x40078000,len:13132
[21:53:12]load:0x40080400,len:3036
[21:53:12]entry 0x400805e4
[21:53:13][I][logger:268]: Log initialized
[21:53:13][I][app:029]: Running through setup()...
[21:53:13][C][fastled:012]: Setting up FastLED light...
[21:53:13][C][light:035]: Setting up light 'StarsternLED'...
[21:53:13][D][light:036]: 'StarsternLED' Setting:
[21:53:13][D][light:041]:   Color mode: RGB
[21:53:13][D][light:085]:   Transition length: 1.0s
[21:53:13][C][wifi:038]: Setting up WiFi...
[21:53:13][C][wifi:051]: Starting WiFi...
[21:53:13][C][wifi:052]:   Local MAC: ...............
[21:53:13][D][wifi:428]: Starting scan...
[21:53:19][D][wifi:443]: Found networks:
[21:53:19][I][wifi:487]: - 'WIFI' (....................) ▂▄▆█
[21:53:19][D][wifi:488]:     Channel: 6
[21:53:19][D][wifi:489]:     RSSI: -50 dB
[21:53:19][I][wifi:487]: - 'WIFI' (..........) ▂▄▆█
[21:53:19][D][wifi:488]:     Channel: 6
[21:53:19][D][wifi:489]:     RSSI: -68 dB
[21:53:19][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Vodafone Homespot' (........) ▂▄▆█
[21:53:19][D][wifi:492]: - 'TARDIS' (........) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Vodafone Homespot' (...........) ▂▄▆█
[21:53:19][D][wifi:492]: - 'fritz' (............) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Vodafone Hotspot' (...........) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Vodafone-02D4' (..............) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Maxe' (.............) ▂▄▆█
[21:53:19][D][wifi:492]: - 'Vodafone Homespot' (..............) ▂▄▆█
[21:53:19][I][wifi:277]: WiFi Connecting to 'WIFI'...
[21:53:19][I][wifi:560]: WiFi Connected!
[21:53:19][C][wifi:382]:   Local MAC: ...............
[21:53:19][C][wifi:383]:   SSID: 'WIFI'
[21:53:19][C][wifi:384]:   IP Address: 192.168.1.139
[21:53:19][C][wifi:386]:   BSSID: ....................
[21:53:19][C][wifi:387]:   Hostname: 'Starstern'
[21:53:19][C][wifi:389]:   Signal strength: -45 dB ▂▄▆█
[21:53:19][C][wifi:393]:   Channel: 6
[21:53:19][C][wifi:394]:   Subnet: 255.255.255.0
[21:53:19][C][wifi:395]:   Gateway: 192.168.1.1
[21:53:19][C][wifi:396]:   DNS1: 192.168.1.1
[21:53:19][C][wifi:397]:   DNS2: 0.0.0.0
[21:53:19][D][wifi:569]: Disabling AP...
[21:53:20][C][api:025]: Setting up Home Assistant API server...
[21:53:20][I][app:062]: setup() finished successfully!
[21:53:20][I][app:102]: ESPHome version 2023.9.2 compiled on Dec 28 2023, 21:51:57
[21:53:20][C][wifi:546]: WiFi:
[21:53:20][C][wifi:382]:   Local MAC: ...............
[21:53:20][C][wifi:383]:   SSID: 'WIFI'
[21:53:20][C][wifi:384]:   IP Address: 192.168.1.139
[21:53:20][C][wifi:386]:   BSSID: ....................
[21:53:20][C][wifi:387]:   Hostname: 'Starstern'
[21:53:20][C][wifi:389]:   Signal strength: -46 dB ▂▄▆█
[21:53:20][C][wifi:393]:   Channel: 6
[21:53:20][C][wifi:394]:   Subnet: 255.255.255.0
[21:53:20][C][wifi:395]:   Gateway: 192.168.1.1
[21:53:20][C][wifi:396]:   DNS1: 192.168.1.1
[21:53:20][C][wifi:397]:   DNS2: 0.0.0.0
[21:53:20][C][logger:357]: Logger:
[21:53:20][C][logger:358]:   Level: DEBUG
[21:53:20][C][logger:359]:   Log Baud Rate: 115200
[21:53:20][C][logger:361]:   Hardware UART: UART0
[21:53:20][C][fastled:021]: FastLED light:
[21:53:20][C][fastled:022]:   Num LEDs: 2
[21:53:20][C][fastled:023]:   Max refresh rate: 400
[21:53:20][C][light:103]: Light 'StarsternLED'
[21:53:20][C][light:105]:   Default Transition Length: 1.0s
[21:53:20][C][light:106]:   Gamma Correct: 2.80
[21:53:20][C][captive_portal:088]: Captive Portal:
[21:53:20][C][mdns:115]: mDNS:
[21:53:20][C][mdns:116]:   Hostname: Starstern
[21:53:20][C][api:138]: API Server:
[21:53:20][C][api:139]:   Address: Starstern.local:6053
[21:53:20][C][api:143]:   Using noise encryption: NO
[21:53:22][D][api:102]: Accepted 192.168.1.123
[21:53:22][D][api.connection:1031]: Home Assistant 2023.6.3 (192.168.1.123): Connected successfully
[21:53:25][D][light:036]: 'StarsternLED' Setting:
[21:53:25][D][light:047]:   State: ON
[21:53:25][D][light:055]:   Color brightness: 100%
[21:53:25][D][light:059]:   Red: 100%, Green: 75%, Blue: 55%
[21:53:25][D][light:085]:   Transition length: 1.0s
[21:53:27][D][light:036]: 'StarsternLED' Setting:
[21:53:27][D][light:055]:   Color brightness: 100%
[21:53:27][D][light:059]:   Red: 100%, Green: 89%, Blue: 80%
[21:53:27][D][light:085]:   Transition length: 1.0s
[21:53:29][D][light:036]: 'StarsternLED' Setting:
[21:53:29][D][light:055]:   Color brightness: 100%
[21:53:29][D][light:059]:   Red: 100%, Green: 100%, Blue: 98%
[21:53:29][D][light:085]:   Transition length: 1.0s

Ok, solved it: it works when using neopixelbus like so:

light:
  - platform: neopixelbus
    variant: WS2812
    pin: GPIO13
    num_leds: 2
    name: "ledName"

why? i dont know. maybe the fastled_clockless implementation has some flaws?

Cheers and thanks for listening :wink: