Enter WiFi Credentials on ESP32 with One Button

It is considered bad practice to hard-code WiFi credentials into Arduino sketches. Typical recommendations include the WiFiManager library for ESP8266, and SmartConfig for ESP32. Both require the user to have a smartphone to send command to the ESP chip, which otherwise does not have any User Interface (UI).

My ESP32 board is the Heltec WiFi_Kit_32 that comes with a 0.96 inch OLED display and a little PRG button connected to pin #0. Can I use these minimal UI to enter WiFi credentials without involving a smartphone?

Heltec WiFi\_Kit\_32 OLED board with one button

Design with Minimal UI

I took inspiration from Prof Stephen Hawking's computer:

Happy New Year 2018 on ESP32 OLED

I've been playing with ESP8266 for one and a half years now. Recently, I'm upgrading to its bigger brother, the ESP32. I purchased two development boards, one of them is the Heltec WiFi_Kit_32 that comes with a 0.96 inch OLED display.

When 2018 arrives, what's a better way to say Happy New Year than on the ESP32? Therefore, I crawled out of the bed at 4AM, turned on the computer, and started Arduino IDE. Half an hour later, I tweeted this picture:

"Happy New Year 2018" on Heltec WiFi\_Kit\_32 OLED display

The code is simple yet effective. It was modified from u8g2 library full_buffer/HelloWorld example, with the constructor line found on Robot Zero One.