ESP8266 drops wifi connection when Display HD44780 is connected

Wow, thanks a lot for the great feedback.

Right after posting here, I tried to run in from the power of the second d1 mini (connected ground + 5V and connected this one to the usb port). the nodemcu connected to the i2c bus powered from the socket with separate power supply. I get wifi signal like this - however, the display only shows all pixels filled in the upper row and all are empty in the lower row. No matter which one I connect/boot first. But the code is simple enough and should not have issues, or am I wrong?

For the 5V pin I read the opposite somehwere, where someone stated it doesnt work, to power the d1 mini through this pin.

After first suspecting power issues, I also measured the output voltage of the 5V pin with a simple multimeter, which showed 4.7V, no idea if this is to be expected…
I also tried it without the backlight before, in order to cosume less power. However, this did not change anything (execpt for the display which was hardly readable).

It’s not so simple to understand wiring descriptions like that. You had common GND between all the devices?

It definitely does. Be aware that there are hundreds of clones around, there’s not only one circuit. To be safe, don’t power from two sources simultaneously.

Yes, expected.

4.7V is normal, since as we figured it out, there’s a diode between 5V from usb and 5V esp pin. And here might be your contrast problem.
Try to power lcd from 5V stabilized power, not via esp pin. Like i said: these lcd’s are very sensitive to voltage fluctuations, and they show that in messed up contrast. They definitely require constant 5V. When i worked with these displays i sometimes even used precise 5V regulator for better stability. Again, depends on lcd type - cheaper ones tend to be more problematic.

Sorry, my post was a bit confusing, I’ll try again:

  • To make the distinction a little easier I used a nodemcu and a d1 mini.
  • I used the nodemcu and connected it to the supposedly better power supply. and connected SDA/SDL for communication (both to display and nodemcu).
  • I used the d1 mini connected to a phone charger to power it and connected the 5 V pin to the display.
  • Then I connected GND to the GND of nodemcu, d1 mini and display.

The display showed the desired output, but the nodemcu was not reached via ping (tried with backlight switched on and switched off). However, as soon as I detached d1 mini from power, the display turned off and then the nodemcu came up on the network within seconds. Can it still be a power issue?

I also tried every possible combination exchanging power supplies and nodemcu vs d1 mini.

Thanks also for the feedback of the voltage. I expected this and yes it’s probably the cheapest offer I bought and thought it would be sufficient…

@Karosm: The 4A2D is the 3.3V volage regulator.

Sure, But is it Torex XC6204 or something else?

Unfortunately I don’t know, there seem to be a whole series of similar ICs with this label.

Yep, with different characteristics.
Torex is rated for 150mA. That could be problem with Esp.
Original Wemos LDO is not marked 4A2D, it’s ME6211 which is rated for higher output.
Other chinese 4A2D are badly documented, maybe not even worth to read.

This is mainly for my curiosity and education.
OP’s problem with display doesn’t likely depend on the specific LDO used on his board

From your pasted YAML code starting from captive_portal - all text is green. I think that’s weird and suggest that it’s not the entire code or not what’s compiled into the ESP8266.

Have you looked at any logging from your device?

Does the ESP8266 create a fall back network after it looses connection to your network?

According to the data sheet it should be possible to run the display at 3.3 V. Have you tried that?

Thanks for the feedback.

I lately put captive_portal at the end and also removed it completely.

Yes, but only from HA. Here I couldn’t find anything unusual, but this connection obviously drops and I haven’t tried to implement some logging directly on the device.

Yes, it does.

I have tried it, but without changing anything on the code or the display. Out of the box it doesn’t work. It looks like this is not sufficient power. However, I believe I haven’t tried without display illumination.

Currently I’m not able to connect to the boards via wifi (it was hot last couple of days). Flashing it from usb I repeatedly get the same error as the devices are trying to connect to the network.

[21:46:35][I][wifi:313]: WiFi Connecting to 'Box 2000'...
[21:46:38][W][wifi_esp8266:513]: Event: Disconnected ssid='Box 2000' bssid=B0:A8:08:C7:E3:C3 reason='Auth Expired'
[21:46:38][W][wifi:653]: Error while connecting to network.
[21:46:38][D][wifi:697]: Retrying with hidden networks...
[21:46:38][I][wifi:313]: WiFi Connecting to 'Box 2000'...
[21:46:40][W][wifi_esp8266:513]: Event: Disconnected ssid='Box 2000' bssid=B0:A8:08:C7:E3:C3 reason='Auth Expired'
[21:46:40][W][wifi:653]: Error while connecting to network.
[21:46:40][D][wifi:697]: Retrying with hidden networks...

Guess, I will need to fix this first somehow…

Go with 5V, no-one knows what current t your specific board can provide through 3v3 pin.
Did you try with another usb cable?

Rgd. captive_portal:
It doesn’t matter whether it’s at the beginning or at the end.
It’s should be colored blue like the wifi: keyword.
i2c: and display: should be blue as well.

For that reason I don’t think you’ve copied the entire yaml-code correctly into your post.

Rgd. logging
Logging from HA is OK that is where you will see logging.
The snippet you’ve included is that log and what I assume you are seeing when you power up the ESP board (without the display) you will see from the logging that it connects to you network and it will show the assigned IP address etc.
Is that correct? Assuming yes -
What does the log display then when you connect the display?

Rgd. Fallback network
If indeed the ESP creates a fallback network while the display is connected - can you connect to that fallback network with you phone or computer ?
If you can it does suggest that WiFi is working OK even with the display connected and that also makes it unlikely that it’s a power supply issue.
I don’t know which exact LCD module you are using but from a typical HD44780 data sheet current consumption is less than 1 mA and even less at 3.3V. In fact it’s specified down 2.7V

BTW - your log suggested that reason for disconnect was ‘Auth Expried’ so I did a quick search in the forum and found this:
https://community.home-assistant.io/t/esphome-wifi-auth-expired/443790/16
The solution here was a small change in the display section to :

display:
  - platform: lcd_pcf8574
    id: my_display
    dimensions: 20x4
    address: 0x27
    update_interval: 2s

You might want to try that as well (set the update_interval)
Rgd. Not working out of the box at 3.3V
What does that mean? And what code do you think you would need to change ?

Thanks again for the feedback. I tested it and it seems that it was wifi issues.

Even though I was only 2 m away from the access point I often wasnt able to connect. When I came even closer, the errors disappeared and I could reconnect even with the display attached. Therefore I havent tried connecting to the fallback yet.

Does the Wemos D1 Mini have a relatively poor Wi-Fi antenna?

I also introduced the update interval but havent tried running at 3.3V as of now.

Currently it seems to work reproducibly with this code:

esphome:
  name: wemosmini
  friendly_name: wemosmini

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "SA695XLPq3fbAcZxLnSDFGGg2sSLAB2RUA+KZIKk7M="

ota:
  - platform: esphome
    password: "secret"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Zisterne Fallback Hotspot"
    password: "vbceTEDsDzQ4"
i2c:
  sda: GPIO4
  scl: GPIO5

display:
  - platform: lcd_pcf8574
    dimensions: 20x4
    address: 0x27
    update_interval: 2s
    lambda: |-
      it.print("Hello World!");
      it.print(0, 1, "H");
      it.print(2, 1, "O");
      it.print(4, 1, "\xFF");
      it.print(5, 1, "\xFF");
      it.print(10, 1, "!");
      
captive_portal:

At some point I switched to esp01_1m instead of d1_mini, although I’m not sure which one is best here. Any suggestions?

You draw conclusions way too fast ……

Remember - the solution/root cause should be able to explain all the observations that you’ve seen.

I was under the impression that your Wi-Fi connection was OK until you connected the display and only disappeared when the display was connected.
Are you now saying that even without the display you were unable to connect your ESP unless you were less than 2 meters away?
As for ESP’s antenna performance - not sure that I’ve seen data for the modules but less than 2 meter coverage - no way. I would expect that even without an antenna the ESP chip would easily connect to your AP. So highly unlikely that this is the real cause.
Of course there is a theoretical chance that the RF circuit inside your particular ESP device is damaged and therefor has extremely poor coverage.
A couple of things you can do to test this is:

  1. try another ESP (if you have one)
  2. test coverage when your ESP is in fallback mode. If something is broken you would see a similar poor performance

You mention that you included the update interval but you don’t mention whether you did observe any difference with just that change. I read your description as you included it and moved everything closer to the AP.
Debugging these kind of issues you should do only one thing at a time - at least if you want to understand and reach a root cause with reasonable high confidence.
Also - with the update update_interval did the error message in your logs go away?

Thanks for your remarks.

Indeed the wifi was previously working fine and only the display interrupted it.

Then these Auth errors started to appear and I went back to a minimal yaml file and still had issues to reconnect. I thought this originated from misconfiguration but couldnt find the reason as even the minimal yaml wanst working. At the location my laptop shows 75-80% on wifi signal the wemos dropped down to something like -78db. This is when I decided to move very close to the AP (Fritz Repeater 1200 AX connected to LAN).
This decreases the number of auth failures significantly and I adjusted yaml and used the display and now wemos showed up on the wifi even with display, but only after several minutes of operation.
Earlier, at 7m distance to the AP and no display I connected to wifi 5-10s after boot.
I also tried it with another Wemos D1 and nodemcu, but only at the distant position.

I didnt try the connectivity in fallback mode as the wemos was now connecting much faster. I can try this again at the distant postion, yesterday I was too tired after the debugging session.

The update interval did not change much at the distant position, but also did not harm, so I left it.

I dont know about the impact of the board selection esp01_1m vs. d1_mini. Could you comment on this?

Thanks for your help!

Regarding esp01 vs d1_mini - check this link. I would advise you to pick the closest board.
Check this page for what the board selection affects:

As for signal level - I don’t think that -78 dBm should be causing any issue - i.e it should be sufficiently strong.
Since you have at least 2 ESP board - do a comparison between them and also check if the signal level is a function of the display or not.
You could also consider increasing the logger level:

and see if this reveal further details - particular when the display is connected and disconnected.

Forgot to ask you earlier but are your SSID by any chance hidden?
If so - you’ll need to include the fast_connect command.

The documentation does say it’s required for hidden SSID’s but I’m not sure whether that means - doesn’t work at all if configured incorrectly or works unreliable/intermittent.

Thanks for your patience… this is really frustrating as I made several steps back as it seems and can’t figure out why.

Nothing works properly at the moment, so I put the display aside now.

For the platform you suggested a webpage that links to platformio.org, but I’m stuck here. I bought this device: FREI D1 Mini - kompatibles ESP8266 Board, v2.0 | Einplatinen-Mikrocontroller günstig kaufen | reichelt elektronik
Esphome says:

if unsure choose a generic board from Espressif such as esp01_1m.

So I did that and tried a minimal yaml and used esphome from my laptop to flash the device (esphome run minimal.yaml --device /dev/ttyUSB0):

esphome:
  name: wemosmin
  friendly_name: wemosmin

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: DEBUG

api:

ota:
  platform: esphome

wifi:
  ssid: "FRITZ!Box 2000"
  password: "mypassword"
  ap:

captive_portal:

This already doesn’t work properly, flashing seems to work but then no wifi connection:

INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[21:32:41]\xd8g s\x8fo
                      ld\xe0
                            ;\x9c\x9c\xc0\xF1\xc7c\xC2g
                                                       `g`gs\x8fg
                                                                 c\x8c`\x9bn
                                                                            b\xC2`
                                                                                  \x8f\x87\x9c\x87`n\x9c\x8c\xe4g\xe4\x93{\x82g
                                d
                                 \x84
                                     `#\xdfr\x9bd\xe0l\xF1\xdbl\x84x8c
                                                                      [I][logger:034]: Log initialized
[21:32:41][C][safe_mode:079]: There have been 1 suspected unsuccessful boot attempts
[21:32:41][I][app:029]: Running through setup()...
[21:32:41][C][wifi:048]: Setting up WiFi...
[21:32:41][C][wifi:061]: Starting WiFi...
[21:32:41][C][wifi:062]:   Local MAC: FC:F5:C2:A2:FA:A9
[21:32:42][D][wifi:482]: Starting scan...
[21:32:42][W][component:167]: Component wifi set Warning flag: scanning for networks
[21:32:AA][D][wifi:497]: Found networks:
[21:32:AA][I][wifi:540]: - 'FRITZ!Box 2000' (B0:F2:3C:C7:F1:AC) ▂▄▆█
[21:32:AA][D][wifi:542]:     Channel: 11
[21:32:AA][D][wifi:543]:     RSSI: -69 dB
[21:32:AA][I][wifi:540]: - 'FRITZ!Box 2000' (50:E6:36:F2:B8:E7) ▂▄▆█
[21:32:AA][D][wifi:542]:     Channel: 11
[21:32:AA][D][wifi:543]:     RSSI: -85 dB
[21:32:AA][D][wifi:545]: - 'HejaComo' (B2:F2:3C:C7:F1:AC) ▂▄▆█
[21:32:AA][D][wifi:545]: - 'UPC253525F' (AC:22:05:F8:21:77) ▂▄▆█
[21:32:AA][D][wifi:545]: - 'Vodafone-F314' (D4:3F:CB:91:57:BB) ▂▄▆█
[21:32:48][D][wifi:545]: - 'HejaComo' (F2:5D:35:E6:4D:F2) ▂▄▆█
[21:32:48][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:32:50][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:32:50][W][wifi:653]: Error while connecting to network.
[21:32:50][D][wifi:697]: Retrying with hidden networks...
[21:32:50][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:32:52][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:32:52][W][wifi:653]: Error while connecting to network.
[21:32:52][D][wifi:697]: Retrying with hidden networks...
[21:32:57][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:33:05][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:33:05][W][wifi:653]: Error while connecting to network.
[21:33:05][D][wifi:697]: Retrying with hidden networks...
[21:33:05][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:33:07][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:33:07][W][wifi:653]: Error while connecting to network.
[21:33:07][D][wifi:697]: Retrying with hidden networks...
[21:33:12][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:33:20][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:33:20][W][wifi:653]: Error while connecting to network.
[21:33:20][D][wifi:697]: Retrying with hidden networks...
[21:33:20][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...
[21:33:22][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:3C:C7:F1:AC reason='Auth Expired'
[21:33:22][W][wifi:653]: Error while connecting to network.
[21:33:22][D][wifi:697]: Retrying with hidden networks...
[21:33:27][I][wifi:313]: WiFi Connecting to 'FRITZ!Box 2000'...

I really don’t get it. This was definitely working a couple of days ago when I was trying to debug the display.

The wifi isn’t hidden and I didn’t change anything here.
I tried all solutions posted in this thread (including fast_connect): ESPHome - Wifi - Auth Expired … negative.

I am using Wifi channel 11 and I read somewhere that this might be problematic. However, since I’m running Zigbee on channel 11 this was a conscious decision given the surrounding networks I have and cannot influence. Furthermore WiFi 6 with 2,4 and 5 GHz, but would like to stick with these settings as downgrading seems to be a bad option. (and 1m distance to the AP to get connected is also not ideal)

I can reconfirm the same behaviour for another wemos d1 mini. (Almost feels like the displays destroyed the wemos, although this is probably very unlikely)

Really not sure, where to go from here, so I’m happy about your suggestions.

Edit: Tried nodemcu with slight adjustment of the yaml: same result.

So now you are not able to connect even with a generic YAML file that doesn’t do much.
In this version you’ve typed in the password rather than using secrets. Have you double checked that this is the correct password?

Another thing you can do is to increase the logging level and see if this highlights additional information. VERBOSE and VERY_VERBOSE are options.

Finally - some user have reported that decreasing the TX Power have helped them. Try that as well and see what result that brings. Many recommend setting it to 8.5 dBm

Thanks again for your answer.

I’m using the esphome from command line on a laptop. I wasn’t sure if I could just use a secrets.yaml in this setup and therefore put the password directly in the yaml file that I changed locally and flashed to the wemos using this command:
esphome run minimal_mod.yaml --device /dev/ttyUSB0

I’m sure, that the password is correct, I copied it directly and if I move very close to the AP it often connects to wifi.

I tried decreasing the power, as suggested in the linked thread above, in combination with other settings. (fast_connect …)
I tried it separately now, only introducing this specific change for both output_power: 8.5dB and output_power: 8.5. No change for my setup.

Below you can find the VERY_VERBOSE output. Can you identify other problems?

I’m using the Fritzbox Mesh as you probably saw from the same SSID but different MAC-addresses. Wemos should be smart enough to choose the strongest signal here if I do not use the fast_connect option. Is this true?

I updated the esphome installation (currently 2025.6.3), tried another cable to connect to the laptop and tried different devices… pretty clueless :confused:

INFO Successfully compiled program.
esptool.py v4.8.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: fc:f5:c4:*shortend*
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00000000 to 0x0006afff...
Flash params set to 0x0340
Compressed 436592 bytes to 304327...
Wrote 436592 bytes (304327 compressed) at 0x00000000 in 7.0 seconds (effective 502.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[21:08:56]@T\xe90;37m[V][wifi_esp8266:062]: Enabling STA.
[21:08:56]mode : sta(fc:f5:c4:*shortend*)
[21:08:56]add if0
[21:08:56][V][wifi_esp8266:565]: Event: Changed Mode old=OFF new=STA
[21:08:56]wifi evt: 8
[21:08:56]nul mode, fpm auto sleep set:enalbe
[21:08:56]sleep disable
[21:08:56][D][wifi:495]: Starting scan
[21:08:56][W][component:188]: Component wifi set Warning flag: scanning for networks
[21:09:02]scandone
[21:09:02][D][wifi:510]: Found networks:
[21:09:02][I][wifi:553]: - 'FRITZ!Box 2000' (B0:F2:08:*shortend*) ▂▄▆█
[21:09:02][D][wifi:555]:     Channel: 11
[21:09:02][D][wifi:556]:     RSSI: -63 dB
[21:09:02][I][wifi:553]: - 'FRITZ!Box 2000' (50:E6:36:*shortend*) ▂▄▆█
[21:09:02][D][wifi:555]:     Channel: 11
[21:09:02][D][wifi:556]:     RSSI: -88 dB
[21:09:02][D][wifi:558]: - 'Heja*shortend*' (B2:F2:08:*shortend*) ▂▄▆█
[21:09:02][D][wifi:558]: - 'UPC*shortend*' (AC:22:05:*shortend*) ▂▄▆█
[21:09:02][D][wifi:558]: - 'Vodafone-*shortend*' (D4:3F:CB:*shortend*) ▂▄▆█
[21:09:02][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:02][V][wifi:321]: Connection Params:
[21:09:02][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:02][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:09:02][V][wifi:355]:   Password: '*shortend*'
[21:09:02][V][wifi:360]:   Channel: 11
[21:09:02][V][wifi:369]:   Using DHCP IP
[21:09:02][V][wifi:371]:   Hidden: NO
[21:09:02][V][wifi_esp8266:523]: Event: Changed AuthMode old=OPEN new=WPA2 PSK
[21:09:02]wifi evt: 2
[21:09:03]scandone
[21:09:04]state: 0 -> 2 (b0)
[21:09:05]state: 2 -> 0 (2)
[21:09:05][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:05]wifi evt: 1
[21:09:05]STA disconnect: 2
[21:09:05][W][wifi:666]: Error while connecting to network.
[21:09:05][D][wifi:710]: Retrying with hidden networks
[21:09:05][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:05][V][wifi:321]: Connection Params:
[21:09:05][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:05][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:09:05][V][wifi:355]:   Password: '*shortend*'
[21:09:05][V][wifi:360]:   Channel: 11
[21:09:05][V][wifi:369]:   Using DHCP IP
[21:09:05][V][wifi:371]:   Hidden: NO
[21:09:05]scandone
[21:09:06]state: 0 -> 2 (b0)
[21:09:07]state: 2 -> 0 (2)
[21:09:07][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:07]wifi evt: 1
[21:09:07]STA disconnect: 2
[21:09:07][W][wifi:666]: Error while connecting to network.
[21:09:07][D][wifi:710]: Retrying with hidden networks
[21:09:12][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:12][V][wifi:321]: Connection Params:
[21:09:12][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:12][V][wifi:327]:   BSSID: Not Set
[21:09:12][V][wifi:355]:   Password: '*shortend*'
[21:09:12][V][wifi:362]:   Channel: Not Set
[21:09:12][V][wifi:369]:   Using DHCP IP
[21:09:12][V][wifi:371]:   Hidden: NO
[21:09:18]scandone
[21:09:19]state: 0 -> 2 (b0)
[21:09:20]state: 2 -> 0 (2)
[21:09:20][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:20]wifi evt: 1
[21:09:20]STA disconnect: 2
[21:09:20][W][wifi:666]: Error while connecting to network.
[21:09:20][D][wifi:710]: Retrying with hidden networks
[21:09:20][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:20][V][wifi:321]: Connection Params:
[21:09:20][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:20][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:09:20][V][wifi:355]:   Password: '*shortend*'
[21:09:20][V][wifi:360]:   Channel: 11
[21:09:20][V][wifi:369]:   Using DHCP IP
[21:09:20][V][wifi:371]:   Hidden: NO
[21:09:20]scandone
[21:09:21]state: 0 -> 2 (b0)
[21:09:22]state: 2 -> 0 (2)
[21:09:22][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:22]wifi evt: 1
[21:09:22]STA disconnect: 2
[21:09:22][W][wifi:666]: Error while connecting to network.
[21:09:22][D][wifi:710]: Retrying with hidden networks
[21:09:27][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:27][V][wifi:321]: Connection Params:
[21:09:27][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:27][V][wifi:327]:   BSSID: Not Set
[21:09:27][V][wifi:355]:   Password: '*shortend*'
[21:09:27][V][wifi:362]:   Channel: Not Set
[21:09:27][V][wifi:369]:   Using DHCP IP
[21:09:27][V][wifi:371]:   Hidden: NO
[21:09:33]scandone
[21:09:34]state: 0 -> 2 (b0)
[21:09:35]state: 2 -> 0 (2)
[21:09:35][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:35]wifi evt: 1
[21:09:35]STA disconnect: 2
[21:09:35][W][wifi:666]: Error while connecting to network.
[21:09:35][D][wifi:710]: Retrying with hidden networks
[21:09:35][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:35][V][wifi:321]: Connection Params:
[21:09:35][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:35][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:09:35][V][wifi:355]:   Password: '*shortend*'
[21:09:35][V][wifi:360]:   Channel: 11
[21:09:35][V][wifi:369]:   Using DHCP IP
[21:09:35][V][wifi:371]:   Hidden: NO
[21:09:35]scandone
[21:09:36]state: 0 -> 2 (b0)
[21:09:37]state: 2 -> 0 (2)
[21:09:37][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:37]wifi evt: 1
[21:09:37]STA disconnect: 2
[21:09:37][W][wifi:666]: Error while connecting to network.
[21:09:37][D][wifi:710]: Retrying with hidden networks
[21:09:42][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:42][V][wifi:321]: Connection Params:
[21:09:42][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:42][V][wifi:327]:   BSSID: Not Set
[21:09:42][V][wifi:355]:   Password: '*shortend*'
[21:09:42][V][wifi:362]:   Channel: Not Set
[21:09:42][V][wifi:369]:   Using DHCP IP
[21:09:42][V][wifi:371]:   Hidden: NO
[21:09:48]scandone
[21:09:49]state: 0 -> 2 (b0)
[21:09:50]state: 2 -> 0 (2)
[21:09:50][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:50]wifi evt: 1
[21:09:50]STA disconnect: 2
[21:09:50][W][wifi:666]: Error while connecting to network.
[21:09:50][W][wifi:703]: Restarting WiFi adapter
[21:09:50][V][wifi_esp8266:064]: Disabling STA.
[21:09:50]del if0
[21:09:50]usl
[21:09:50]mode : null
[21:09:50]force sl[V][wifi_esp8266:565]: Event: Changed Mode old=STA new=OFF
[21:09:50]wifi evt: 8
[21:09:50]p enable,type: 2
[21:09:50][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:50][V][wifi:321]: Connection Params:
[21:09:50][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:50][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:09:50][V][wifi:355]:   Password: '*shortend*'
[21:09:50][V][wifi:360]:   Channel: 11
[21:09:50][V][wifi:369]:   Using DHCP IP
[21:09:50][V][wifi:371]:   Hidden: NO
[21:09:50][V][wifi_esp8266:062]: Enabling STA.
[21:09:50]mode : sta(fc:f5:c4:*shortend*)
[21:09:50]add if0
[21:09:50][V][wifi_esp8266:565]: Event: Changed Mode old=OFF new=STA
[21:09:50]wifi evt: 8
[21:09:51]scandone
[21:09:52]state: 0 -> 2 (b0)
[21:09:53]state: 2 -> 0 (2)
[21:09:53][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:09:53]wifi evt: 1
[21:09:53]STA disconnect: 2
[21:09:53][W][wifi:666]: Error while connecting to network.
[21:09:53][D][wifi:710]: Retrying with hidden networks
[21:09:56][I][wifi:184]: Starting fallback AP!
[21:09:56][V][wifi_esp8266:070]: Enabling AP.
[21:09:56]mode : sta(fc:f5:c4:*shortend*) + softAP(fe:f5:c4:*shortend*)
[21:09:56]add if1
[21:09:56]dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
[21:09:56]bcn 100
[21:09:56][C][wifi:265]: Setting up AP
[21:09:56][C][wifi:267]:   AP SSID: 'wemosmin'
[21:09:56][C][wifi:267]:   AP Password: ''
[21:09:56]wifi evt: 8
[21:09:56]bcn 0
[21:09:56]del if1
[21:09:56]add if1
[21:09:56]dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
[21:09:56]bcn 100
[21:09:56][V][wifi_esp8266:746]: DHCP server IP lease start: 192.168.4.100
[21:09:56][V][wifi_esp8266:749]: DHCP server IP lease end: 192.168.4.110
[21:09:56][C][wifi:281]:   IP Address: 192.168.4.1
[21:09:56][C][api:034]: Running setup
[21:09:56][I][app:085]: setup() finished successfully!
[21:09:56][I][safe_mode:042]: Boot seems successful; resetting boot loop counter
[21:09:56][W][component:188]: Component api set Warning flag: unspecified
[21:09:56][I][app:137]: ESPHome version 2025.6.3 compiled on Jul  9 2025, 21:08:32
[21:09:56][C][wifi:613]: WiFi:
[21:09:56][C][wifi:434]:   Local MAC: FC:F5:C4:*shortend*
[21:09:56][C][wifi:439]:   SSID: 'FRITZ!Box 2000'
[21:09:56][C][wifi:442]:   IP Address: 192.168.4.1
[21:09:56][C][wifi:446]:   BSSID: B0:F2:08:*shortend*
[21:09:56][C][wifi:446]:   Hostname: 'wemosmin'
[21:09:56][C][wifi:446]:   Signal strength: 31 dB ▂▄▆█
[21:09:56][V][wifi:453]:   Priority: -8.0
[21:09:56][C][wifi:455]:   Channel: 1
[21:09:56][C][wifi:455]:   Subnet: 0.0.0.0
[21:09:56][C][wifi:455]:   Gateway: 0.0.0.0
[21:09:56][C][wifi:455]:   DNS1: 0.0.0.0
[21:09:56][C][wifi:455]:   DNS2: 0.0.0.0
[21:09:56][C][logger:211]: Logger:
[21:09:56][C][logger:211]:   Max Level: VERY_VERBOSE
[21:09:56][C][logger:211]:   Initial Level: VERY_VERBOSE
[21:09:56][C][logger:217]:   Log Baud Rate: 115200
[21:09:56][C][logger:217]:   Hardware UART: UART0
[21:09:56][C][captive_portal:089]: Captive Portal:
[21:09:56][C][esphome.ota:073]: Over-The-Air updates:
[21:09:56][C][esphome.ota:073]:   Address: wemosmin.local:8266
[21:09:56][C][esphome.ota:073]:   Version: 2
[21:09:56][C][safe_mode:018]: Safe Mode:
[21:09:56][C][safe_mode:019]:   Boot considered successful after 60 seconds
[21:09:56][C][safe_mode:019]:   Invoke after 10 boot attempts
[21:09:56][C][safe_mode:019]:   Remain for 300 seconds
[21:09:56][C][api:182]: API Server:
[21:09:56][C][api:182]:   Address: wemosmin.local:6053
[21:09:56][C][api:192]:   Using noise encryption: NO
[21:09:56][C][mdns:122]: mDNS:
[21:09:56][C][mdns:122]:   Hostname: wemosmin
[21:09:56][V][mdns:126]:   Services:
[21:09:57][V][mdns:128]:   - _esphomelib, _tcp, 6053
[21:09:57][V][mdns:131]:     TXT: friendly_name = wemosmin
[21:09:57][V][mdns:131]:     TXT: version = 2025.6.3
[21:09:57][V][mdns:131]:     TXT: mac = fcf5c4*shortend*
[21:09:57][V][mdns:131]:     TXT: platform = ESP8266
[21:09:57][V][mdns:131]:     TXT: board = esp01_1m
[21:09:57][V][mdns:131]:     TXT: network = wifi
[21:09:58][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:09:58][V][wifi:321]: Connection Params:
[21:09:58][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:09:58][V][wifi:327]:   BSSID: Not Set
[21:09:58][V][wifi:355]:   Password: '*shortend*'
[21:09:58][V][wifi:362]:   Channel: Not Set
[21:09:58][V][wifi:369]:   Using DHCP IP
[21:09:58][V][wifi:371]:   Hidden: NO
[21:10:04]scandone
[21:10:04]state: 0 -> 2 (b0)
[21:10:05]state: 2 -> 0 (2)
[21:10:06][W][wifi_esp8266:513]: Event: Disconnected ssid='FRITZ!Box 2000' bssid=B0:F2:08:*shortend* reason='Auth Expired'
[21:10:06]wifi evt: 1
[21:10:06]STA disconnect: 2
[21:10:06][W][wifi:666]: Error while connecting to network.
[21:10:06][I][wifi:319]: Connecting to 'FRITZ!Box 2000'
[21:10:06][V][wifi:321]: Connection Params:
[21:10:06][V][wifi:322]:   SSID: 'FRITZ!Box 2000'
[21:10:06][V][wifi:325]:   BSSID: B0:F2:08:*shortend*
[21:10:06][V][wifi:355]:   Password: '*shortend*'
[21:10:06][V][wifi:360]:   Channel: 11
[21:10:06][V][wifi:369]:   Using DHCP IP
[21:10:06][V][wifi:371]:   Hidden: NO
[21:10:06]scandone

Only briefly followed this thread & your logs. It’s not connecting to WiFi at all - it’s giving up & using the fallback AP on 192.168.4.1.

Also, based on the logs above, the dhcp range on your router seems painfully small:

[21:09:56][V][wifi_esp8266:746]: DHCP server IP lease start: 192.168.4.100
[21:09:56][V][wifi_esp8266:749]: DHCP server IP lease end: 192.168.4.110

That gives you only 11 DHCP addresses across all your network. If you have more than 11 wifi devices in your house, then you’ve reached the limit and will run into issues.

Hopefully the above will solve your problem or at least guide someone else down the right path