Get Your Microcontroller Online At The Speed Of Light

When developing a network-enabled project with the ESP8266 or ESP32, the easiest way to handle WiFi credentials is to just hardcode the access point and encryption key into the program. But that means recompiling the firmware if you ever want to use it on a different network, which isn’t really an option if you’re trying to make something that other people can easily use. If you’re expecting grandma to bust out the UART cable, we’ve got bad news for you.

There are various ways around this problem, but we think the one developed by [Pekka Lehtikoski] is particularly clever. With a simple application, network credentials can be literally “flashed” to the waiting microcontroller by rapidly blinking the flash LED on an Android device. This allows the information to be transferred quickly and easily regardless of the user’s technical proficiency. One could even make the argument that it’s more secure than some of the other methods of doing initial setup, since an eavesdropper would literally need to see you do it if they wanted to steal your encryption key.

[Pekka] has made the source code for the Android application and the “Gazerbeam” library open for anyone who wants to include the capability in their own projects. To pick up the blinking light you just need to add a phototransistor, an opamp, and a handful of passives to your circuit; making this solution cheap enough that you could even use it in a small-scale production run. The concept isn’t limited to network credentials either. Whenever we can hold conferences again, it could be an interesting way to let attendees customize their badge.

Of course, [Pekka] isn’t the first person to use this trick. Hackers well versed in the history of WiFi MCUs may recall that the Electric Imp used a very similar method of configuration called BlinkUp. If you ever come across a device that asks you to put your phone’s screen down on a little window to perform the initial setup, there’s a good chance it has an Imp inside.

Deploying A Turnkey Raspberry Pi System

If you only do projects for yourself, you are spoiled. After all, you know your environment better than anyone. You know what power you’ll have, the temperature range, and how your network is configured. This last part is especially problematic if you are trying to deploy something that connects to a wireless LAN. How can you configure, say, a Raspberry Pi so that it can connect to an unknown user’s WiFi network? Fixing that problem is the goal of [schollz’s] Raspberry Pi Turnkey project.

The idea is simple. A Raspberry Pi image boots up for the first time and offers a WiFi hotspot itself called ConnectToConnect. The WiFi password is also ConnectToConnect. Once connected, you get configuration options that allow you to tailor the system to your network. Sure, you could have people log in and reconfigure via a serial terminal, wired ethernet (which isn’t always set up right, either), or a USB keyboard But that’s not a great out-of-the-box experience for most customers.

Continue reading “Deploying A Turnkey Raspberry Pi System”