Easy Access Point Configuration On ESP8266

One of the biggest advantages of using the ESP8266 in your projects is how easy it is to get WiFi up and running. Just plug in the WiFi library, put the SSID and encryption key in your source code, and away you go. It authenticates with your network in seconds and you can get on with building your project. But things get a little trickier if you want to take your project someplace else, or distribute your source code to others. Quickly we learn the downside of using static variables for authentication.

While there are already a few solutions to this problem out there, [Martin Raynsford] wasn’t too thrilled with them. Usually they put the ESP8266 in Access Point mode, allow the user to connect, and then ask which network they should authenticate with. But he didn’t want his projects to require an existing network, and figured he could do just as well making a field-configurable AP.

Using it is simple. Once the ESP8266 starts up it will create a new network in the form of “APConfig XXXXXX”, which should be easy enough to find from your client side device. Once connected, you can go to a simple administration page which allows you to configure a new AP name and encryption key. You even have the option to create an open AP by leaving the “Password” field blank. Once rebooted, the ESP8266 will create a new network with the defined parameters.

[Martin] has also included a “backdoor” to let anyone with physical access to the ESP8266 board create a new open AP that can be used to reconfigure the network settings. During boot up there is a brief period, indicated with specific blinks of the LED, wherein you can hit the reset button and trigger the open AP. This keeps you from getting locked out of your own project if you forget what key you gave it.

If you’re not one to go the austere route, take a look at some of the more robust solutions we’ve seen for easier end-user setup of the ESP8266.

Easier End-User Setup For ESP32 Projects

As hackers, we occasionally forget that not everyone is enamored with the same nerdy minutia that we are. Configuring hardware by changing some lines in the code and compiling a new firmware doesn’t sound like that big of a deal to those of us who’ve been around the block a few times, but might as well be ancient Sanskrit to the average person. As long as your projects are for personal use this isn’t really a concern, but what if you plan on distributing the code for a project or perhaps even selling finished products? Shipping it out with hard-coded variables simply isn’t an option.

Code for loading configuration file from SPIFFS

In a recent video, [Proto G] shows a clever way to use WiFiManager to make configuring your ESP32 project easier for end-users. Not only can you use the captive portal system to configure the ESP32’s WiFi against a nearby access point, but it can allow users to enter in configuration data which can be picked up in your code by using SPI Flash File System (SPIFSS).

With the setup demonstrated in the video below by [Proto G], you don’t need anything more exotic than a web browser to configure the device. The end user simply searches for the device’s WiFi network, connects to it, and is presented with an easy to understand dialog which has them select a WiFi network to configure against along with some fields to enter in custom variables. All this information is then stored to a file on the SPI flash. When the ESP32 reboots, it reads the configuration from the saved file and applies the requested settings.

This is very similar to how many consumer devices are now configured, and even the less technically-inclined recipients of such a device should be able to work through the setup with a bit of hand-holding. If you plan on handing one of your ESP32 projects to John Q. Public, this is the kind of configuration you should be aiming for.

We’ve covered using WiFiManager to make ESP32 projects easier to manage, but the addition of arbitrary variables to the captive portal opens up a lot of possibilities. Just the kind of thing you need when you start considering the leap to commercial product.

Continue reading “Easier End-User Setup For ESP32 Projects”

FPGA Metastability Solutions

Gisselquist Technology recently posted a good blog article about metastability and common solutions. If you are trying to learn FPGAs, you’ll want to read it. If you know a lot about FPGAs already, you might still pick up some interesting tidbits in the post.

Don’t let the word metastability scare you. It is just a fancy way of saying that a flip flop can go crazy if the inputs are not stable for a certain amount of time before the clock edge and remain stable for a certain amount of time after the clock edge. These times are the setup and hold times, respectively.

Normally, your design tool will warn you about possible problems if you are using a single clock. However, any time your design generates a signal with one clock and then uses it somewhere with another clock, metastability is a possible problem. Even if you only have one clock, any inputs from the outside world that don’t reference your clock — or, perhaps, any clock at all — introduce the possibility of metastability. Continue reading “FPGA Metastability Solutions”

Setup Day At The Faire Is A Glorious Time!

The Bay Area Maker Faire starts today, but the Hackaday crew rolled in early for something new this year. Friday has traditionally been just for exhibitor setup but this year a few extra groups were on site to see everything come together. Most notably, school field trips. How awesome is it to skip the normal class schedule and hang out at the fair? Also able to get in are media and industry.

I had a great time. Watching everything get setup is often more interesting that seeing the finished display. It’s also much quieter, many fewer bodies (Saturday afternoon is usually a mad press of people) and people haven’t yet lost their voices or the fallen into the monotony of voicing the same explanation over and over again.

Above you can see a few of the friends I ran into. [Windell Oskay] is one of the 2015 Hackaday Prize Judges. He had a freshly minted copy of his new book which I first heard about when visiting Evil Mad Scientist Labs last fall. I also ran into [Kevin] who is the creator of the Arduboy. I first met him at BAMF last year and this year he makes a triumphant return with the new version of Arduboy which overshot it’s Kickstarter by an order of magnitude in just a few days. And who else should I bump into but [Brian Benchoff]. He lives in Pennsylvania and I in Wisconsin so we look forward to hanging out when Hackaday hits the road. I also said a quick hello to [Caleb Kraft] who was slinging veggie paella all evening.

[Brian], [Sophi], [Matt], [Jasmine], [Rich], and I will all be at tonight’s Hackaday Meetup. Anyone in the area won’t want to miss this one. There are a ton of awesome hackers already planning to clink glasses starting at 7pm. All you need to do to join in is RSVP.

Back to the action; I made a quick Friday first pass which still took about three hours. The setup changes just a bit each year… generally things are in the same places but of course returning exhibitors have made a year of upgrades and there’s always a lot of fresh and new on hand. I don’t remember seeing the probability machine last year. It has reservoir of marbles at the top which are being steadily dropped into the “Plinko” style peg-board showing a distribution which has a higher probability toward the center.

Here are just a few more favorites. The Kijani Grows booth has a couple of full aquaponics setups that are worth checking out. I spent some time with the Firepick Delta guys. Sand plotters are always fun and there’s a giant one in one of the booths. I may try my hand at lock picking in The OPen Organization of Lockpickers tent today. And [Louis] of SmartMatrix is launching his Kickstarter to bring fully-assembled versions to people who don’t want to solder the one available in our store.

That’s all for now, I’m off to see as much as is humanly possible. If you’re at the Faire today or tomorrow track us down for some stickers and other swag, and don’t forget tonight’s meetup that I mentioned above!