A few weeks ago one of my esp’s worked when I flashed it with esphome, but when I uploaded a code to it, it stopped working. I thought it was something with that esp, but lately my other esp’s (who worked perfectly) also have the same problem now. They all are from a different manufacturer. When I flashed the esp that stopped working lately with a new flash from the esphome web it stays online, but when I upload the basic code (with no sensors or anything in it, only the standard factory code) it goes offline. I also cant ping it. When I log the esp with a usb uart connection It freezes. When I restart the esp it boots normaly, but the code that I uploaded to it is gone. Does anybody know if this is a bug or a usual problem that I can easily fix?
I also tried downloading home assistant again on proxmox, and changed the wifi ip range from the 2.x range to 192.168.x range, but with no result. when I plug the esp in another system from somebody else it works perfectly, and I can upload code to it and it stays online. but in my system it doesn’t. anybody any idea?
Hi Edwin, nothing is connected to the esp. It is powered via usb. What I found weird, is that it works in somebody elses home with home assistant, but doesn’t in my home.
when changing from arduino to esp-idf that doesn’t always(almost never) goes well. because of the changes in the partition table.
you either need to serial flash, or you can include some script to update the table OTA.
but for the latter that brings risks. and I don’t have the time to find the documentation at the moment.
If it worked in some one else’s home, is it then connecting to some one else’s wifi and trying to talk to some one else’s home assistant?
It also was connected to some one else’s usb, which might provide more stable power. But if it is just a plain esp with no power hungry things attached you should be fine on the power supply.
Yeah I also think so. I have changed the secrets folder to my own wifi, so that also shouldn’t be the problem. When I upoad the installer file it works perfectly, but when I upload the code (from above) it goes offline. Same as the other esp that I have (excact same issue) anything else that could give this problem?
I would do a clean before the build to make sure there’s no old code somewhere being included. Most likely something changed in the esp platform, but a clean yaml should not be a problem if you create a clean, full build too.
There were some changes to OTA setting some time ago, but that should give compile errors if your yaml is too old, and new clean yaml should be fine.
If MDNS is failing, ESPHome may not be able to find your esp, but your esp should be able to find HA and connect to it. But it would prevent you from seeing logs on wifi only. No logging on usb too seems weird, that would suggest the board actually freezes quite early in the boot.
Firmware updates not taking hold could be the result of the freeze, I think the firmware update process might to roll back if it does not come back alive after the flash.
Thanks! I have never hears of MDNS, going to do some research about it. I will also look into a firmware update, but that still doesn’t solve that the esp works perfectly in another system and not in mine😅
The bottom line in your screenshot (that I can’t copy/paste) says it tries to find a device ending in .local and that name should be known on the network through MDNS. But that often fails in networks tat are not properly configurated. It also happens (especially with esphome) that the name is known shortly after boot, but not some time later.
Even if ESPHome cannot find it, HA should usually be able to add the integration for the device and work properly. That is why I asked if the device was autodetected and added to HA.
If it proves to be an MDNS problem, the solution is to assign the device a fixed ip and put that ip in the yaml. But if HA cant connect either using the ip addrress, it is likely something else.
When I flash the first installation file it indeed gets discovered in home assistant. I also can adopt it. But when I upload the new code it goes ofline. I also tried adding a static ip, but with no result. Same problem. I also in my router doesn’t see the ip adress that I put in the code. When I restart it it goes back to the old ip
Didn’t you create the firmware with esphome in the first place? If so you would not need to adopt it, it would already be there. How did you build and flash the first version if it wasn’t from esphome in the first place? I’m starting to think the adopted yaml is not exactly what was used to build the version you flashed the first time.