Can't install ESPHome on S2 MINI

I referenced this post to write my configuration file:

Following are my steps to install ESPHome:

  1. Create a configuration on the ESPHome Dashboard. My configuration is as follows:
esphome:

  name: esp32-s2-1

  friendly_name: esp32-s2-1

esp32:

  board: lolin_s2_mini

  variant: ESP32S2

  framework:

    type: arduino

    version: 2.0.6

    platform_version: 5.3.0

# Enable logging

logger:

# Enable Home Assistant API

api:

  encryption:

    key: "3pUnOSh+sAzHQFr2wJQYd3yYt320/ePouvd7vw7/9Nc="

ota:

  password: "d88798d59b676ad539c0b34452c870a2"

wifi:

  ssid: !secret wifi_ssid

  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "Esp32-S2-1 Fallback Hotspot"

    password: "xsSYEVH4Vztc"

captive_portal:
  1. Download the firmware generated from the above configuration on ESPHome Dashboard
  2. Flash the firmware onto S2 MINI by utilizing the following commands:
set /p "port=port(COMx): "

esptool --chip esp32s2 --port %port% erase_flash
esptool --chip esp32s2 --port %port% write_flash -z 0x1000 esp32-s2-factory.bin

Everything seems went well. But I can’t see this device in my router’s web UI, nor the device go online in ESPHome Dashboard.

I also referenced this post:
https://www.reddit.com/r/Esphome/comments/11a08za/can_esp32s2_minis_be_used_for_esphome/
And tried the following configuration:

esp32:
  board: lolin_s2_mini
  variant: esp32s2
  framework:
    type: esp-idf

You have to manually reboot that board after flashing.

Hello @UchihaYuki

Did you find a solution ?
I can flash like you using espTool instead of webEsphome, but I can’t get it connected to my network, neither create the access point…

If someone has succeed in making it working…

@FriedCheese, It’s not a reboot problem, you’re right, we must manually restart, but the problem stays !

Thanks !

flash using adafruit method.

I can flash using esptool and get connected (with tasmota and wled, have not tried esphome) but not with the web installer as explained here

and here

tasmota supplies a “factory” bin that takes care of the booting and wled from pio takes care of that too. If esphome does not then then that’s why you can’t “get it on the wifi”. You can’t just upload any compiled boot bin it has to be for S2 and personally I have not seen one out there.

So @grandyoz if esphome doesn’t have a “factory” bin i’d just switch to using tasmota (they support pretty much the same sensors, etc). Otherwise you’ll have to use PIO and compile your own esphome with the caveats mentioned at the wled post.

Hey, I was having trouble with the s2 mini until I put a 1k pulldown resistor on the boot button. Not sure why that was missing from the layout, but it’s a simple fix.

What I did was cut the trace from the 0 button (that goes to the ESP), scrape off the solder mask, then solder the resistor to the via that goes off to the ESP.

It’s small, but if you get a good magnifier and a sharp x-acto, it’s doable.

Ha, I knew it was a board design issue. All other lolin boards get in to programming mode as expected. For me though flashing is mostly a one time deal and I can flash with esptool or pio in the way mentioned so I’ll opt out cutting traces etc. Lolin probably have thousands of the flawed boards so who knows if they will ever make a fix.

I have found that having to manually reboot the board only occurs when trying to flash over USB. After that, I’ve been able to flash over WiFi without any issues.

I found another thing that helps! Add a 1uF capacitor between the RST line and ground of the adjacent capacitor. That should enable software reset.

1 Like

You need to hold both buttons down, and thehtekrese RST first after plugging in USB:

@chillinator could you elaborate on which trace you cut?

Cutting the trace off the D0 button and putting a pull down resistor would effectively make the D0 button useless since the other side is connected to GND. It would make it seem like the D0 button is continuously held down.

I must be misunderstanding which pin you cut. ( I don’t have permissions to upload a photo yet showing which trace I’m taking about. Image available here: Imgur: The magic of the Internet)

Modding PCB

The schematic for the D1 Mini S2 shows that the EN pin has a pull up resistor (R3 10K) and a coupling capacitor to ground (C14 100nf) next to SW1

Looking at the data sheet this design appears correct as D0 should be pulled to ground for at least 50ms before the board is reset.

Software Restart

As far as enabling software restart, it there is a discussion here about it. Some people have tried switching between CDC and DFU mode on boot with limited success.

I’ve personally tried playing with different combinations of CDC/DFU in the Arduino IDE with no luck yet.

Esp Web Tools

There was a regression in version 9.x of the esp web tools that appears to persist in version 10. I’ve downgraded my site to use 8.0.6 and can confirm that I’m able to flash a D1 Mini S2 from Chrome