How to hook IOT device to home wifi for first time

I am building a data monitoring system which I hope to sell. Many of the IoT devices I have bought start out as an access point, to which you send a URL, and then a small webpage blossoms on your browser which allows you to send back to the device the information needed to hook the device to entities on the local WiFi network.

I have used the ESP32 with WiFi, but only to send messages or emails using SMTP2Go. I don't know how to set up the situation discussed above. If anyone could provide me with a general roadmap as to what is involved, I would greatly appreciate it.

Thanks in advance for any tips.

jrdoner

If the ESP32's are going to be data monitoring devices that send their data to a point and receive data from a point, I'd use a MQTT broker set up locally, say on a RPi. From there the data, using code or Node Red, can be sent to 'where ever'. Where ever being something like the dB on your web site so you can then do the thing.

There is a WiFi manager library here. It is still in development and may have some bugs, but worth investigating.

PaulRB:
There is a WiFi manager library here. It is still in development and may have some bugs, but worth investigating.

+1 for WifiManager. Not only can you use it to set Wifi access point credentials but you can add extra parameters to the config page it presents so you use it to set other variables etc as well.
I use it in this code to select Wifi & MQTT credentials.

"Many of the IoT devices I have bought start out as an access point, to which you send a URL, and then a small webpage blossoms on your browser which allows you to send back to the device the information needed to hook the device to entities on the local WiFi network."

It is an interesting situation. I haven't seen any example code that will facilitate doing this operation. There is example code that functions as an AP as well as a station on a LAN. You might look at that type of code to see if it can be tweaked to enter the LAN information after the the AP is established.