D1 mini WS2812 not working on gpio13

Hello,

I know that I should have tested with esphome before but here I am.

I made a board with some sensors, temp, humidity and a PIR. I also have a RGB WS2812 led.

Here is my config:

esphome:
  name: espresencev2-sala

substitutions:
  device_name: espresencev2-sala

esp8266:
  #framework:
  #  version: 2.7.4
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: !secret encryption_key

ota:
  password: !secret ota

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "espresencev2-sala"
    password: !secret wifi_captive

captive_portal:

# Enable Web server (optional).
web_server:
  port: 80

light:
  - platform: neopixelbus
    variant: WS2812
    pin: 13
    num_leds: 1
    type: GRB
    name: "Status LED"
    icon: "mdi:led-outline"
    method:
      type: bit_bang

i2c:
  sda: 5
  scl: 4
  scan: true
  id: bus_a

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: ${device_name} ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: ${device_name} IP
    ssid:
      name: ${device_name} SSID
    bssid:
      name: ${device_name} BSSID
    
sensor:
  - platform: wifi_signal
    name: ${device_name} Wifi Signal Strength
    update_interval: 60s
  - platform: uptime
    name: ${device_name} Uptime
  - platform: htu21d
    temperature:
      name: "Temperatura"
    humidity:
      name: "Umidità"
    update_interval: 30s
  - platform: bh1750
    name: "Lux"
    update_interval: 30s

#light:
#  - platform: fastled_clockless
#    chipset: WS2812
#    pin: 13
#    num_leds: 1
#    rgb_order: BRG
#    name: "Status LED"
#    icon: "mdi:led-outline"

binary_sensor:
  - platform: gpio
    pin: 2
    name: "PIR"
    device_class: motion

status_led:
  pin:
    number: 2
    inverted: true

As you can see i have the RGB led on pin 13 (D7). The board is one of the many clones of the wemos d1 mini.

Before ordering the pcb i tested the connections on a breadboard with tasmota and everything worked but i later switched to esphome and there is no way to make to work this led on pin 13.

I tried 3 d1 mini that i own, 2 are a clone of the version 1 and 1 is a clone of the version 3.
If i prop up a different pin it works and it also work with tasmota on pin 13.

What I am doing wrong? did i miss something in the yaml?

Also, as you can see in the config i tried the fastled method but without success

Where are your logs?

Oh right, sorry. Here:

[I][logger:243]: Log initialized
[C][status_led:014]: Setting up Status LED...
[C][ota:465]: There have been 2 suspected unsuccessful boot attempts.
[I][app:029]: Running through setup()...
[I][i2c.arduino:161]: Performing I2C bus recovery
[D][binary_sensor:034]: 'PIR': Sending initial state ON
[C][light:036]: Setting up light 'Status LED'...
[D][light:035]: 'Status LED' Setting:
[D][light:040]:   Color mode: RGB
[D][light:050]:   Brightness: 100%
[D][light:054]:   Color brightness: 100%
[D][light:057]:   Red: 100%, Green: 100%, Blue: 100%
[D][text_sensor:067]: 'espresencev2-sala ESPHome Version': Sending state '2022.10.2 Nov  5 2022, 11:41:16'
[C][htu21d:017]: Setting up HTU21D...
[C][bh1750.sensor:041]: Setting up BH1750 'Lux'...
[C][wifi:037]: Setting up WiFi...
[D][wifi:384]: Starting scan...
[D][sensor:126]: 'espresencev2-sala Uptime': Sending state 0.24700 s with 0 decimals of accuracy
[D][htu21d:065]: Got Temperature=23.4°C Humidity=41.9%
[D][sensor:126]: 'Temperatura': Sending state 23.36722 °C with 1 decimals of accuracy
[D][sensor:126]: 'Umidità': Sending state 41.87445 % with 1 decimals of accuracy
[D][bh1750.sensor:159]: 'Lux': Got illuminance=1.7lx
[D][sensor:126]: 'Lux': Sending state 1.69783 lx with 1 decimals of accuracy
[D][wifi:399]: Found networks:
[I][wifi:442]: - 'Exico-Ret-Domo' (8A:2A:A8:57:DD:4E) [redacted]▂▄▆█
[D][wifi:444]:     Channel: 5
[D][wifi:445]:     RSSI: -34 dB
[D][wifi:447]: - 'DIRECT-hOCRAWLING-CHAOSmsHS'[redacted] (AE:12:03:A0:2D:AA) [redacted]▂▄▆█
[D][wifi:447]: - 'Exico-Ret'[redacted] (80:2A:A8:57:DD:4E) [redacted]▂▄▆█
[D][wifi:447]: - 'Exico-Ret-Ospiti'[redacted] (86:2A:A8:57:DD:4E) [redacted]▂▄▆█
[D][wifi:447]: - ''[redacted] (8E:2A:A8:57:DD:4E) [redacted]▂▄▆█
[D][wifi:447]: - 'DIRECT-F2-HP OfficeJet 4650'[redacted] (18:60:24:D2:F0:F3) [redacted]▂▄▆█
[I][wifi:255]: WiFi Connecting to 'Exico-Ret-Domo'...
[I][wifi:516]: WiFi Connected!
[C][wifi:360]:   Local MAC: 30:83:98:B5:E9:84
[C][wifi:361]:   SSID: 'Exico-Ret-Domo'[redacted]
[C][wifi:362]:   IP Address: 192.168.20.118
[C][wifi:363]:   BSSID: 8A:2A:A8:57:DD:4E[redacted]
[C][wifi:365]:   Hostname: 'espresencev2-sala'
[C][wifi:367]:   Signal strength: -35 dB ▂▄▆█
[C][wifi:371]:   Channel: 5
[C][wifi:372]:   Subnet: 255.255.255.0
[C][wifi:373]:   Gateway: 192.168.20.1
[C][wifi:374]:   DNS1: 192.168.20.1
[C][wifi:375]:   DNS2: 0.0.0.0
[D][wifi:525]: Disabling AP...
[C][web_server:092]: Setting up web server...
[C][ota:089]: Over-The-Air Updates:
[C][ota:090]:   Address: espresencev2-sala.local:8266
[C][ota:093]:   Using Password.
[W][ota:098]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[C][api:025]: Setting up Home Assistant API server...
[I][app:062]: setup() finished successfully!
[D][sensor:126]: 'espresencev2-sala Wifi Signal Strength': Sending state -36.00000 dBm with 0 decimals of accuracy
[D][text_sensor:067]: 'espresencev2-sala BSSID': Sending state '8A:2A:A8:57:DD:4E'
[D][text_sensor:067]: 'espresencev2-sala IP': Sending state '192.168.20.118'
[D][text_sensor:067]: 'espresencev2-sala SSID': Sending state 'Exico-Ret-Domo'
[I][app:102]: ESPHome version 2022.10.2 compiled on Nov  5 2022, 11:41:16
[C][status_led:019]: Status LED:
[C][status_led:020]:   Pin: GPIO2
[C][wifi:502]: WiFi:
[C][wifi:360]:   Local MAC: 30:83:98:B5:E9:84
[C][wifi:361]:   SSID: 'Exico-Ret-Domo'[redacted]
[C][wifi:362]:   IP Address: 192.168.20.118
[C][wifi:363]:   BSSID: 8A:2A:A8:57:DD:4E[redacted]
[C][wifi:365]:   Hostname: 'espresencev2-sala'
[C][wifi:367]:   Signal strength: -36 dB ▂▄▆█
[C][wifi:371]:   Channel: 5
[C][wifi:372]:   Subnet: 255.255.255.0
[C][wifi:373]:   Gateway: 192.168.20.1
[C][wifi:374]:   DNS1: 192.168.20.1
[C][wifi:375]:   DNS2: 0.0.0.0
[C][logger:275]: Logger:
[C][logger:276]:   Level: DEBUG
[C][logger:277]:   Log Baud Rate: 115200
[C][logger:278]:   Hardware UART: UART0
[C][i2c.arduino:038]: I2C Bus:
[C][i2c.arduino:039]:   SDA Pin: GPIO5
[C][i2c.arduino:040]:   SCL Pin: GPIO4
[C][i2c.arduino:041]:   Frequency: 50000 Hz
[C][i2c.arduino:044]:   Recovery: bus successfully recovered
[I][i2c.arduino:054]: Results from i2c bus scan:
[I][i2c.arduino:060]: Found i2c device at address 0x23
[I][i2c.arduino:060]: Found i2c device at address 0x40
[C][uptime.sensor:031]: Uptime Sensor 'espresencev2-sala Uptime'
[C][uptime.sensor:031]:   State Class: 'total_increasing'
[C][uptime.sensor:031]:   Unit of Measurement: 's'
[C][uptime.sensor:031]:   Accuracy Decimals: 0
[C][uptime.sensor:031]:   Icon: 'mdi:timer-outline'
[C][gpio.binary_sensor:015]: GPIO Binary Sensor 'PIR'
[C][gpio.binary_sensor:015]:   Device Class: 'motion'
[C][gpio.binary_sensor:016]:   Pin: GPIO2
[C][light:104]: Light 'Status LED'
[C][light:106]:   Default Transition Length: 1.0s
[C][light:107]:   Gamma Correct: 2.80
[C][version.text_sensor:021]: Version Text Sensor 'espresencev2-sala ESPHome Version'
[C][version.text_sensor:021]:   Icon: 'mdi:new-box'
[C][htu21d:028]: HTU21D:
[C][htu21d:029]:   Address: 0x40
[C][htu21d:033]:   Update Interval: 30.0s
[C][htu21d:034]:   Temperature 'Temperatura'
[C][htu21d:034]:     Device Class: 'temperature'
[C][htu21d:034]:     State Class: 'measurement'
[C][htu21d:034]:     Unit of Measurement: '°C'
[C][htu21d:034]:     Accuracy Decimals: 1
[C][htu21d:035]:   Humidity 'Umidità'
[C][htu21d:035]:     Device Class: 'humidity'
[C][htu21d:035]:     State Class: 'measurement'
[C][htu21d:035]:     Unit of Measurement: '%'
[C][htu21d:035]:     Accuracy Decimals: 1
[C][bh1750.sensor:118]: BH1750 'Lux'
[C][bh1750.sensor:118]:   Device Class: 'illuminance'
[C][bh1750.sensor:118]:   State Class: 'measurement'
[C][bh1750.sensor:118]:   Unit of Measurement: 'lx'
[C][bh1750.sensor:118]:   Accuracy Decimals: 1
[C][bh1750.sensor:119]:   Address: 0x23
[C][bh1750.sensor:124]:   Update Interval: 30.0s
[C][captive_portal:088]: Captive Portal:
[C][web_server:125]: Web Server:
[C][web_server:126]:   Address: espresencev2-sala.local:80
[C][mdns:100]: mDNS:
[C][mdns:101]:   Hostname: espresencev2-sala
[C][ota:089]: Over-The-Air Updates:
[C][ota:090]:   Address: espresencev2-sala.local:8266
[C][ota:093]:   Using Password.
[W][ota:098]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[C][api:138]: API Server:
[C][api:139]:   Address: espresencev2-sala.local:6053
[C][api:141]:   Using noise encryption: YES
[C][wifi_info:009]: WifiInfo IPAddress 'espresencev2-sala IP'
[C][wifi_info:011]: WifiInfo SSID 'espresencev2-sala SSID'
[C][wifi_info:012]: WifiInfo BSSID 'espresencev2-sala BSSID'
[C][wifi_signal.sensor:009]: WiFi Signal 'espresencev2-sala Wifi Signal Strength'
[C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[C][wifi_signal.sensor:009]:   State Class: 'measurement'
[C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[D][api:102]: Accepted 192.168.20.116
[D][api.connection:917]: Home Assistant 2022.11.1 (192.168.20.116): Connected successfully
[D][htu21d:065]: Got Temperature=23.5°C Humidity=41.6%
[D][sensor:126]: 'Temperatura': Sending state 23.46375 °C with 1 decimals of accuracy
[D][sensor:126]: 'Umidità': Sending state 41.55402 % with 1 decimals of accuracy
[D][bh1750.sensor:159]: 'Lux': Got illuminance=1.6lx
[D][sensor:126]: 'Lux': Sending state 1.58465 lx with 1 decimals of accuracy
[D][sensor:126]: 'espresencev2-sala Wifi Signal Strength': Sending state -37.00000 dBm with 0 decimals of accuracy
[D][sensor:126]: 'espresencev2-sala Uptime': Sending state 43.85200 s with 0 decimals of accuracy
[D][htu21d:065]: Got Temperature=23.6°C Humidity=41.3%
[D][sensor:126]: 'Temperatura': Sending state 23.58172 °C with 1 decimals of accuracy
[D][sensor:126]: 'Umidità': Sending state 41.25647 % with 1 decimals of accuracy
[D][bh1750.sensor:159]: 'Lux': Got illuminance=1.6lx
[D][sensor:126]: 'Lux': Sending state 1.58465 lx with 1 decimals of accuracy
[D][light:035]: 'Status LED' Setting:
[D][light:046]:   State: ON
[D][light:084]:   Transition length: 1.0s
[D][light:035]: 'Status LED' Setting:
[D][light:046]:   State: OFF
[D][light:084]:   Transition length: 1.0s

I tried to switch the led as you can see on the last lines

Well, I found the problem. The led was dead. I dont know what killed it but as soon as i de-soldered and soldered in a new one it worked.

1 Like