ESP32 OTA not Uploading when powered off of Pins

I am trying to update the firmware on my mailbox sensor via OTA. It will not work when powered through the 3.3v pin or VIN pin, but does work when powered via USB power (not attached to a PC).

The error is “ERROR Error receiving acknowledge version: timed out” and is highlighted below along with my code.

I’ve tried the capacitor trick going from the EN pin to GND with all sorts of values and that doesn’t work, so I am at a loss. Any help would be greatly appreciated, thanks.

========================= [SUCCESS] Took 4.00 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.x.xxx
INFO Uploading /data/maibox_sensor/.pioenvs/maibox_sensor/firmware.bin (890992 bytes)
ERROR Error receiving acknowledge version: timed out
esphome:
  name: maibox_sensor
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
  ssid: !secret ssid
  password: !secret wifi_password
  fast_connect: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Maibox Sensor Fallback Hotspot"
    password: !secret mailbox_ap_password

# Optional manual IP
  manual_ip:
    static_ip: 192.168.x.xxx
    gateway: 192.168.x.x
    subnet: 255.255.255.x
    dns1: 192.168.x.x

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret ota_password

ota:
  password: !secret ota_password
  
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO32
      mode: INPUT_PULLDOWN
    name: "Mailbox Open"
    device_class: opening
    
sensor:
  - platform: adc
    pin: GPIO35
    attenuation: 11db
    filters:
       - offset: -0.19
    name: "Mailbox Battery Level"
    update_interval: 5s

You you connect to the ESP for logs? (esphome *.yaml logs)

Yes, the module works I wasn’t able to get it to update over the air.

What I have found today is it started working up to 52% upload and the errored out. After a little research I tweaked my router to run the 2.4ghz channel on a specified channel instead of auto. I went with channel 11 as it doesn’t overlap any other channels and now it updates perfectly.