Set wifi through webserver?

Hi.
Just started exploring the world of esp32.
I’m doing a stand alone clock display for a friend.
However the clock depends on my friends wifi.

Is it possible to create a webserver on the esp so I can set wifi and password there?

I don’t think so.

You’ll need access to ESPHome to be able to edit in the credentials and then recompile and upload.

I’m sure someone will be along with an alternative if there is one.

is what you want

1 Like

Ahhh… How did I miss that… :slight_smile:
Thanks…

As I am not mistaking this is a “one time” thing. As soon as the esp reboots it default back to the “fallbackhotspot”… :frowning:

You are mistaken. :point_down:

In this web interface, you can manually override the WiFi settings of the device (please note this will be overwritten by any subsequent upload, so make sure to also update your YAML configuration).

Source: Captive Portal — ESPHome

no - only if it doesn’t find the configured wifi or fails connecting to it.

I think I am not mistaking, but convince me once again.

According to the documentation (your link):
The captive portal component in ESPHome is a fallback mechanism for when connecting to the configured WiFi fails.

This means that when you configure via yaml your wifi:, and fails to connect it broadcasts the fallback hotspot. Then you can configure (select) a “one time” wifi to connect to.

Then when you restart or power cycle the device it tries to connect to the yaml configured wifi again and if not available it repeats above.

Despite it works that way, at least for me. But maybe you found a way to make the configured wifi via the fallback hotspot persistent?

It should be persistent as long the device is not flashed with a new binary (which contains not only the new credentials in the yaml but erases old wifi credentials) like stated in the docs

(please note this will be overwritten by any subsequent upload, so make sure to also update your YAML configuration).