Captive Portal says wrong password, but I am sure it is right

Just started playing with ESPHome. While I have it on the bench and can flash with USB I was playing with the “Captive Portal” I have a ESP32 D1 mini. Does anyone see where I am going wrong?

Screenshot of esphome-flasher log.
image

Snippet from the secrets file. The Password will not be the one used in real life. :slight_smile:

wifi_esphome_fallback_ssid: 'FB Portal'
wifi_esphome_fallback_password: 'Test1412!'

Screenshot of my logging into the portal on my phone.
image

Here is the code:

esphome:
  name: shop_doors
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
#  ssid: !secret wifi_ssid_work
#  password: !secret wifi_password_work
  ssid: !secret wifi_ssid_work
  password: 'testtest'
  
  manual_ip:
    static_ip: 172.25.92.100
    gateway: 172.25.92.1
    subnet: 255.255.255.0
    

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret wifi_esphome_fallback_ssid
    password: !secret wifi_esphome_fallback_password

# Enable logging
logger:

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

ota:
  password: !secret esphome_ota_password
  


#When holding the board with ping to the right and ESP12 down
# Counting pins in pairs
# o-|GPIO 16
# o-|Shop North Window
#
# o-|GPIO 13
# o-|Shop North East Window
#
# o-|GPIO 05
# o-|Shop South East Window
#
# o-|GPIO 04
# o-|Shop South Window
#
# o-|GPIO 14
# o-|Shop Door
#
binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: False
    name: "Shop North Window"
    device_class: window
    filters:
    - delayed_on: 100ms
  - platform: gpio
    pin: 
      number: GPIO04
      mode: INPUT_PULLUP
      inverted: False
    name: "Shop North East Window"
    device_class: window
    filters:
    - delayed_on: 100ms
  - platform: gpio
    pin: 
      number: GPIO05
      mode: INPUT_PULLUP
      inverted: False
    name: "Shop South East Window"
    device_class: window
    filters:
    - delayed_on: 100ms
  - platform: gpio
    pin: 
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: False
    name: "Shop South Window"
    device_class: window
    filters:
    - delayed_on: 100ms
  - platform: gpio
    pin: 
      number: GPIO16
      mode: INPUT_PULLUP
      inverted: False
    name: "Shop Door"
    device_class: door
    filters:
    - delayed_on: 100ms
    
status_led:
  pin:
    number: GPIO02
    inverted: True
switch:
  - platform: restart
    name: "Restart Garage Door ESPHome"

Learned a lot.
The first mistake, I am missing the “captive_portal”. But even at that, if you use a static IP it will not work. Notice after adding the “captive_portal” there is now a socket error.
image

Here is my config to get the above error.

wifi:
  ssid: !secret wifi_ssid_work
#  password: !secret wifi_password_work
  password: 'testtest'
  use_address: 172.25.92.113

  manual_ip:
    static_ip: 172.25.92.100
    gateway: 172.25.92.1
    subnet: 255.255.255.0  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret wifi_esphome_fallback_ssid
    password: !secret wifi_esphome_fallback_password

captive_portal:

#

I was testing this in a location that I did not have access to lock down the IP to the mac. Also, the WIFI is on a different VLan and the xxxx.local would not resolve. At my house, it will be on a different VLan, but I will be able to lock down the IP to the mac. Then I can use the “use_address” and it will work. I just wanted to understand what was going on, I hate magic :slight_smile:

I did open a ticket at https://github.com/espressif/esp-idf/issues/6568

Are you using the esphome secrets file or the home assistant secrets file?

I am using the home assistant. That all works. In fact, I did try and hard code them once, but you can see from the debug that it was reading the secrets file correctly. It is a matter of using a static IP. If I take that configuration out then it captive portal works.