Understanding IoT Wi-Fi Configuration Methods

Understanding IoT Wi-Fi Configuration Methods

Introduction by AliMei: What is network configuration? What are the different methods? Why is IoT network configuration technology so mixed and incompatible? This article will detail six methods of network configuration, including one-click configuration, device hotspot configuration, mobile hotspot configuration, Bluetooth configuration, router configuration, and zero configuration, summarizing and comparing the characteristics of each method and sharing insights on the future development of network configuration technology.

End of article benefit: Download the “AliOS Things Quick Development Guide” e-book for free!

1. Overview

Wi-Fi has been around for a long time, but network configuration is relatively unfamiliar to many people. Early Wi-Fi devices typically had screens and input devices (such as laptops, smartphones, PDAs, etc.), and network configuration only required users to directly input the router’s SSID/password, which was simple enough to be overlooked.
However, with the rise of the Internet of Things, Wi-Fi is widely used in devices without human-machine interaction, such as smart plugs and other IoT terminal products. The Wi-Fi (IEEE802.11) standard did not consider such unmanned interaction methods in its design, meaning there is no official standard for network configuration. Network configuration has become a technology akin to hackers finding vulnerabilities, resulting in a variety of methods available on the market, with each company doing its own thing, leading to a mixed bag of experiences and overall low user satisfaction.
Several concepts:
  • Narrow Definition of Network Configuration: The process by which Wi-Fi devices obtain router information (SSID, password, etc.) and connect to the router.

  • Binding: The process of linking the user’s mobile app account with the device being configured.

  • Broad Definition of Network Configuration: Narrow definition + binding.

Unless otherwise specified, the network configuration discussed in this article refers to the narrow definition and omits the cloud participation process. A simplified diagram is as follows:
Understanding IoT Wi-Fi Configuration Methods
So, what are the network configuration technologies available on the market? The main commercial methods can be categorized as follows:
  1. One-click Configuration
    1. Broadcast Packet Length Method
    2. Multicast Address Method
  1. Device Hotspot Configuration
  2. Bluetooth Configuration
  3. Mobile Hotspot Configuration
  4. Router Configuration
  5. Zero Configuration
  6. Others (such as voice configuration/camera QR code configuration, etc.)
The Aliyun IoT development platform’s IoT operating system, AliOS Things, supports the above 1-6 configuration methods.

2. Detailed Introduction

1. One-click Configuration

Process

The main principle of one-click configuration (Smart Config) is as follows:
1. The device enters sniffer mode (also known as promiscuous mode, which does not filter data packets) and listens to all 802.11 packets in the environment;
2. The device needs to poll and listen on the supported channels (usually 1-13) because it does not know the channel of the user’s mobile phone and target router;
3. After capturing data packets that meet the configuration rules, it stops channel polling and attempts to receive all packets on that channel;
4. If the current channel fails to receive or times out, it returns to step 2;
5. Once all data packets are successfully received, it exits sniffer mode, switches to station mode, and begins to connect to the router, completing the narrow network configuration process.
Understanding IoT Wi-Fi Configuration Methods

Data Transmission Methods

There are two ways to carry data: one is the broadcast method, and the other is the multicast method. Below are the introductions for each.
Before the device connects to the router, it does not have the corresponding key and cannot decrypt the data packets within the router’s local area network (including packets from the user’s mobile phone connected to the target router).
As shown in the figure below, the data packet body received by the device in sniffer mode is encrypted; only the frame header and the total packet length are unencrypted. To pass configuration information to the device via the mobile phone, we need to consider using this information.
MAC Frame Format:

Understanding IoT Wi-Fi Configuration Methods

1) Broadcast Packet Length Method
The length of the data packet is a total of 2 bytes, and since the header and checksum occupy part of the fields, it cannot start encoding from 0. If the length is too long, it will significantly increase the redundant data in the entire data packet. Therefore, we take an 11-bit compromise.
Specifically, the method is that the mobile end sends broadcast packets of different lengths, encoding the configuration information into the packet length information. — It’s a bit like an acrostic poem, right?
2) Multicast Address Method
If we use address encoding, i.e., using the DA encoding shown in the figure below, then it is multicast.
IEEE802.11 designates the address range of 224.0.0.0 ~ 239.255.255.255 as multicast reserved addresses. In Ethernet, data packets with a destination IP address as a multicast reserved address require a mapping of the destination MAC address. The specific method is that the first three bytes of the MAC address are fixed as 01:00:5E, and the last three bytes are taken from the second byte of the group address (low 7 bits), the third byte, and the fourth byte. For example, the group address 225.215.145.230 corresponds to the MAC address 01:00:5E:57:91:E6. Therefore, there are 23 bits available for user encoding.
  • Advantages:

  • Simple user operation, good experience (when successful).
  • Disadvantages:
  • Strict compatibility requirements for both mobile phones and routers. For example, some routers have broadcast/multicast forwarding disabled by default, preventing the device from receiving the forwarded packets; if the mobile phone connects to the router on the 5G frequency band, the 2.4G device cannot receive the packets, etc. These uncontrollable factors lead to overall poor compatibility and low configuration success rates.
Summary
This was the default choice for most manufacturers when the Internet of Things first emerged, but it was gradually abandoned after suffering from user complaints.

2. Device Hotspot Configuration

Device hotspot configuration is easy to understand:
1. The device’s Wi-Fi enters softAP mode and establishes an AP hotspot with a designated name;
2. The app prompts the user to manually connect their phone to the hotspot established by the device in step 1;
3. Once the connection is established, the phone and device create a local area network;
4. The phone transmits the configuration information directly to the device via UDP/TCP;
5. After receiving the configuration information, the device switches back to station mode and begins connecting to the router.
Understanding IoT Wi-Fi Configuration Methods
  • Advantages:
  • High success rate and reliability.
  • Disadvantages:
  • User operation is slightly more complex compared to one-click configuration (iPhone users need to manually switch to the wireless LAN settings to connect to the device hotspot indicated in the app).
Summary
Its moderate reliability is its winning strategy, as the once-dominant one-click configuration has been widely criticized for its low success rate, while the market share of device hotspot configuration has steadily increased.

3. Mobile Hotspot Configuration

This is a variant of hotspot configuration (softAP), where the hotspot is created by the mobile phone rather than the device.
  • Advantages:
  • The device does not need to support hotspot mode, resulting in lower development workload on the end;
  • Can coexist with one-click configuration (enabled simultaneously). In Aliyun IoT’s mobile hotspot configuration, the mobile hotspot SSID is fixed as ‘aha’, so devices in one-click configuration mode will attempt to connect to ‘aha’ as soon as they scan for the surrounding hotspot. This is commonly used as a backup configuration scheme.
  • Disadvantages:
  • User experience is poor, especially on iOS devices where the app cannot automatically create a hotspot; users need to manually navigate to the settings to change the device name and enable the hotspot.
Summary
Once seen as an innovation in Ali IoT, it has become a backup solution following the failure of one-click configuration, and its occurrence rate has decreased as the share of one-click configuration has diminished.

4. Bluetooth Configuration

The overall process of Bluetooth configuration is similar to device hotspot configuration, except that BLE replaces the device’s hotspot, theoretically still being a point-to-point connection-based configuration method.
Understanding IoT Wi-Fi Configuration Methods
  • Advantages:
  • Good compatibility and high success rate.
  • Good user experience.
  • Disadvantages:
  • Costs are slightly higher. Compared to other configuration modes, additional Bluetooth hardware costs need to be incurred.
Summary
Suitable for devices that have both Bluetooth and Wi-Fi applications or for devices whose module costs are relatively insensitive. With the promotion of low-cost BLE, its market share is gradually increasing.

5. Router Configuration

The idea behind router configuration is that the router opens a specific SSID for configuration while in configuration mode; the device connects to this hotspot to obtain configuration information, and the process is similar to mobile hotspot configuration. The simplified flowchart is as follows:

Understanding IoT Wi-Fi Configuration Methods

  • Advantages:
  • Better user experience.
  • Disadvantages:
  • Narrow application scope; both the device and router must meet the same scheme.
Summary
Suitable for manufacturers with a complete ecological strategy on the end.

6. Zero Configuration

This is a method that fully utilizes the high-privilege advantages of the device to be configured and the main configuration device, requiring both the main configuration and the device to be configured to send and receive 802.11 management frames. It directly uses the 802.11 management frames (probe request/response) to carry configuration information, thus achieving efficient configuration. The simplified principle is as follows:
Understanding IoT Wi-Fi Configuration Methods
  • Advantages:
  • Good user experience and high success rate; for example, smart speakers can use this method to configure smart devices.
  • Disadvantages:
  • Narrow application scope; requires the existence of already configured devices in the same scheme under the router.
Summary
Designed to be efficient and reliable, but due to mobile app permissions, it cannot assemble or receive Wi-Fi management frames through third-party programs, limiting its application on mobile phones (the mobile phone cannot be the main configuration), thus making it only a supplementary or specific field configuration method.

3. Summary Comparison

A comparison of the characteristics of each configuration method is provided in the following table:

Understanding IoT Wi-Fi Configuration Methods

4. Development Direction

In addition to the configuration methods listed above, there are other directions for reference.
1. Wi-Fi P2P. Using Wi-Fi Direct technology to directly transmit configuration information from the phone to the device.
Disadvantages: Unfortunately, only Android phones support Wi-Fi Direct technology; iOS does not support it. Moreover, not all Android phones support it, leading to poor compatibility and making it impossible to popularize.
2. Apple’s AWDL protocol. AWDL can be considered Apple’s proprietary end-to-end P2P protocol, such as AirDrop, which is based on this protocol. Unfortunately, the protocol is not open-source, and even if it is cracked, there are legal risks associated with its use. Otherwise, it could be used in conjunction with method 1 to form a complement.
Therefore, the above two methods are unlikely to become mainstream in general configuration.
3. Configuration for specific scenarios:
  • Voice configuration (using local voice recognition technology to configure devices with voice recognition modules, such as smart speakers).
  • QR code configuration for smart cameras (the camera actively scans the QR code generated by the mobile app), etc.
Utilizing unique software and hardware advantages to provide excellent configuration experiences in corresponding fields reflects the Internet of Things’ highly customized and optimized approach to niche markets.
4. DPP (Device Provisioning Protocol). An important component of Wi-Fi Easy Connect, officially formulated by the Wi-Fi Alliance. It consists of four steps:
  • Guidance: Scanning a QR code or entering a string to trigger, obtaining the public key of the other device as well as information such as channel and MAC;
  • Verification: The device to be configured and the main configuration establish a secure connection based on the information obtained in the previous step;
  • Configuration: Transmitting configuration information to the device to be configured;
  • Access: The device to be configured authenticates and connects to the target AP using the configuration information.
Currently, DPP is still in the stage of standard formulation and improvement and has not yet been commercialized. However, once an official unified configuration standard is established, its prospects are quite promising and may significantly address the fragmentation issue of configuration.
Before DPP is commercialized, device hotspot configuration (↗)/Bluetooth configuration (↗)/one-click configuration (↘) will continue to be mainstream.
Free e-book download
AliOS Things Quick Development Guide
Understanding IoT Wi-Fi Configuration Methods
AliOS Things is committed to building an integrated IoT infrastructure, supporting a variety of devices, and can be widely applied in smart homes, smart cities, industry, and new mobility fields. This book teaches you step-by-step from environment preparation to online and offline development debugging, with two typical scenarios provided for practice. Your IoT development starts here! Come and get new skills!
Click “Read the Original” to download now!
Understanding IoT Wi-Fi Configuration Methods
Follow “Ali Technology”
Keep up with the pulse of cutting-edge technology
Understanding IoT Wi-Fi Configuration Methods
Click me to download the e-book.

Leave a Comment