As hackers, we occasionally forget that not everyone is enamored with the same nerdy minutia that we are. Configuring hardware by changing some lines in the code and compiling a new firmware doesn’t sound like that big of a deal to those of us who’ve been around the block a few times, but might as well be ancient Sanskrit to the average person. As long as your projects are for personal use this isn’t really a concern, but what if you plan on distributing the code for a project or perhaps even selling finished products? Shipping it out with hard-coded variables simply isn’t an option.
In a recent video, [Proto G] shows a clever way to use WiFiManager to make configuring your ESP32 project easier for end-users. Not only can you use the captive portal system to configure the ESP32’s WiFi against a nearby access point, but it can allow users to enter in configuration data which can be picked up in your code by using SPI Flash File System (SPIFSS).
With the setup demonstrated in the video below by [Proto G], you don’t need anything more exotic than a web browser to configure the device. The end user simply searches for the device’s WiFi network, connects to it, and is presented with an easy to understand dialog which has them select a WiFi network to configure against along with some fields to enter in custom variables. All this information is then stored to a file on the SPI flash. When the ESP32 reboots, it reads the configuration from the saved file and applies the requested settings.
This is very similar to how many consumer devices are now configured, and even the less technically-inclined recipients of such a device should be able to work through the setup with a bit of hand-holding. If you plan on handing one of your ESP32 projects to John Q. Public, this is the kind of configuration you should be aiming for.
We’ve covered using WiFiManager to make ESP32 projects easier to manage, but the addition of arbitrary variables to the captive portal opens up a lot of possibilities. Just the kind of thing you need when you start considering the leap to commercial product.
Humm, mongoose OS does that in similar fashion, but with a lot of more powerful things https://mongoose-os.com/
Yes, but more people are going to be willing to dive into something they’re already more familiar with(Arduino). I agree there are more powerful options out there but this is a great way for anyone familiar with Arduino to get started with. It’s nice to see the increased compatibility the ESP32 is getting with different platforms.
NodeMCU has this as ‘enduser setup’ module: https://nodemcu.readthedocs.io/en/master/en/modules/enduser-setup/
I was about to post that. I wrote that module in 2015.
In my mind mine is prettier ;)
That being said ESP32 support under Arduino is rather nice and a good alternative to NodeMCU.
https://memcpy.io/user-friendly-setup-of-esp8266-gadgets.html
Cool. Nicely done video too. I’ll be checking into that.
“This is very similar to how many consumer devices are now configured, and even the less technically-inclined recipients of such a device should be able to work through the setup with a bit of hand-holding.”
Variable ease of use by leveraging a more powerful endpoint. e.g. programming in a browser, download to hardware.
Randy loves to vacuum i love that ssid :D
That’s my Roomba’s name. He really does love to vacuum and he only occasionally complains when his tray is full. :)
Oh well, I thought Mrs Doubtfire loves to vacuum.
The same basic idea (user config AP) has been available for ESP8266 for a couple of years, if anyone else besides me still has ESP8266s to use up:
https://github.com/tzapu/WiFiManager