Esp32dev devices go unavailable

I have two of these esp32dev devices. I only have a few dvices connected to one of them at the moment. a couple of contacts . Is it normal for these to go to sleep? If so how can I stop that from happening?

Thanks

1 Like

Sorry I must have misunderstood the description of this portion of the forum

Thanks JulianDH I think that deep_sleep.prevent might be what I want. I donā€™t ever want it to go to sleep.

That depends. If you are running esphome on your esp32dev you are probably right here. But you just donā€™t tell us. :man_shrugging: You also donā€™t bother to present the minimum amount of information for others to help you @edlentz. At least your (esphome) yaml and probably some logs would be necessary so other forum members can actually help you without tipping totally in the dark and making wild guesses. :dark_sunglasses:

You probably also werenā€™t animated yet to open the link which could really help us helping you (if you actually would read it and act accordingly :bulb:)

I try again because I have hope in people @edlentz :wink::point_down:

1 Like

Try again,

I am using espHome on two esp32dev devices. So far I have three contacts that I am using so far. They are magnetic reed switches on two garage doors to indicate when the door is open or closed. The switches and wiring to the ESPā€™s has been in service for at least 15 years (Rock solid) So far I run a automation to a siren to play a sound when the door opens. The other morning I opened the door to go to work and the siren was silent. I logged into the HA and ran the automation and the siren sounded. This is why I think the esp went to sleep. This is my first project with HA and ESPHome / ESP32Dev devices. Is it possible the ESP32 went into sleep mode? So here is my code on the esp32

esphome:
  name: "node1"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

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

ota:


wifi:
  ssid: "Buffalo"
  password: "pnndn1rv7"
  
   # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-6D33Cc"
    password: "ahb7ji5QigwX"

captive_portal:

# Contacts or Buttons

binary_sensor:
- platform: gpio
  name: Honda Door Contact
  pin:
    number: 13
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: true
  disabled_by_default: false
    

- platform: gpio
  name: Other Door Contact
  pin:
    number: 16
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: true
  disabled_by_default: false
  
  
- platform: gpio
  name: Back Door Alarm Contact
  pin:
    number: 17
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: false
  disabled_by_default: false
  

- platform: gpio
  name: Back Doorbell Button
  pin:
    number: 18
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: false
  disabled_by_default: false
  

- platform: gpio
  name: Garage Lites Button
  pin:
    number: 19
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: true
    inverted: false
  disabled_by_default: false
    
    
    
       
      
# Relay controls      
switch:
  - platform: gpio
    name: "Pool Pump Relay"
    pin: 21
    

  - platform: gpio
    name: "Honda Door Relay"
    pin: 23
    

  - platform: gpio
    name: "Other Door Relay"
    pin: 25
    

When did you set this up? Is is a permanent power supply. Go to ESPHome dashboard and run the logs. With the ā€˜rollingā€ logs in front of you, open a door. Does it show up in the logs? Try another door. With the logs you can see exactly what your device is doing.

You can also add some sensors like Wi-Fi so you can see the strength of the connection. See ESPHome

The power supply is permanent 5VDC. I connected the contacts to the esp last week. Iā€™ll run the logs with opening doors and report back. The Wifi distance is about 20ā€™. Iā€™ll check it anyway I do not have them setup for a static IP, would that add to reliability?

Screenshot from 2022-12-30 22-59-28

I do but your goal is to understand what your device is doing before you start inventing solutions.

Thank you for the truncated photo. At least you can see your device and it has a strong signal. Now you need to do the fault finding. Good luck

I opened the live logging in esphome. The contacts are working as expected. I had to start the log twice, the first time had no data. It said it was connected. The second time the data was available

Well, after reprogramming both of the esp32ā€™s (switching the code between them, to make sure Either was good or bad) I ended up changing the static IP of the ESP that was going offline, and it has been steady since. I checked my network with several IP scanners and found no duplicate IPs. Still a mystery ast to what was actually going on, but it is stable at least for now.