ESP32 S2 and ESPhome upload

Hi all,

I’ve just gotten some Wemos D1 Mini ESP32-S2 and I’m trying to upload a .bin file via the ESPhome flasher but it is not working.
I’ve downloaded the lasted flasher and tried with nodemcu flasher also. But I get the same error. Any idea’s? I’ve uploaded a sketch via Arduino IDE, so I know it works but when using the flasher, the com port is seen but nothing else works.

Have you been holding the ‘flash’ button whilst booting the ESP? (sometimes called ‘prog’ button)

EDIT: doesn’t look like the Wemos 32’s have that button.

Your board code is wrong. Use the following:

esphome:
  name: bedroom-cupboard
  platform = espressif32
  board = wemos_d1_mini32

and get rid of the lines of code:

esp32:
  blah
  blah

Also, please copy and paste your code rather than screenshotting it. Use the correct code formatting tool also so it looks like my examples above.

Hi. Thanks for the advice, I’ll give that a try. The format was generated by ESPhome. The way you’ve written it, is how my others boards are structured.

I have managed to upload code but through the web browser, which is s new way for me but it wouldn’t connect to WIFI but maybe that’s down to the board type.

The docs still say that the esp-idf framework is preferred for the esp32-s2

There are many more who reported this…

Tried updating the drivers for the usb programmer?

I updated the driver with Zadig to WINusb and was going to see which driver suits. Like a fool, I then updated a driver for ‘bluetooth and LAN devices’ and now Zadig will not see the ESP. Strange. I can still upload code via Arduino but I’m unable to change the driver or update via ESPflasher

EDIT:
I uninstalled the driver and used the one’s from Zadig but none work. Just the errors vary. I appears I can install the code via the browser and ESPhome but it doesn’t connect to the WIFI, so I’ll assume it has not uploaded correctly. Strange. Can’t find a solution online.

Hi all, I’ve tried all the suggested, unless I’m executing it wrong but none seem to work for me.
I’ve rebuilt in ESPhome and redone the code various times but nothing works there. I’ve used Zadig to install drivers and tried to ,manually install the drivers manually from the espressif website (Establish Serial Connection with ESP32-S2 - ESP32-S2 - — ESP-IDF Programming Guide v4.2-beta1 documentation) but whenever I associate that with the device in device manager, Windows tells me it either is not there or Windows has already installed the relevant.
I’m at a huge loss here now. When I google people’s issues, they’re all older posts, nothing recent. Throughout all of this, I can update code via Arduino, which is odd but still yet to get ESPhome to connect.

What about that com6 showing in your device list?
Is that still present when you unplug your D1 Mini ESP32-S2 ?

Just asking, as EspHomeFlasher only uses a serial port :thinking:

It is. Well, after multiple things and reinstalling, it shows as com3 now and farther up the list as esp32.
Arduino IDE fine, esp flasher, it states com is not found.

Try using linux, you can something like ubuntu from a usb pen drive.

I’ve got Ubuntu on a crappy old laptop, I’ll give it a go, thank you, never thought to try

I also learned that you can use ESPHome’s native web client…
https://web.esphome.io/
Never tried it thought :wink:

Also the poster (apparently) hasn’t taken the advice to switch to the esp-idf framework.

Yes, it half worked for me. It loaded the code but it would not connect to the wifi there after, could not figure out why

You’re correct. It is still the only thing I have not tried. I misunderstood at first and used the code which included the github link but didnt realise there was software. Will try at the weekend

Has anyone actually had success with this yet? I’ve tried everything listed above AFAICT and mine is still just a tiny board sitting there doing nothing

I had no success and just got rid of the boards and got some older ESP32 models. Not saying it is not possible but my coding skills are lacking for such a project.

I bought 5 ESP32 S2 Mini’s like these…

…and had the same problem, not able to flash ready-made bin’s using ESPHome Flasher,
nor from the ESPHome Dashboard and not directly from the browser using https://web.esphome.io.

Turned out ESPTool was the savior.

  1. Installed the latest CP210x driver from here: CP210x USB to UART Bridge VCP Drivers - Silicon Labs (silabs.com)
  2. Downloaded ESPTool for Windows from here Releases · espressif/esptool · GitHub. I used v3.3, the newest version p.t. (4.x) probably works just fine too. Needs no installation. Just unzip it to a folder.
  3. Plugged in the ESP32, a new com port popped up in the device manager under Ports.
  4. Pressed and held the “O” button on the ESP32 then pressed and released the Reset button. Finally I released the “O” button again. I noticed the comport number shown in the Device Manager changed and made a note of the final com-port number.
  5. Opened a Windows Command Prompt window, navigated to the folder where I unpacked ESPTool and ran the following command: esptool -p COM<port number> erase_flash, in my case:
    esptool -p COM7 erase_flash
  6. Did not touch or disconnect anything, opened the ESPHome Dashboard in Home Assistant and clicked “New device” button. Gave it a name, clicked install and selected the COM port number from above (in my case, 7). ESPHome now made its magic and started to flash the ESP32. However, after a while I got an error message from ESPHome. I simply tried one more time, selected the same COM port and this time it was a success. This error on first try happened on all 5, btw, and on all 5 the second try went well.
  7. Pressed the RST button on the ESP32 to take it out of Flash mode, and it came alive in the ESPHome Dashboard.

Not sure if this method works for others, but it worked for me, so at least might be worth a try. I hated the thought of maybe having to throw them away, but now my 5 ESP32 Mini S2s can be put to work and, most importantly, I lost no monetas :slight_smile:

A backup solution might be downloading the .bin file from ESPHome Dashboard and use ESPTool to flash it to the ESP32:

  1. Download a boot_loader for ESP32, i.e. this one: https://github.com/Aircoookie/WLED/releases/download/v0.13.3/esp32_bootloader_v4.bin and put it into the same folder as the ESPTool.
  2. Flash it, then your own .bin file into the ESP32:
1. esptool -p COM<PORT> write_flash 0x0 esp32_bootloader_v4.bin
2. esptool -p COM<PORT> write_flash 0x010000 <bin-filename>.bin
1 Like

Hi

I’ve tried your methods, but unfortunately they are not working for me.
I’m trying to upload a succesfully compiled program using esptool/esphome/platformio:

My config :

But during upload i’m getting the following errors :

Something goes wrong with the .bin files, i’ve manually added this “patched_bootloader.bin”, just by copying a normal ESP32 bootloader and renaming it into the specific folder, but without results unfortunately.

What files do I exactly need to upload? Only the factory-firmware.bin? Ive tried your method just by only uploading the firmware.bin file after flashing the bootloader, but without result unfortunately.

Anyone who can help me out in the right direction?

I used the following suggestion from this post and it seems to work fine:

esp32:
  board: lolin_s2_mini
  variant: ESP32S2
  framework:
    type: arduino
    version: 2.0.3
    platform_version: 5.0.0
1 Like