Flashed ESP32, Lost Drive, Now Can't Add?

Hi All,

I’m new to ESPHome. I had just finished flashing my first ESP32 with a sensor added to it when I had a drive failure. I’m back up and running with a new drive but didn’t get a backup with the new ESP32 added before I lost the original drive.

I’m trying to re-add that same ESP32 and having a really difficult time.

  • I go into ESPHome
  • add new device
  • create a new bin and download it
  • Upload it to the ESP32 connected to my desktop (not my HA host) and get a success message using https://web.esphome.io/
  • Unplug the ESP32 from my desktop and plug it into a wall charger

It doesn’t connect. and the added device in HA that I just created shows offline.

When I re-flash it, it doesn’t ask for wi-fi credentials again. Nothing has changed with those credentials so that tells me it’s keeping some information from the original setup.

Is this ESP32 a lost cause or am I doing something wrong?

Try to delete clean data from device. Probably it’s old firmware on it and something went wrong.

First off, more infos are necessary. :wink:

  • How is ESPHome installed?
  • Are you using HA-OS and ESPHome as Add-on?
  • Do you have the YAML file anywhere? Or if you can remember, that would be enough: what settings did you set for the IP address? Or did you just leave the default (meaning no setting for IP)?
  • Can you get the IP address from the device (through your router) aka is it connecting to your WIFI?

The idea behind this is to connect to the device and than flash a new firmware OTA. That sgould work better and you will have the device in ESPHome from the beginning. More on that, if needed, after you answer the questions. :slight_smile:

IIRC, the WIFI credentials will be saved in a session cookie in the browser. So as long as you didn’t close the browser, the credentials will still be there.

Sorry for the lack of information. I’m running home assistant OS on a Proxmox virtual machine.

ESPHome is installed through the add-on.

I’ve checked the IP address is on my Wi-Fi and I see one that is called ESPRESSIF but I cannot access it through that IP address so I don’t know if that’s it. I have two other esp32‘s on my Wi-Fi that are used for ESPresense And I see those and their names are clearly what I named them when setting them up. So I’m wondering if that other one is this ESP32.

I didn’t set a static IP address for it. It just asked for Wi-Fi username and password. I’m pretty sure an IP address isn’t in the yaml. I’m not home right now but I’ll double check when I get there.

RE: delete data from the device. I’ve tried “prepare for install” through the https://web.esphome.io/ and same results. Does this need to be done through a different tool?

I’ve closed my browser since the original flash, but not between flashing through https://web.esphome.io/ and adding to ESPHome add-on.

Wi-Fi credentials are saved in the secrets.yaml

Thanks!

How did you try? :wink: If I were you, I’d try it with this IP. :slight_smile:

  • go to your ESPHome dashboard and setup a new ESP32 device
  • setup the configuration as usual (what you want the ESP to do)
  • in the Wifi section add the part for manual_ip
    wifi:
      ssid: MyHomeNetwork
      password: VerySafePassword
      manual_ip:
        static_ip: 192.168.0.123 # device IP
        gateway: 192.168.0.1 # router IP
        subnet: 255.255.255.0 # subnet
    
  • set there the IP and router (device IP)
  • if you’re ready, save the config and install it
  • this should start a simple OTA update with the new firmware

I did this and I get an error when trying to install:
ERROR Connecting to 192.168.4.23:3232 failed: [Errno 111] Connection refused
DOWNLOAD LOGSEDITRETRYCLOSE

I’m wondering if that’s not the ESP32 I’m looking for at that IP address. I’m going to start over with a new ESP32 in case that one isn’t connecting to the wifi.

I’ll report back.

1 Like

Used a different ESP32 and all is working.

Thanks for the tips.