Headless IoT Deployment

It’s been a while I have written something here. I had been busy with a lot of cool projects.

When you work on multiple IoT projects, one thing which is a common is networking and configuration management.

Most of the time when we create an MVP, we generally tend to bind our code with configuration parameters like server IPs, ports, Wi-Fi credentials etc. It’s okay, if the MVP does not go places. Everything works… Happy Days…!

Now, imagine you build a cool demo and your PM requests to showcase this demo to somewhere at a conference. He tells you that there is a Wi-Fi connection out there. Aha, your demo needs a working Wi-Fi internet connection, and they have it, but how will know them until you get there :)

The point I am trying to make here is, it would be such a big pain that someone at the conference has to make a code change to configure Wi-Fi to make to demo the MVP.

That’s where the Headless Deployment of IoT devices comes to the rescue.

In a headless setup, the device if not able to connect to Wi-Fi, would automatically put itself into a config mode and the end user could configure it using a private local network either via Bluetooth or Wi-Fi.

To give you an example, I have a Raspberry Pi which is it’s not able to connect to a known Wi-Fi Access point (AP), would turn itself into an access point. Now, using your laptop or mobile phone, you could connect to that access point. Once you connect, you will be auto redirected to a captive portal which will ask you the desired Wi-Fi access point you want your Raspberry Pi to connect to. Once you provide that, it will reboot itself and connect to it to the internet via the new Wi-Fi AP.

Another example, a device like ESP32 Micro controller to which you cannot even attach a monitor and keyboard, I use the same idea to connect it to the Wi-Fi access point. I have created a sketch which does this as described above. I plan to release it in due course of time. Here are few snapshots of the work done so far. Any suggestions and feedback are welcome.

Scan for the AP hosted by the ESP MCU
Connect to the AP
WebAPP hosted by the ESP MCU
Select option to configure new AP
After selecting the options, it returns scanned options of APs
Connect to the desired AP
You could also configure MQTT broker options using this portal

That’s it, your MCU is now connected to internet via Wi-Fi. This is a reusable component which I put in all my IoT projects. This comes very handy when you want to make your IoT demos transportable :)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store