WiFi Setup for IoT Devices

Explore different methods of WiFi setup by an end-user.

Manual setup

  1. Simplest manual setup is by using PiBakery where several Raspberry Pi configuration settings including WiFi setup can be done using simple block based programming.

  2. Directly editing wpa_supplicant.conf in the boot partition after writing the image to SD card and mounting the SD card.

Local AP

Consumer IoT devices have been providing simple WiFi setup using a smart phone to connect to a special WiFi network provided by the device and providing home network WiFi credentials using a custom web page. Google Coder image provided easy WiFi setup as part of their custom image for Raspberry Pi. Balena.io (formerly resin.io) provided WiFi Connect. Headless IoT WiFi setup for Raspberry Pi is another.

Bluetooth

Ben Hardill's blog featured a method to setup WiFi over Bluetooth. The way it works is by using Physical Web a.k.a Eddystone beacon which advertises a URL. The URL published must be hosted as a public site. When the desktop or phone with Bluetooth enabled visits the site, a form collects SSID and Password and passes those details over the Bluetooth connection established between IoT device and Desktop/Phone.

Patrick Hundal's blog on Mozilla Hacks demonstrates how you can open a serial connection to Raspberry Pi over Bluetooth and running commands including WiFi setup.

WiFi Protected Setup (WPS)

WPS works by pressing the specially designated button on the router and pressing a button the IoT device. The IoT device would read the SSID and Password transmitted and configure its WiFi credentials. There are several github repos that show how to do this. The PiWps shows how GPIO (attached to a button) can trigger this. There is a more full fledged app named Max2Play demonstrates the WPS setup using a shell script. The Raspberry Pi Forums had a topic that shows how to do this using a shell script. However there are some security concerns with this approach where a research paper showed how this can be used for covert operations and hacking.

SmartConfig

SmartConfig works by using an mobile app that accepts WiFi SSID and Password from user, tranmits this information on a UDP packet. On the IoT device a process connects to WiFi access point and listens for these packets and when a special signature found in the packet, extracts the SSID and Password, configures the WiFi for the device. In terms of user experience, all the user would need to do is, power on the IoT device and supply SSID and password using the App. The power of this technology lies in configuring multiple devices at once. SmartConfig is a Texas Instruments proprietary protocol to configure IoT device WiFi on a large scale. There are some tools available on github that make this work using TI libraries. The protocol was reverse engineered and documented. EspressIf developed a similar solution named ESPTouch for ESP8266 based boards. WeChat also developed a solution named AirKiss using a different protocol but works similar to SmartConfig. This blog post details how SmartConfig and other similar technologies work.

Last updated

Was this helpful?