Pushing the limits of Alexa skills…
This is a killer Alexa skill. This skill could be the catalyst for a million new Alexa devices in a million new locations -- restaurants, coffee shops, hotel rooms, your living room -- basically, anywhere that provides WiFi. It’s that useful.
What it does
The “WiFi Code” Alexa skill connects your device to WiFi by merely listening to special audio played by this skill. (How cool is that?!)
I want to build cool things that lots of people actually use.
What makes WiFi Code special?
- This skill is a unique, original concept for Alexa and in general.
- Works with ANY Alexa device. No need for a screen. Use WiFi Code with a Dot.
- Because the connection is done using audio, you don't need to be near the Alexa device. It can work 10 feet away or more with some ambient noise (this is unlike QR code readers where you need to be right next to the QR code and line it up with your camera)
- A group of people can connect to your WiFi almost instantly at the same time! Think about a group of friends at a restaurant or a family entering a hotel room with ten mobile devices they want to get connected.
- This skill automatically connects a user to a WiFi network without needing to know the SSID or password of the WiFi network. This means that you can easily hide your SSID and use a longer than normal cryptic WiFi password, without worrying about how difficult or inconvenient it would normally be to connect to a hidden network with a long password.
- For public places, like a coffee shop, you could worry-free change your WiFi password periodically, discouraging WiFi leechers from nearby businesses without inconveniencing your customers. Your customers would just go up to an Alexa device and say “Alexa, Open WiFi Code” to connect.
- For guests at your home, you don’t need to drudge up your guest password or help guests connect, just tell them to download the “Chirp Me” app (using their mobile data of course) and say “Alexa, Open WiFi Code” to connect.
- The intro to this skill can easily be branded! For example, “Welcome to Jim’s coffee shop. We have a special on lattes today, and here’s your complementary WiFi [Chiirrrp]”
- Tail-end branding – After connecting the user to WiFi, Alexa could then send another chirp that redirects the user to a web page of special offers
Note: Currently, to ensure that the branding features are not abused, we need to be contacted directly at email@example.com to provide custom branding
Some QR code reader apps have the ability to read WiFi QR codes and connect to WiFi. However, they don’t provide nearly the same convenience, functionality, or coolness that connecting via sound offers. And yet, I added a “bonus feature” to this skill...
…it generates a WiFi QR code every time the skill is used and sends it to the WiFi owner’s Alexa app! The WiFi owner can share the QR code immediately from their Alexa app or take a snapshot and print out. This provides multiple methods of convenience to connect to WiFi.
Here is a feature breakdown by Novelty, Implementation, and Impact:
- Novelty and quality of the idea - This is a highly unique idea for Alexa and in general. The WiFi Code skill significantly shortens the time and improves the way a user connects to a WiFi network.
- Implementation of the idea - The skill is extremely easy to set up and use. A user literally needs to perform one click to open a mobile app and then say “Alexa, open WiFi Code” to an Alexa device to connect to WiFi.
- Potential impact of the idea - The impact of this idea is huge, everyone needs access to WiFi. The beginning and ending audio of this skill is highly customizable and can be branded. Another incredibly powerful idea is that additional “post-connection” chirps can be played to redirect a user to a contextual web page (e.g. a special offers page).
How it works
One-time setup: The WiFi owner enters their WiFi SSID and password on the WiFi Code skill Account Linking page. A special audio file encoded with their WiFi credentials is automatically created and stored on Amazon S3.
One-time download: The WiFi user downloads the “Chirp Me” mobile listener app that listens for the special audio to play. No secret listening is done…the app must be opened for it to be in listening mode. (Chirp Me can be found on the Google Play and Amazon app stores.)
The user opens the Chirp Me app and says “Alexa, open Wifi Code”. The WiFi audio file is played. The user is then automatically connected to the WiFi network associated with the audio file.
SHOUT OUT: Big kudos and thanks to the Chirp company who provided the Rest API and SDK to generate and listen to Chirp files. They modified their API specifically so that this project could work. Please check them out at https://www.chirp.io.
How I built it
- WiFi Code is an Alexa custom skill developed using C#
- AWS EC2 Windows VM is used to host the skill
- AWS RDS MySQL is used for persisting session state and profile information
- AWS S3 is used for hosting the skill audio files
- The skill leverages a .NET platform I developed called Bitzki Conversation Server which abstracts the ASK custom skills JSON protocol and automagically handles session state and profile persistence. Bitzki uses Owin Katana as the basis for an internal web server, and techniques such as multi-threading, parallel programming, asynchronous tasks, and object pooling to improve performance. MAF is used to create bot plugin scripts (like the “WiFi Code” skill) that get dynamically compiled, so new features and bug fixes can be implemented rapidly.
- Chirp.io Rest API is used to generate the Chirp audio files. The Chirp SDK was used in the Chirp Me mobile app to listen to and decode Chirp audio when it’s played. Kudos again to Chirp.io!
- The chirp audio files are stored on S3. These files contain the SSID and password of a WiFi network encoded within them. The Alexa platform does not currently accommodate audio files with sensitive information, so this skills should only be used for public WiFi. This is specified in our terms of service, as well as when the skill is account linked. Note that the audio files use highly obfuscated urls that should never be found, but that’s not nearly enough for truly sensitive information.
- The chirp could be recorded by others and decoded with the proper tools. Again, this skill should be used for “public” WiFi. Also when it is capable of being used for private WiFi, the Alexa device should not be publicly available in those cases.
- The WiFi Code skill plays a sound that might be annoying to some people. One simple solution is that you can turn down the Alexa volume and move your phone closer to the Alexa device. That will minimize any residual “discomfort” to bystanders near Alexa. Also, we are currently investigating using ultrasonic non-audible "chirps" that may be embedded in “pleasant” and “meaningful” audio, such as music and talking. We currently use an audible “chirp” since it appears to be the most robust technology for Alexa to play and be heard correctly from a distance by a listening device.
- Due to the way Android works, if you’re already connected to a WiFi network, Android attempts to connect to it first. In those cases, the Chirped WiFi network will be added to your list of networks, but the Chirp Me user will need to click on the Chirped WiFi network directly to connect to it.
- A long SSID and longer password means a longer chirp that takes longer to play.
Challenges I ran into
Where do I begin? :D. Here’s just a few…
- The easiest way to play the Chirp audio file would have been to use the ASK SSML audio tag. That was wishful thinking. The SSML audio tag requires a lower quality mp3 file. Unfortunately, that format removes frequencies in the file, which corrupted the Chirp data. So, I needed to use the Audio Player to play higher quality mp3 files. The Alexa Audio Player requirement was not only overkill, but it also executes outside of the custom skill’s session, which had its own challenges.
- There were crucial updates that needed to be made to the Chirp API for this to work. Chirp came through with flying colors!
- Creating a “low-friction” method to onboard users, while providing a robust, basic level of authentication. Instead of registering users with a user id and password, users are required to click an activation link sent to their email.
Accomplishments that I'm proud of
- Getting this to work. There were many moving parts.
- Publishing mobile apps in the Amazon and Play app stores. This is the first time I published mobile apps to any mobile app store.
What I learned
- The Chirp Rest API and SDK
- The API to upload files to S3
- Actually, I relearned this: things never go as planned
What's next for the WiFi Code skill?
- We currently only support Android devices (including Amazon devices) and are investigating iOS, Mac, and Windows apps
- Currently investigating the best way to integrate this skill with "Alexa for Business"
- Investigate usage of the ultrasonic chirp API, to embed data in 100% “ear-friendly” audio