Can't connect/install a Wemos D1 mini. (PC crashes)


Here my first post on the forum.

I was forced to abandon Domoticz and switched to HA, i must say i’m very happy with HA.
(now using Zwave, RFX-Com, MQTT and ESP32)

My problem : cannot add a Wemos-D1 mini anymore to my system.

Short description :
I had 3 ESP’s connected to my HA. (1 for mini display on my desk, 1 for relay control in the garden, 1 x RFID-reader)
Then i got an ESPHome update notitfication and i tried to also update my ESP nodes. (first only 1)

After the update (notification “successful”) it showed as offline.
I took it back to my computer and connected it via USB. All other wires disconnected, no sensors eg.
USB went crazy, computer even crashed.

Then i started up Arduino IDE, and re-flashed the ESP node with the BLINK program.
This was a bit tricky because the node keeps on resetting. Eventually IDE connected to it and started uploading.
After that, BLINK program running fine !

Reconnected it to my PC, all was quit now and was detected by the system again.

With ESPHome i tried installing the initial config again to connect it to HA again.
Again, install process completed and then again PC goes crazy on USB connected, not connected, connected… resulting in a crash again…

I even tried using a spare ESP32, but no success.
This problem occurs on every attempt…

Now i’m scared to update any node.

Has anyone an idea what is going on ?

Example of a working node :

  name: "badkamer"
  friendly_name: Badkamer

  name: ${name}
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
    name: esphome.web
    version: '1.0'

  board: esp01_1m

# Enable logging

# Enable Home Assistant API

# Allow Over-The-Air updates

# Allow provisioning Wi-Fi via serial

  # Set up a wifi access point
  ap: {}

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.

  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial

  - platform: binary
    name: "Lamp_Badkamer_humidity"
    output: light_output1

  - id: light_output1
    platform: gpio
    pin: 2
    inverted: true
    # Connected to D2, internal LED

  - platform: dht
    pin: 16
    # Connected to D0
      name: "Badkamer Temperatuur"
      name: "Badkamer Humidity"
    update_interval: 30s
    # DHT22


This needs to be populated

Plug it into the computer running HA

Try disabling this ^^^

Please note that enabling this component will take up a lot of memory and may decrease stability, especially on ESP8266.

Well, the current active node can be reached via “badkamer.local” or similar

I can’t enter the WiFi credentials after the initial setup was uploaded, as from that moment the ESP start rebooting all the time, resulting in crashing my PC.

This has also no effect…

PS : Home Assistant runs on a Linux server, my daily computer is a Windows one.

PS2 : until a few weeks ago it worked as it should, also adding new devices, erasing, connecting again, firmware update. No problems for months, until now… :cry:

How are you uploading the yaml to your esp? You need to modify the yaml with wifi stuff then upload / compile it.

HA → ESPHome → new device → “open ESPHome WEB”

Connect → select device → “Prepare for first use”

After this, (the process was completed), i cannot add the WiFi information because the ESP32 starts rebooting all the time…

Add the WiFi information in the .yaml , before compile.

What is in your secrets.yaml, there is a link to this in the top right corner of esphome page. This is where the wifi details should be stored. then add this to your yaml before compiling.

secrets should be this or similar.

# Your Wi-Fi SSID and password
wifi_ssid: "your ssid"
wifi_password: "your password"

And the wifi section of your yaml should be.

  ssid: !secret wifi_ssid
  password: !secret wifi_password

Or as suggested edit the yaml as per the page I linked above. Then compile.

This is odd. Sounds like it might be something to do with your environment / set-up.

You could try updating both HA and ESPHome to latest stable release (if not already)?

These WiFi data were installed with the older ESPHome versions.
The new one doesn’t show these lines anymore.
(HA and ESPHome are both up to date)

But wait…
I grabbed my last (new) ESP8266-12F.
Used the same install procedure as mentioned above.

Guess what : no problems at all. Works perfectly.
To double check this i even used a donor ESP-ROVER board. Also here no problems at all.

Could it be that ESPHome has problems with my Wemos D1 Mini V3 boards ?

FAIL : Wemos D1 Mini V3 (all boards)
SUCCES : ESP8266-12F

My confusion is complete… :thinking:

Pulling D3 to GND brings the node to rest, and i’m able to program it again with Arduino-IDE. (Blink.ino)

Now i can remove this GND connection and node is perfectly programmable within the Arduino app.

But still, after trying to get it programmed with ESPHome results in rebooting this node and crashing my PC.

Fact that it crashes PC is weird. I’d look at software on the PC rather than firmware on the wemos. What serial chips do the various boards have? Could it be the wemos boards have a different one, with buggy serial drivers? I’d try reinstalling the latest version of those.

The PC crashes because it cannot handle that fast USB connect/disconnect events that occur after ESPHome tried to install the node for first use.

After the Arduino_IDE trick, all is quiet again…

The Wemos has that famous CH340 chip on it.

Another quick guess: I looked up the wemos docs, and it says D0 is the only pin that does not support interrupt, PWM, I2C and one wire protocol. If you configure a different pin for dht or leave it out, what happens?

I’d start with a clean basic firmware and add libraries one by one until it fails.

once the firmware had installed disconnect it from your PC. It doesn’t need the usb after take.

Or, as I previously said, install from the computer running esphome.

The problem still is that the “install for first use” action in ESPHome doesn’t produce a functional ESP32 node.
I’ve tried the normal “first use” option, but also to upload a “default” config as a *.bin file to it.
After reaching the 100% and responding as FINISHED, the rebooting starts immediately.

(at this point the only thing to to is : reflash it with the Arduino-IDE, as described before…)

Try using this instead of ESPHome to upload your first default file.
It was the only thing that worked for me on the ESP32 version of the D1 mini. Anything else caused issues with the board being kicked out of flashing mode.

Also, are you sure about this?

  board: esp01_1m

Shouldn’t that be:

  board: d1_mini