Having problems with ESP32

I see that they are running the flasher from a laptop but I wasn’t clear that esphome was actually on a different machine.

And if it was maybe asking the questions in that way might have possibly sparked an “aha…” moment in the OP to realize that you can’t flash a device from a computer that doesn’t at least have the bin file available on it.

1 Like

@nickrout Thank you for the link to the FAQ i had gone thorough them (though i did forget to mention that i’d been there already sorry).

@finity let me run through everything a bit better please…

i have several nodeMCU ESP8266 devices up and running in ESPhome all with no problem this is my first NodeMCU ESP-32s that I am trying to configure and running into problems.

I am using a tried and tested USB cable that I know has no faults and can transmit data both ways.

my ESPhome is running on my Pi 3b+ which is running Hass.io .

ESPhome-Flasher is running on my Laptop where i have installed all the drivers for the ESP8266 and the drivers from the FAQ

the Binary file that I am trying to put onto the ESP-32s is currently located in my laptop where I have ESPhome_Flasher installed also.

The Binary file was compiled in the ESP component in HA and saved to the laptop.

when i connect the board to the laptop via the USB cable, the laptop makes a noise to indicate that the board has been found and if i look into the Device manager then Comm 5 suddenly appears as active.

but still I get the error when I try to flash it.

if I connect directly to the PI then i get nothing just the option for OTA transfer

2 Likes

I don’t have any ESP-32s so I’m not sure if the issue could be that you chose the incorrect board type in your ESPHome yaml config?

1 Like

Yep, yaml file :slight_smile:

1 Like

Ahh… i never thought of that. let me check…

this is what I have in the Yaml for that.


esphome:
  name: testing
  platform: ESP32
  board: nodemcu-32s

maybe a play with other options might produce different results

Edit: forgot code formatting

Edit: just tried the following…

esphome:
  name: testing2
  platform: ESP32
  board: esp-wrover-kit

with the same errors

Connecting........Using 'COM5' as serial port.
Unexpected error: could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5)

tried a few others as well and the same result

Is there any way to know what setting to use from the board?

I’m not sure if you’re seeing something different than I am but those two errors aren’t anywhere near being close to “the same”.

1 Like

from the ESPHome docs it looks like your initial code was correct.

Maybe it’s a problem with the board?

Or as @nickrout said, maybe it’s a problem with the cable… just because it worked before doesn’t mean it won’t break at some point.

1 Like

in device manager what is show along side the com5 port description

for mine i have
image

  1. Are you running windows on your laptop?

If so this utility is is handy for notifying you of new com ports without having to drill down into device manager: https://helmpcb.com/software/serial-port-monitor

  1. It can be tricky to get ESP32s into boot mode.
    i) Power on / connect the ESP
    ii) Start the flash tool connecting
    iii) Press and hold both buttons on the ESP board
    iv) Release the EN button while continuing to hold the IO0 button
    v) When the flash tool discovers the device you can release the IO0 button.
18 Likes

ESP32 NodeMCU’s have specific flash mode? I didn’t know that. Regular ESP8266 NodeMCU’s can be flashed without any special procedure as far as I remember. Just plug it in & flash it.

Permission denied - not sure about device permissions in windows. It seems important though.

thank you tom that has done the trick!

@finity i hadn’t noticed the differences in the error logs, a pretty big thing to miss… but thank you for pointing that out to me.

I returned the type to the generic and followed the instructions from @tom_l and everything is flashed ready for me to play with.

thank you to you all :slight_smile:

1 Like

Yep the ESP32 based boards have a different flash mode access method to the ESP8266s. Took me a while to work it out the first time, after only using lots of ESP8266s.

It’s the same procedure for the ESP8285. For example, the Sonoff minis may not go into flash mode if you just power on while holding IO0 low. You have to power on, reset while holding IO0 low then release IO0 once connected.

2 Likes

That might be why the iFan03 I flashed with Tasmota was so finicky trying to get it to flash. I believe it’s running on an ESP8285. That does kind of explain it.

How to you reset while holding down IO0 and having the board plugged in? For the life of me I can’t seem to be able to flash a sonoff 4ch

Never, ever flash a board with it pugged into mains power.

At best you will fry your PC. At worst, yourself.

That did the job! Thanks a lot!
Spend 2 hours trying to flash ESP WROOM 32

Hello there, I’m facing the kinda the same problem, except that I’m using a Esp32-cam
(ESP-32s)

And I’m using a USB ESP-01 module. connecting (as you can see in the next pictures)
U0R -Tx
U0T - Rx
GND -GND
VCC- 3.3V

Trying to imitate an FTDI interface like this:

But I get the same mistake:

Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header

But this module, the ESP-32 cam, just have one button: RST button, it flashes while I press, but I cant upload any code and I always get the same error.

Any ideas?

I figured it out, with ESP-01 USB adapters you need to connect Tx-Tx and Rx-Rx… I’ll explain more here: