D1 mini 8266 boot problem

I am trying to use a wiring diagram I found online to control a motor to open and close my window. Unfortunately, the person that wrote this it was five years ago and they have not replied to of my messages. So I’m guessing what to do with this problem.

The D1 mini does a good job controlling the motor turning it one way or the other. That’s not a problem. The problem comes in with a reed switch that goes to ground when the window is closed and then shuts off the motor. The wiring diagram has it on GPIO2 - D4. From reading everything I can find it says that if this pin is grounded, it won’t boot. Which is exactly the case. I also found an article that said put a 330 K ohm resistor from 3V3 to D4 but that doesn’t help.

I have guessed and now tried to reconfigure the YAML to use D7 or D6 (GPIO12 or 13). That kind of works. If I bring it high (rather than to ground) by applying 3V the pin will toggle on and off in Home assistant, but when I turn it off it flashes like anywhere between 3 to 6 times off on off on off on. So I’m guessing it doesn’t really want to do that.

So what do you do with a D1 mini? Am I using the wrong device for these days? Should I use a different device? I don’t understand how the person that wrote this originally had it working great for them but for me, it doesn’t work. Other than five years have gone by and devices change I assume.

So what is the end result? Should this work? Do I have a bad board or something? Should I try a different board? If so, which one?

What pins should I be able to use and go to ground to indicate an off on situation like the reed switch?

I can’t read anybodys mind, but I don’t see why GPIO12/13 would not work for your purpose.

I agree with @Karosm, however you might find this useful:

No wiring diagram? WTH?

Without a schematic, we’re only guessing.

We both should have said, and your yaml.

1 Like

And your power supply and your motor specs

You could try using one of ESP32-S2 board, which are designed to serve as a replacement for ESP8266. I’ve been testing Wemos S2 mini for a few weeks and so far I’m quite satisfied with it. Footprint of this board is the same as old Wemos D1 mini board, therefore you can power it from Wemos D1 battery shield.

With Wemos S2 mini , you can use 2x more pins. Therefore it’s fairly easy to pick those, which aren’t causing issues with boot.

It’s also good idea to read all messages during compilation and also log messages during boot of esphome flashed device, since there may be warning messages notifying you, that you’ve used bootstrap pin in your YAML file.

I agree for superiority of esp32, but as far as I understood pin rarity is not an issue in this case

Maybe he forgot to add debounce filter?

Hell knows, we don’t know Anything about the setup… Except D1 mini… :sweat_smile:

Are you sure? While the S2 and the D1 Mini are the same size, that’s where the similarity ends. The pinouts are different and the D1 battery shield can’t be just plugged into a row of headers on an S2.

I could be wrong because my workshop still has a bunch of Wemos D1s, but I havent begun to experiment with the ESP32s.

I would like to see an ESP32 plug-in replacement for the Wemos D1 mini so that I wouldn’t have to redesign my PCBs to upgrade the processor.

There has been an ESP32 mini pinout that has existed for almost as long as the ESP32 that most “mini” ESP32 boards follow. This has a lot more i/o than the ESP8266. So it does not match the D1 and I doubt that one will be created that does as this would either waste a lot of i/o or be incompatible with an existing “standard” (I use that term very loosely).

If you look at Wemos battery shield schematic, you’ll see, that only connected header pins are GND, +5V and optionaly VBat to A0. On S2 mini, GND and VBUS are in the same place, Vbat gets routed to GPIO3. Therefore, you can safely plug S2 mini into D1 batttery shield. Keep USB connectors on top of each other, otherwise you’d send 5V between GPIO3 and ENable pin, which could result in magic smoke release.

Numbering of the rest of the pins is different between D1 mini and S2 mini, but that can be corrected fixed in yaml/sketch.

1 Like