Esp32 not waking from deep sleep

I am having trouble debugging a really weird issue with an esp32 based board. The device enters deep sleep and logs the correct sleep time, but it never wakes up as far as I can tell from the logs. Here is the minimal config I am using for testing, and I am still having this issue:

esphome:
  name: weatherstation-garden

esp32:
  board: esp32dev
  framework:
    type: arduino

substitutions:
  loc: "Garden"
  name: "Garden Weather Station"

wifi:
  ssid: "xxx"
  password: !secret wifi_pw
  fast_connect: false
  manual_ip:
    static_ip: xxx.xxx.xxx.xxx
    gateway: xxx.xxx.xxx.xxx
    subnet: xxx.xxx.xxx.xxx
  ap:
    ssid: ${name} Fallback
    password: !secret fallback_pw

captive_portal:

logger:
  level: DEBUG

api:
  encryption:
    key: "xxxx"

ota:
  password: !secret ota_pw
  
deep_sleep:
  sleep_duration: 60s
  run_duration: 45s
  id: deep_sleep_1
  

The device logs the following before going to sleep:

[15:45:39][I][app:100]: ESPHome version 2024.5.0 compiled on May 17 2024, 15:36:34
[15:45:39][C][wifi:580]: WiFi:
[15:45:39][C][wifi:408]:   Local MAC: xxxx
[15:45:39][C][wifi:413]:   SSID: [redacted]
[15:45:39][C][wifi:416]:   IP Address: 192.168.7.87
[15:45:39][C][wifi:420]:   BSSID: [redacted]
[15:45:39][C][wifi:421]:   Hostname: 'weatherstation-garden'
[15:45:39][C][wifi:423]:   Signal strength: -62 dB ▂▄▆█
[15:45:39][C][wifi:427]:   Channel: 11
[15:45:39][C][wifi:428]:   Subnet: xxxx
[15:45:39][C][wifi:429]:   Gateway: xxxx
[15:45:39][C][wifi:430]:   DNS1: 0.0.0.0
[15:45:39][C][wifi:431]:   DNS2: 0.0.0.0
[15:45:39][C][logger:185]: Logger:
[15:45:39][C][logger:186]:   Level: DEBUG
[15:45:39][C][logger:188]:   Log Baud Rate: 115200
[15:45:39][C][logger:189]:   Hardware UART: UART0
[15:45:39][C][captive_portal:088]: Captive Portal:
[15:45:39][C][mdns:115]: mDNS:
[15:45:39][C][mdns:116]:   Hostname: weatherstation-garden
[15:45:39][C][ota:096]: Over-The-Air Updates:
[15:45:39][C][ota:097]:   Address: xxxx
[15:45:39][C][ota:100]:   Using Password.
[15:45:39][C][ota:103]:   OTA version: 2.
[15:45:39][C][api:139]: API Server:
[15:45:39][C][api:140]:   Address: xxxx
[15:45:39][C][api:142]:   Using noise encryption: YES
[15:45:39][C][deep_sleep:049]: Setting up Deep Sleep...
[15:45:39][C][deep_sleep:052]:   Sleep Duration: 60000 ms
[15:45:39][C][deep_sleep:055]:   Run Duration: 45000 ms
[15:46:23][I][deep_sleep:117]: Beginning Deep Sleep
[15:46:23][I][deep_sleep:119]: Sleeping for 60000000us
[15:46:23][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:46:23][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
INFO Processing expected disconnect from ESPHome API for weatherstation-garden @ 192.168.7.87
WARNING Disconnected from API

I’ve stripped down the code as much as possible to just test the functionality of the deep sleep component, and it’s still not waking up. I only recently started using the block

esp32:
  board: esp32dev
  framework:
    type: arduino

as I previously had the board configured under esphome: but that never seemed to be an issue before and it did not fix the sleep problem.

Start with making this true. Perhaps the device is having a problem connecting to wifi.

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 50s

Add a wifi signal strengh sensor

Did deep sleep function ok previously but is now having an issue?

If it’s been outside perhaps the issue could relate to weather exposure (just guessing).

You could try another (good quality) power supply as a simple check of a power issue.

Does the esp32 have any onboard led that is on when awake by chance?

I always set a DNS in my wifi. I’ve never had any problems with deep sleep and am fascinated when it doesn’t work for others. If you connected up UART then you could see if anything happening as OTA logs only show once wifi connects. Worth mentioning exactly what esp32 you are using.

It was working on my old board last I knew before that one died from exposure after two-ish years. The new board I’m testing has not been exposed to any weather.

I have tried a couple different power supplies connected directly to the board via USB.

There is an led but it is always on.

@Spiro I don’t have DNS set but that could be worth a try. Fast connect didn’t change the behavior. I connected directly to my PC to check the logs and unfortunately it’s exactly the same - it goes to sleep and then nothing.

The boards I’ve bought are from here, listed as esp32 30 pin. I don’t have the board in front of me, but I believe the markings are just “esp-wroom-32” on the chip.

What about trying to power the board by applying 3.3V to the 3.3V pin and not using the usb port.

Yeah, you just can’t keep the weather out forever.

I am actually powering the board via 3.3 volts in my circuit, I did test with the USB plug though as well.

This project is supposed to be the v2 of my design, I’m enclosing the main board in a weatherproof PVC box for this very reason.