Nodemcu doesnt work after power cycle

I have a nodemcu that I use to monitor 4 reed switches in my doors, it works great. It however DOES NOT work at all after a power outage. The only way I can get it to work again, is to disconnected all of my 4 door sensor wires and then reboot the nodemcu and then reconnect wires. It is a pain and we are coming up on power outage season!

Can anyone tell me how I can resolve this. Below is my configuration of what pins I am using out of the nodemcu.

Thank you.

esphome:
  name: nodemcu1
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "myssid"
  password: "mypass"
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: m192.168.z.z
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.z.z
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Nodemcu1 Fallback Hotspot"
    password: "mypass"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "mypass"

ota:
  password: "mypass"
  
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO1
      mode: INPUT_PULLUP
      #inverted: True
    name: "Side Garage Door"
    device_class: door
    
  - platform: gpio
    pin:
      number: GPIO2
      mode: INPUT_PULLUP
      #inverted: True
    name: "Side Entry  Door"
    device_class: door
    
  - platform: gpio
    pin:
      number: GPIO3
      mode: INPUT_PULLUP
      #inverted: True
    name: "Front Entry Door"
    device_class: door
  - platform: gpio
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      #inverted: True
    name: "Deck Door"
    device_class: door

The problem is with your pin selection. The pins such as GPIO0 and GPIO2, if pulled low will disable boot while GPIO3 if pulled high during boot can disable boot. You should change the pin according to this scheme.

2 Likes

Ahhh, perfect. Thank you very much. Just to clarify, currently when all my doors are shut, my pins are grounded which means they are pulled low right? so I could select any pin without the blue( or red) asterisk? So GPIO12, 13, 14, 4 AND 5 would be ideal?

Yes

thats the best pins fo input.