Code doesn't update to ESP

Hi everybody,

I have a problem. I have an ESP, and it works perfectly with esphome. Therefore I decided to buy a 2nd ESP, all went good, and after I installed it, it came online in home assistant. I can also go in the webbrowser for the ESP. then I copied a piece code from the other esp (some relays) and copied it to this esp. when I uploaded it, it uploaded fine, and said update complete. after that I cant reach it with the webbrowser (it says it has declined the connection), but I can ping it and can also see it in the log of esp (the log shows the relays, but in home assistant I dont see the entity’s). when I restart the esp I can connect it via de webbrower again, but none of my sensors or switches appear. but with my other esp the code works fine.
I also tried to upload the code via different methods, but all methods didn’t do anything else.

anybody any idea how I can fix this, or am I doing something wrong ;).

Already thanks!

did u copy all the code? name and keys have to be unique.

Hi no I only copied the code from the relays (so that they are on the same output as the other esp). the rest of the code is unique

Today I have tried connecting it with a different wifi network, but also with no result. anybody else something I can try?

Start with sharing your yaml and the log file

Hi Jos,
here is my code:

esphome:
  name: esphome-web-4a92b8
  friendly_name: ESPHome Web 4a92b8
  min_version: 2024.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

switch:
  - platform: gpio
    name: "Relay 1"
    pin: 15
    inverted: True

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

On your code I see no sensors and only one switch… Is that your whole code?
Maybe you are using other strapping pins, 15 being just one of them?

Hi, yeah. This code is my test code that I used to test it, and with this it gives the error

What error it gives?

Hi

In the code above you haven’t got the web server component defined hence you can’t browse to it. You need to add the following.


web_server:
  port: 80

1 Like

the error it gives from the log is:
[13:08:38]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]invalid header: 0x30257830
[13:08:38]ets Jul 29 2019 12:21:46

Look, what you write here doesn’t match with your code, not for the sensors not for web server…
Start from beginning, disconnect all gpio wirings and post your actual code and corresponding log.
You probably have wiring on strapping pins, gpio15 being one of them.

Hi,
No nothing is connected to the esp, except the usb. this is actualy the message in the log I am getting after i upload this code to the esp.

Post the link to the ESP you bought as well, just in case you have defined the wrong ESP

Good starting point.
What about the actual code?
I’m not asking to repeat the one on post#6, because it’s not matching to your experiments. With that code you can’t enter to esp from web browser…

I bought an esp from Aliexpress, here is the link: https://nl.aliexpress.com/item/1005006900641832.html?spm=a2g0o.order_list.order_list_main.35.21ef79d2fGfSIw&gatewayAdapt=glo2nld
it is the 38 pin variant.

maybe I say it wrong, but with the webbrowser I mean when I type in the ip of the esp I get to the esp like in this image.

but after I uploaded the OTA file to the esp it gives the BOOT error and I can’t ping it anymore.

But you don’t have web server component on your yaml…
Neither any of these sensors.

No, so that is weird. Why can I connect to the webbrower, even though it isn’t in the code? In my test Yaml I only have A relay switch, but it doesn’t come up.

Christmas magic?
At this point I don’t have any good answers.