Easy Wi-Fi Setup for Headless IoT Devices: Exploring SmartConfig Technology

In the development of headless IoT devices, where keyboards and displays are absent, establishing a seamless Wi-Fi connection is crucial. Connecting to a Wi-Fi access point requires customers to set up the SSID and password during the device setup. Moreover, users should be able to switch between multiple Wi-Fi networks, making it necessary to support various connections and allow automatic switching.

For devices with keyboards and displays, setup is more straightforward, albeit less convenient. However, this approach is not suitable for headless devices, necessitating alternative methods to transmit Wi-Fi credentials.

  • BLE Connection:
    • Utilizing Bluetooth Low Energy (BLE) is a common method if the IoT device supports it. Customers can use a dedicated mobile app to connect via BLE and configure Wi-Fi credentials. While convenient, this approach requires BLE support.
  • Wi-Fi Access Point Setup:
    • Another approach involves the IoT device setting up a Wi-Fi access point and running a simple web server. Users can connect to the device’s access point, configure credentials using a web server interface, and, once completed, the device exits access point mode and connects to the specified Wi-Fi network.
  • SD Card or USB Disk:
    • If the IoT device has an SD card or USB slot, users can copy a file containing Wi-Fi credentials. The device processes this file to set up the Wi-Fi connection.
  • Wired Connections (USB or RS232):
    • IoT devices with wired connections can expose a command line interface for credential setup.

However, these solutions have their drawbacks, including the need for additional connections or increased complexity.

Introducing SmartConfig: A Wi-Fi Provisioning Technology

SmartConfig from TI offers a Wi-Fi provisioning technology that relies solely on Wi-Fi, eliminating the need to create an access point. The advantage lies in the device not requiring direct knowledge of the SSID or password; this information is wirelessly sent via a smartphone app.

As an example, let’s explore setting up SmartConfig on an ESP32 module. The ESP32 IDF SDK provides example code implementation along with a mobile app. To enhance functionality, I have developed a Wi-Fi manager library, allowing for:

  • Automatic initiation of SmartConfig if the device lacks saved SSID.
  • SmartConfig activation after boot for a customizable duration, enabling users to modify credentials if necessary.
  • Seamless connection to a Wi-Fi access point if credentials are already saved.
  • Efficient handling of Wi-Fi reconnect events.
  • Registration for Wi-Fi events, such as Connected or Disconnected, by the application.

To test this, clone the project from GitHub:

# git clone https://github.com/cybbed/WiFiManager

Flash the software to an ESP-WROOM-32 development kit using the command:

# NOTE: replace cu.usbserial-110 with actual USB port in your system
# idf.py -p /dev/cu.usbserial-110 flash monitor

Steps to Set Up SmartConfig:

  1. Download the mobile app Espressif Esptouch.
  2. Open the app, select EspTouch, and input the SSID password.
    Notice that the app has automatically used the current SSID which mobile phone is connected to
  3. Press “Confirm” to start the provisioning process.

Upon successful completion, the ESP32 will save the credentials in its internal memory for automatic connection in subsequent uses, displaying a successful overlay with the assigned IP address in the app.

Note: Ensure your mobile phone is connected to a 2.4GHz network for the ESP32 to be able to receive the credentials.

Unlocking a seamless setup experience, SmartConfig empowers devices with Wi-Fi-only connections to effortlessly acquire credentials. This not only accelerates the setup speed but also elevates the overall customer experience.

Read more

All articles

Contact us

Tell us about your IoT or embedded project and our experts will gladly provide you with qualified consultation.

Fill in the form

We use cookies to ensure your best experience. Through your continued use of this site you accept this use. For more information, please see our privacy policy