ESP32 freenove Cam Deep Sleep

I have a freenove ESP32 Wrover camera running off a LIPO battery and solar cells. In the config , I have it set to enter deep sleep after sunset until 13:00. I have confirmed that it does enter deep sleep at sunset from monitoring the LOG…

The device never wakes up. It will instantly work on a hard reset, so I know it’s not a voltage issu

I’ve read all the esphome deep sleep info. Am I missing something obvious?

Thanks
Joel

esphome:
  name: bee-hive-monitor-4h

esp32:
  board: esp-wrover-kit
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ota_password

wifi:
  #use_address: 192.168.0.20
  #manual_ip:
    #static_ip: 192.168.0.20
    #gateway: 192.168.0.1
    #subnet: 255.255.255.0
    #dns1: 8.8.8.8
    #dns2: 8.8.4.4
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bee-Hive-Monitor-4H"
    password: !secret ap_password

captive_portal:
# Time source
time:
  - platform: homeassistant
    id: homeassistant_time
  
#Deep Sleep
deep_sleep:
  id: deep_sleep_1
  
# Sun configuration entry
sun:
  latitude: 37.291700°
  longitude: -95.909630
  # Enter Deep Sleep at Sunset
  on_sunset:
    then:
       - deep_sleep.enter:
          id: deep_sleep_1
          until: "13:00:00"
          time_id: homeassistant_time

# Setup Hx711 sensor
sensor:
  - platform: hx711
    name: "BeeHiveWeight"
    dout_pin: GPIO33
    clk_pin: GPIO32
    gain: 128
    update_interval: 120s
    # ... Other HX711 options
    filters:
      - calibrate_linear:
          - -375385 -> 0
          - -882911 -> 81
    unit_of_measurement: lb
    
# Freenove Camera Config
esp32_camera:
  external_clock:
    pin: GPIO21
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO4, GPIO5, GPIO18, GPIO19, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  max_framerate: .1fps
  idle_framerate: .01fps

  # Image settings
  name: Bee Hive Camera

Your indentation looks mucked up here, but I guess it compiles OK?

I double checked the indentation. It matches the example below in the ESPHOME documentation under Deep Sleep. Below is their example. Mine does compile. The last input in the log is the node entering deep sleep and it does occur at sunset. I thought tonight I might try to change the “until time” for one minute later.

# ESP32 can sleep until a specific time of day.
on_...:
  then:
    - deep_sleep.enter:
        id: deep_sleep_1
        until: "16:00:00"
        time_id: sntp_id

I have entered the following config code to try and debug the problem. This code works for relatively short periods (minutes). Going to try it for a couple hours. This leads me to believe there is an upper time limit for what “until:” will function.

# Sleep test button configuration
button:
  - platform: template
    name: SleepTest
    id: sleep_button
    icon: "mdi:emoticon-outline"
    on_press:
      then:
        - logger.log: "Button Pushed"
        - deep_sleep.enter:
            id: deep_sleep_1
            until: "11:30:00"
            time_id: homeassistant_time

Log from device entering deep_sleep until 11:30 approx two hours long.

[09:43:25][C][deep_sleep:049]: Setting up Deep Sleep…
[09:43:26][D][api:102]: Accepted ::FFFF:C0A8:27
[09:43:26][D][api.connection:827]: Home Assistant 2022.6.4 (::FFFF:C0A8:27): Connected successfully
[09:43:26][D][time:042]: Synchronized time: 2022-06-13 09:43:26
[09:43:40][D][esp32_camera:168]: Got Image: len=15565
[09:43:50][D][esp32_camera:168]: Got Image: len=18345
[09:43:57][D][sensor:125]: ‘Voltage’: Sending state 3795.00000 with 0 decimals of accuracy
[09:43:57][D][sensor:125]: ‘Percentage’: Sending state 43.64058 with 0 decimals of accuracy
[09:44:00][D][button:013]: ‘SleepTest’ Pressed.
[09:44:00][D][main:236]: Button Pushed
[09:44:00][I][deep_sleep:116]: Beginning Deep Sleep
[09:44:00][I][deep_sleep:118]: Sleeping for 6361000000us
[09:44:00][D][esp32.preferences:114]: Saving preferences to flash…

No it does not match.

Is it because the time crosses midnight?

Can you be specific on what indentation doesn’t match? I can’t see it. Maybe I’ve looked at it too long.

It may be a red herring but in the example the line after then starts under e, yours starts under n

Next line also doesn’t align