Can't get D1 Mini to connect to Wifi

I have D1 Mini ver 3.0.0
Hassio 0.118.3
ESPhome 1.15.3

This is my simple code:

esphome:
  name: kitchenleds
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "JAB-CAN"
  password: "xxxxxxxxx"

# Enable logging
logger:
  level: DEBUG

I was using ESPHome-Flasher-1.2.0
upgraded to version 1.3.0 (same problem)

After flashing this is the log I get:

Using 'COM4' as serial port.
Connecting....
Detecting chip type... ESP8266
Connecting....

Chip Info:
- Chip Family: ESP8266
- Chip Model: ESP. (92 %)Writing at 0x00034000... (100 %)Wrote 309824 bytes (223297 compressed) at 0x00000000 in 5.1 seconds (effective 486.8 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Done! Flashing is complete!

Showing logs:
[16:18:18][I][logger:166]: Log initialized
[16:18:18][I][app:029]: Running through setup()...
[16:18:18][C][wifi:033]: Setting up WiFi...
[16:18:18][D][wifi:324]: Starting scan...
[16:18:24][D][wifi:339]: Found networks:
[16:18:24][I][wifi:385]: - 'JAB-CAN' (86:83:C2:97:xx:xx) ▂▄▆█
[16:18:24][D][wifi:386]:     Channel: 6
[16:18:24][D][wifi:387]:     RSSI: -55 dB
[16:18:24][I][wifi:194]: WiFi Connecting to 'JAB-CAN'...
[16:18:31][W][wifi_esp8266:395]: Event: Disconnected ssid='JAB-CAN' bssid=86:83:C2:97:xx:xx reason='Auth Expired'
[16:18:31][W][wifi:485]: Error while connecting to network.
[16:18:31][W][wifi:522]: Restarting WiFi adapter...
[16:18:31][W][wifi_esp8266:395]: Event: Disconnected ssid='JAB-CAN' bssid=86:83:C2:97:xx:xx reason='Authentication Failed'
[16:18:31][I][wifi:194]: WiFi Connecting to 'JAB-CAN'...
[16:18:31][W][wifi_esp8266:191]: wifi_apply_hostname_(kitchenleds): lwIP error -16 on interface st (index 0)
[16:18:37][W][wifi_esp8266:395]: Event: Disconnected ssid='JAB-CAN' bssid=86:83:C2:97:xx:xx reason='Auth Expired'
[16:18:37][W][wifi:485]: Error while connecting to network.
[16:18:37][W][wifi:522]: Restarting WiFi adapter...

I am obviously sure of my ssid password, also tried a different ssid/password.
I tried another D1 Mini and getting same issue.

Anything else I can try?

1 Like

Have you rebooted the esp?

Are there any special chars in your password?

I have rebooted the esp multiple times. I reduced my password to contain only numbers.
I’ve been going at this for a few hours now. I’ve also tried from https://github.com/espressif/esptool to run esptool.py erase_flash and then flashed the bin file again.
I had a bigger .bin file but it is now down to the minimal as shown in my first post.

Have you tried moving the device closer to your AP?

Google throws up a number of issue threads on esphome.

Distance to the AP is about 10 feet. D1 Mini never connected. It detects all of my neighbours APs (removed from my initial post) it looks like as soon as it tries to connect, the Wifi part restarts.

I am starting to pull hair out…

After further extensive evaluation my D1 Mini modules are defective. All 5 of them, that was a roll of dice purchasing on Aliexpress.

1 Like

Bummer. Very boring to buy stuff and get duds.

Had the same problem. Only thing that helped was to disable 5ghz wifi on my ubiquiti.

I got the same problem, could fix it by define all my BSSID for my wifi like this, and double checked my password :smiley:

You should find the BSSID by searching for the wifi,or in the wificonfigs of the Accesspoint.

 esphome:
   name: oelsensor_test
   platform: ESP8266
   board: d1_mini
 
 wifi:
   networks:
    - ssid: Meinwifiname
      bssid: A3:02:14:CF:7F:40
      password: MeinWifiPasswort
    - ssid: Meinwifiname
      bssid: 25:E8:BE:C0:1B:f2
      password: MeinWifiPasswort
    - ssid: Meinwifiname
      bssid: F0:D2:84:6E:7E:53
      password: MeinWifiPasswort
    - ssid: Meinwifiname
      bssid: 4C:84:0D:52:63:A0
      password: MeinWifiPasswort
 captive_portal:
 
 # Enable logging
 logger:
 
 # Enable Home Assistant API
 api:
  password: "THmmD3"
 
 ota:
   password: "THmmD3"
 
 sensor:
   - platform: ultrasonic
     trigger_pin: D1
     echo_pin: D2
     name: "Füllstand-Oberer-Tank"
4 Likes

I have purchased 15-20 Wemos d1 minis, NodeMCU’s, and esp8266-01’s from Ali Express. Not a dud in the lot.

I’m having a similar issue. Also the fallback captive_portal is not working. It says it’s starting, but my I cannot see it. I have tested with another D1 mini and it worked. I assume there is some issue with wifi antenna…

1 Like

Very nice… nothing seems to have changed.
Also I have two D1 Mini V3 through Aliexpress. The bitchy already when describing, then they cannot be found via WLAN.
I’ll try the tip with the BSSID before they end up in the trash. :-))

What on earth does that mean?

Flag on the field.

You changed your WiFi password on the router?

I have same issue. Everything is correct. Wifi ssid name, password just letters and numbers.
When powered off and later on powered on its connect sometimes.

Current version: 2022.11.2 Addon in HA

Moved some ESP modules from ESPeasy to ESPhome. On ESPeasy everything worked without any issue… on ESPhome always the connection problems:

[I][wifi:257]: WiFi Connecting to 'Oudenes.Photography'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(meek-livingroom): lwIP error -16 on interface st (index 0)
[W][wifi_esp8266:482]: Event: Disconnected ssid='Oudenes.Photography' bssid=[redacted] reason='Association Leave'
[W][wifi:549]: Error while connecting to network.
[W][wifi:585]: Restarting WiFi adapter...
[I][wifi:257]: WiFi Connecting to 'Oudenes.Photography'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(meek-livingroom): lwIP error -16 on interface st (index 0)
[W][wifi_esp8266:482]: Event: Disconnected ssid='Oudenes.Photography' bssid=[redacted] reason='Auth Expired'
[W][wifi:549]: Error while connecting to network.
[W][wifi:585]: Restarting WiFi adapter...
[W][wifi_esp8266:482]: Event: Disconnected ssid='Oudenes.Photography' bssid=[redacted] reason='Authentication Failed'
[I][wifi:257]: WiFi Connecting to 'Oudenes.Photography'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(meek-livingroom): lwIP error -16 on interface st (index 0)

config:

esphome:
  name: meek-livingroom

esp8266:
  board: nodemcuv2

logger:

api:
  encryption:
    key: "HIDDEN"

ota:
  password: "HIDDEN"

wifi:
  ssid: Oudenes.Photography
  password: HIDDEN
  power_save_mode: none
  reboot_timeout: 30min
  fast_connect: true

mqtt:
  broker: 192.168.100.24
  username: HIDDEN
  password: HIDDEN
  client_id: esphome-livingroom
  topic_prefix: esphome/livingroom
  discovery: true

light:
  - platform: neopixelbus
    default_transition_length: 0s
    type: GRB
    variant: 800KBPS
    pin: D4
    num_leds: 2
    name: "ESPHome livingroom - Neopixel1"
    id: neopixel
  
  - platform: partition
    name: "ESPHome Partition - neopixel1"
    default_transition_length: 1s
    id: neopixel1
    segments:
      - id: neopixel
        from: 0
        to: 0
  
  - platform: partition
    name: "ESPHome Partition - neopixel2"
    default_transition_length: 1s
    id: neopixel2
    segments:
      - id: neopixel
        from: 1
        to: 1

switch:
  - platform: gpio
    pin: D1
    name: "ESPHome livingroom - Switch 1"
    id: switch1

  - platform: gpio
    pin: D1
    name: "ESPHome livingroom - Switch 2"
    id: switch2

binary_sensor:
  - platform: gpio
    pin: D5
    name: "ESPHome livingroom - Touch 1"
    on_press:
      - switch.toggle: switch1
      - if:
          condition:
            switch.is_on: switch1
          then:
            - light.turn_on: 
                id: neopixel1
                brightness: 100%
                red: 0%
                green: 100%
                blue: 0%
      - if:
          condition:
            switch.is_off: switch1
          then:
            - if:
                condition:
                  lambda: |-
                    return id(goodnight).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 10%
                      green: 0%
                      blue: 10%
            - if:
                condition:
                  lambda: |-
                    return id(kodi).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 93%
                      green: 0%
                      blue: 93%
            - if:
                condition:
                  lambda: |-
                    return id(daytime).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 100%
                      green: 0%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(evening).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 100%
                      green: 0%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(appletv).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 55%
                      green: 55%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(tv).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 0%
                      green: 25%
                      blue: 53%
            - if:
                condition:
                  lambda: |-
                    return id(nintendo).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 36%
                      green: 28%
                      blue: 55%

  - platform: gpio
    pin: D7
    name: "ESPHome livingroom - Touch 2"
    on_press:
      - switch.toggle: switch2
      - if:
          condition:
            switch.is_on: switch2
          then:
            - light.turn_on: 
                id: neopixel2
                brightness: 100%
                red: 0%
                green: 100%
                blue: 0%
      - if:
          condition:
            switch.is_off: switch2
          then:
            - if:
                condition:
                  lambda: |-
                    return id(goodnight).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 10%
                      green: 0%
                      blue: 10%
            - if:
                condition:
                  lambda: |-
                    return id(kodi).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 93%
                      green: 0%
                      blue: 93%
            - if:
                condition:
                  lambda: |-
                    return id(daytime).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 100%
                      green: 0%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(evening).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 100%
                      green: 0%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(appletv).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 55%
                      green: 55%
                      blue: 0%
            - if:
                condition:
                  lambda: |-
                    return id(tv).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 0%
                      green: 25%
                      blue: 53%
            - if:
                condition:
                  lambda: |-
                    return id(nintendo).state > 0;
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 36%
                      green: 28%
                      blue: 55%

sensor:
  # SCENES
  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Daytime"
    id: daytime
    accuracy_decimals: 0
    topic: homeassistant/scenes/daytime
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 100%
                green: 0%
                blue: 0%

  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Evening"
    id: evening
    accuracy_decimals: 0
    topic: homeassistant/scenes/evening
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 100%
                green: 0%
                blue: 0%

  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Goodnight"
    id: goodnight
    accuracy_decimals: 0
    topic: homeassistant/scenes/goodnight
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 20%
                green: 31%
                blue: 9%

  - platform: mqtt_subscribe
    name: "ESPHome livingroom - AppleTV"
    topic: homeassistant/scenes/appletv
    id: appletv
    accuracy_decimals: 0
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 55%
                green: 55%
                blue: 0%
  
  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Kodi"
    id: kodi
    accuracy_decimals: 0
    topic: homeassistant/scenes/kodi
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 93%
                green: 0%
                blue: 93%

  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Nintendo"
    id: nintendo
    accuracy_decimals: 0
    topic: homeassistant/scenes/nintendo
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 36%
                green: 28%
                blue: 55%

  - platform: mqtt_subscribe
    name: "ESPHome livingroom - TV"
    id: tv
    accuracy_decimals: 0
    topic: homeassistant/scenes/tv
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 0%
                green: 25%
                blue: 53%

  # MOTION
  - platform: mqtt_subscribe
    name: "ESPHome livingroom - Motion"
    id: motion
    accuracy_decimals: 0
    topic: homeassistant/motion/livingroom
    on_value:
      then:
        if:
          condition:
            lambda: 'return x > 0;'
          then: 
            - light.turn_on: 
                id: neopixel
                brightness: 100%
                red: 0%
                green: 0%
                blue: 100%
          else:
            - if:
                condition:
                  switch.is_on: switch1
                then:
                  - light.turn_on: 
                      id: neopixel1
                      brightness: 100%
                      red: 0%
                      green: 100%
                      blue: 0%
                else:
                  - if:
                      condition:
                        lambda: |-
                          return id(daytime).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 100%
                            green: 0%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(goodnight).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 10%
                            green: 0%
                            blue: 10%
                  - if:
                      condition:
                        lambda: |-
                          return id(evening).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 100%
                            green: 0%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(kodi).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 93%
                            green: 0%
                            blue: 93%
                  - if:
                      condition:
                        lambda: |-
                          return id(appletv).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 55%
                            green: 55%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(tv).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 0%
                            green: 25%
                            blue: 53%
                  - if:
                      condition:
                        lambda: |-
                          return id(nintendo).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel1
                            brightness: 100%
                            red: 36%
                            green: 28%
                            blue: 55%

            - if:
                condition:
                  switch.is_on: switch2
                then:
                  - light.turn_on: 
                      id: neopixel2
                      brightness: 100%
                      red: 0%
                      green: 100%
                      blue: 0%
                else:
                  - if:
                      condition:
                        lambda: |-
                          return id(daytime).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 100%
                            green: 0%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(goodnight).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 10%
                            green: 0%
                            blue: 10%
                  - if:
                      condition:
                        lambda: |-
                          return id(evening).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 100%
                            green: 0%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(kodi).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 93%
                            green: 0%
                            blue: 93%
                  - if:
                      condition:
                        lambda: |-
                          return id(appletv).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 55%
                            green: 55%
                            blue: 0%
                  - if:
                      condition:
                        lambda: |-
                          return id(tv).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 0%
                            green: 25%
                            blue: 53%
                  - if:
                      condition:
                        lambda: |-
                          return id(nintendo).state > 0;
                      then:
                        - light.turn_on: 
                            id: neopixel2
                            brightness: 100%
                            red: 36%
                            green: 28%
                            blue: 55%

Is 5ghz enabled on your ap? Turn it off to see if it connects.