ESPHome Devices take a LONG time to connect to wifi (30-60 Minutes)

@stevemann Sorry I respond to the stuff about… I have no issues using the initial AP it generates to connect to it. this connects me to the 192.168.4.1 problem is this only lets me set the SSID and password for wifi… Once you connect it once to wifi then I can upload the custom YAML that has the static IP in it so not a huge deal just need to wait for it to connect that first time!

All that info is great info that helps people understand how these work. As I mentioned above I have been doing IT/Networking my entire career so very familiar with networking concepts and how these all work but again good information to put out there!! Will look at the other stuff tonight when I get home!

So I have no problem doing this and I understand for the most part why but what happens when an issue happens and you need it to go back to AP mode? Again these are sealed units so I have to be careful as a bad setting can lock me out.

I honestly wouldn’t know. In almost 100 ESP devices, mostly DIY, I have never, not once used ap: Looking at the docs, you could probably leave the `ap: {} in the wifi section.

wifi:
  ap: {}
  ssid: MyHomeNetwork
  password: VerySafePassword

The only time you should ever set a static IP on the device side is if you have more than one ethernet or wireless port/adapter and you need to have one available to access other subnets and vlans that don’t have a dedicated DHCP host on that network in the case of initial setup, configuration or case by case management i.e servers that you are know are ALWAYS going to be on the same subnet during lifetime operation.

All other times the static IP is to be assigned to the device mac address via the primary host DHCP device on the network.

Where do you get this information from, or is it just your opinion IE what you like to do? There is no RULE for when you can only use a static IP address. There are many different reasons for it and some are preference and some time easier or harder to use one… DHCP is going to make your life easier because all you have to do is make a single change at a server level and each one of your devices will reflect that change. if you set all your devices to static then you got to go to each one of those devices and update that change. in a smart home 99% of the devices only need to have an IP address a gateway and maybe DNS and maybe NTP… these are things that really don’t change in home network unless you’re playing around a lot or you decide to use Cloud Flairs DNS instead of your ISPs DNS. But again to each their own as there’s no rule that says you have to use it it’s just more convenient to use it in some cases.

Question if I take this YAML and clean it all up to only stuff I use. What does it really do? like i remove all the power factor crap and time since last reboot. iit really doing anything? I guess the question is what’s the point of doing it. Like you said if its not broke dont fix it…

Like I said, the factory configuration is to be all thigs to the broadest non-technical audience possible. But Athom knows that advanced DIY users will hack the code which is why they share the configuration file so readily.

The code in post #6 should be safe, and the minimum needed. You can always add stuff from the original configuration back in. Either add your WiFi credentials into the configuration file or into secrets.yaml file. The factory configuration has

web_server:
  port: 80

You will see the device by pointing your browser to the device IP address.

What’s the worst that can happen? You could brick a $15 switch, but I doubt it. Of over 60 devices I only had to use a UART on one commercial device because, and it’s supposed to be impossible, I had two devices on my network with the same MAC address. (Some boards like the ESP8266-01 and the ESP-12 module can only be programmed with an external UART).

okay so it’s just more about stripping features back that you don’t need or maybe adding in a future that wasn’t there before but the board supports…

yeah I’ve already screwed around with the configuration ripped out all the stupid things that I don’t want that I’m just hiding in home assistant…

thanks for all your help on this!