ESP8266 Wemos D1 Mini fails to connect

I am having an issue with my Wemos D1 mini’s failing to connect on reboot.

I have removed everything bar the 5V and G, incase it didn’t like the PIN I was using, however the issue still continues.

The only way I can get it to connect is by pushing the RST button.

Any ideas on this one?
Thanks

The error output is

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/playbulb-candle-1.yaml...
INFO Starting log output from 192.168.1.100 using esphome API
WARNING Can't connect to ESPHome API for playbulb-candle-1 @ 192.168.1.100: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.1.100', port=6053))]: [Errno 113] Connect call failed ('192.168.1.100', 6053) (SocketAPIError)
INFO Trying to connect to playbulb-candle-1 @ 192.168.1.100 in the background

Full YAML

esphome:
  name: playbulb-candle-1
  friendly_name: playbulb-candle-1
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  password: ""

wifi:
  networks:
  - ssid: !secret wifi_ssid
    password: !secret wifi_password
    bssid:
  fast_connect: true

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.100
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Playbulb-Candle-1"
    password: ""

captive_portal:
    
globals:
  - id: actual_effect
    type: int
    restore_value: yes
    initial_value: '0'

light:
  - platform: neopixelbus
    id: light_1
    type: GRB
    variant: WS2811
    pin: GPIO0
    num_leds: 60
    name: "Entity Status Indicator"
    effects:
      # Use default parameters:
      - random:
      # Customize parameters
      - random:
          name: "My Slow Random Effect"
          transition_length: 30s
          update_interval: 30s
      - random:
          name: "My Fast Random Effect"
          transition_length: 4s
          update_interval: 5s
      - random:
          name: Random Effect With Custom Values
          transition_length: 5s
          update_interval: 7s         
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
          min_brightness: 0%
          max_brightness: 100%
      - pulse:
          name: "Slow Pulse"
          # transition_length: 1s      # defaults to 1s
          update_interval: 2s
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 1.5%
      - addressable_rainbow:
          name: Rainbow Effect With Custom Values
          speed: 10
          width: 50
      - addressable_color_wipe:
          name: Color Wipe Effect With Custom Values
          colors:
            - red: 100%
              green: 100%
              blue: 100%
              num_leds: 1
            - red: 0%
              green: 0%
              blue: 0%
              num_leds: 1
          add_led_interval: 100ms
          reverse: false
      - addressable_scan:
          name: Scan Effect With Custom Values
          move_interval: 100ms
          scan_width: 1
      - addressable_twinkle:
          name: Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 4ms

      - addressable_random_twinkle:
          name: Random Twinkle Effect With Custom Values
          twinkle_probability: 5%
          progress_interval: 32ms
      - addressable_fireworks:
          name: Fireworks Effect With Custom Values
          update_interval: 32ms
          spark_probability: 10%
          use_random_color: false
          fade_out_rate: 120

      - addressable_lambda:
          name: "Wipe In"
          update_interval: 50ms
          lambda: |-
            static int x = 40;
            static int y = 0;
            if (initial_run) {
              x = 40;
              y = 0;
              it.all() = ESPColor::BLACK;
            }
            if (x < it.size(), (y < it.size())) {
              it[x, y] = current_color;
              y += 1;
              x += 1;
            }

      - addressable_lambda:
          name: "Expo Light"
          update_interval: 16ms
          lambda: |-
            static int x = -400;
            float y = 0.35+0.65*exp(-pow(x, 2)/49000);
            int8_t r = ceil(current_color.r * y);
            int8_t g = ceil(current_color.g * y);
            int8_t b = ceil(current_color.b * y);
            it.all() = ESPColor(r,g,b);
            x += 1;
            if (x == 400)
              x = -400;

      - addressable_lambda:
          name: "Wipe Out"
          update_interval: 12ms
          lambda: |-
            static int x = 0;
            if (initial_run) {
              x = it.size();
            }
            if (x > 0) {
              x -= 1; 
              it[x] = ESPColor::BLACK;
            }

Can you ping it?

No I cant,

I connected USB and pulled logs via USB, it is simply failing to boot 5 out of 6 times.
Boot on completes if I push the RST button.

Sometimes, like I say 1 out of the 6 times, it will boot on its own.

You have placed this without MAC code needed to identify it, but have also included ssid. What about just deleting bssid.

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  manual_ip:
    static_ip: 192.168.1.100
    gateway: 192.168.1.1
    subnet: 255.255.255.0

Try the above. As not other networks included no need to use network.

[19:20:53][C][wifi:580]: WiFi:
[19:20:53][C][wifi:408]:   Local MAC: 0C:B3:14:C3:80:80
[19:20:53][C][wifi:413]:   SSID: [redacted]
[19:20:53][C][wifi:416]:   IP Address: 192.168.2.58
[19:20:53][C][wifi:420]:   BSSID: [redacted]
[19:20:53][C][wifi:421]:   Hostname: 'backroom'
[19:20:53][C][wifi:423]:   Signal strength: -37 dB ▂▄▆█
[19:20:53][C][wifi:427]:   Channel: 11
[19:20:53][C][wifi:428]:   Subnet: 255.255.255.0
[19:20:53][C][wifi:429]:   Gateway: 192.168.2.1
[19:20:53][C][wifi:430]:   DNS1: 192.168.2.1
[19:20:53][C][wifi:431]:   DNS2: 8.8.8.8
[19:20:53][C][logger:166]: Logger:
[19:20:53][C][logger:167]:   Level: DEBUG

If that didn’t work you can narrow it down by looking at log and see if you get a signal strength or if it’s just not connecting to api. Don’t forget to turn logger on to debug.

Thank, but I redacted the BSSID,

The BSSID is required when using fast_connect to connect to a specific AP.

Thanks

I’ve had the same problem with one esphome device that once connected worked fine but if restarted could take up to an hour to reconnect if left alone . Logging in with serial gave the same WARNING Can’t connect to ESPHome API and network scan showed it hadn’t connected to router. I did a clean build and uploaded it by serial and so far seems to connect if restarted. Time will tell.

Thanks, was this a 8266?

I’ve actually just migrated over to an ESP32 for all 3 of these projects which is unfortunately a complete overkill,

But, they work flawlessly.

No it was a esp32. Haven’t had the problem with any of the 8266s which use deep sleep.

Hmm yea, that’s weird as I have a esp8266 deep sleeping too and when it wakes, no issues at all connecting.