Location-based alert/alarm/notification systems are great, since they're perfect for planning around future events where you cannot be sure exactly when they will occur. These events can include situations where you want to remind yourself to pick up some groceries on the way home after work, to fill up your car's tank with gasoline on your way out of town, or to make sure you get off at your bus stop after it's been caught in rush-hour traffic. Time can't be relied upon as much in these cases in comparison to location.
A smart car seemed like the perfect candidate for such a system to be used with, especially since one of the biggest drawbacks to location-based alert systems is the battery drain they can cause to devices.
What it does
Users input alert locations as either degree coordinates or addresses that gets processed by Google Maps (e.g. "United State Postal Service, Montrose, CO"; "1001 Railroad Ave, Rifle, CO 81650"; "Trader Joe's, 750 Colorado Boulevard, Denver, CO", or "81073")
They specify alert radii (in miles) and alert messages for these locations as well. The messages will be sent to their phone if they enter the circles specified by these radii.
Finally they specify whether they want these messages to be delivered via SMS or voice call. Both options give the user the choice of either acknowledging the alerts or putting them off for later. If they acknowledge a message, the location gets removed from the alert system. Otherwise, delaying the alert will make it so that it will only trigger after the user has left the circle and reentered it.
How I built it
Python 3 and Flask, with a lot of help from the SmartCar Python SDK, Google Maps APIs, Twilio API, and ngrok
Challenges I ran into
There's no way to actually draw a circle when working with Static Google Maps. You have to create a polyline and set coordinates along the circumference of the circle manually. Debugging my code for that section turned out to be a lot more trouble than expected.
Figuring out how to properly implement interactive SMS and keypad responses with the Twilio API was also a challenge. Spent most of the night on that.
Accomplishments that I'm proud of
Drawing a circle.
Getting SMS user responses and voice call keypad responses working.
What I learned
The Twilio API is very powerful. I feel like I haven't even scratched the surface of what it's capable of yet.
What's next for DriveBy
Finding a way to resolve overlapping circles or multiple vehicles without having to purchase more phone numbers.