On the weekend of July 15th, AT&T held their immersive tech expo, Shape, providing a rich experience filled with fun inspiring inventions and notable speakers discussing the future of tech. It was held at historic AT&T Park and drew thousands to see the future of VR, IOT, and more. AT&T also demonstrated their exciting new technologies such as AT&T Drive, a set of smart controls for your car, AT&T Digital Life, a way to control your home from your smart device, and AT&T M2X, their state of the art data management system for IOT.
Co-located at Shape, AT&T held a hackathon aimed at building solutions using their APIs, as well as the technology of other sponsors. I attended with some friends of mine – Michael Berber and Andy Khan, who specialize in web development, and Bernice Chua, who handled the hardware side of our project. We were all excited to meet the AT&T staff and find out how powerful their APIs could be! We met some others on site, including designers and a front end developer, formed a team, and entered the competition with the goal of producing a solution related to public safety. The competition had tough standards; after being judged on criteria such as completeness of the app, originality, and difficulty, entries would be subject to a rigorous code review. Apps which used hardcoded data, or could not work on multiple hardware sets, would be disqualified. At the end of the event, we were excited to bring home 1st place for our efforts! Read on for details and the code for our solution that helps alert the authorities in case of an emergency.
The venue
The team poses for a picture
Coffee and code
The Problem
A major component of personal safety is having quick access to police and medical services during an emergency, so we wanted to envision a way to alert emergency services with as little effort from a user as possible. Our goal was to use IBM Watson and a Qualcomm DragonBoard to passively listen to what people are saying and auto-detect certain keywords such as “help” and “fire”. If the keywords were detected, we would alert emergency services using the AT&T Digital Life API. We also used AT&T’s M2X IOT platform to keep track of application data.
Our app’s logo
The M2X and DigitalLife services have vastly different APIs with many different endpoints, so scriptr.io was instrumental in simplifying the process and creating a service oriented architecture that served as the backbone for Lifeline. As a first-time user of scriptr.io, I was really excited with how easily I was able to dive in and deploy functional code. Here’s some of how it all worked:
M2X Component
M2X is AT&T’s backend solution for IOT products in which devices are treated as first-class citizens and can produce data to their own data streams which can be later be queried and visualized. Our project had two data needs: we needed to store keywords based on user input, and we needed to track how many times keywords had been said. Doing the former was simple; With a few clicks I was able to create a device and connect it to a data stream that would keep track of keywords.
Keeping track of how many times they were said was a little more complicated. I created a separate M2X device, and made a scriptr.io script that would search the transcribed audio and count how many times each keyword was said, as well as when it was said.
Finally, I wrote a scriptr.io script that would check with M2X to see if the word was said more than three times in the past two minutes, and sound the alarm if it was. Click here to see all the code!
Hard at work
Digital Life Component
Once the alarm was raised, we used the Digital Life APIs to contact emergency services, using a scriptr.io script that would alert different emergency services based on the situation. Thanks to Digital Life’s emphasis on home security, we had a lot of tools to work with to enhance safety during an emergency.
If it was calling the police, it would just alert them. If it was fire or medical services, the script would unlock all the doors as well as activating an alarm so that people evacuating would be able to get out quicker, and the emergency services could gain entry to the house. You can see the code here.
Results
The judges liked our app, and we ended up winning first place in the AT&T Digital Life category! scriptr.io was essential in allowing me to consolidate the different features of the AT&T APIs. Each action our app took required multiple calls to different endpoints and APIs, so scriptr.io allowed me to bind together different services with just a few endpoints. It was especially helpful for accessing M2X. Instead of having to deploy a server to run middleware for interacting with M2X, I was able to create deployed endpoints with all the necessary logic for our app almost instantly. In addition, the integrated IDE allowed me to debug the code in real-time and quickly iterate on our solution. The best part is that as soon as I finished writing the code, I was done, whereas normally finishing the code would mean I still had at least a few hours ahead of me in order to get it deployed. Overall, Shape was a great experience, and scriptr.io made it easy to get a working prototype up and running quickly.