How and why I brought back my own implementation of Google Maps SMS

Imagine a nightmare where you aren’t able to access Google Maps

The year was 2017… I was driving in the countryside of my home state for a job that I had at the time. This job was in the middle of nowhere and the streets that led to my job had very little signs or indication of how to get back to the high way. This place was so far in out that I would have to get off the highway and drive for at least 30 minutes on the normal road after getting off of the highway. Now normally this would have been a disaster, but thankfully we have wonderful services now like Google, Apple, and MapQuest. Until this happens:

The biggest crutch about being in the middle of nowhere is that cell phone providers don’t care to have many satellites surrounding those areas, so you’re often left with no data. When this happened to me I was lost for hours trying to use any context clues that I could on the road to find my way back to civilization.

When I finally made it home that night I scoured the internet for a solution to have the ability to text an address and receive the directions. There were older solutions from the likes of Google and MapQuest, but those did not exist anymore. That’s what led me to create RouteMe.

RouteMe leverages Google Voice, Google Maps API, and a neat way of accessing your emails using Node JS.

Now, of course, there’s always Google Maps offline, but that requires planning ahead. Normally the last thing that I’m thinking about is me losing my data out of nowhere.

How It Works

I have a Raspberry Pi that is always sitting at home that continuously listens to emails that come into my inbox with the help of mail-listener2. Now the issue is that if you don’t have data, you can’t send a message to your email, that’s where our handy dandy Google Voice number comes in. My Google Voice number will forward any email that comes into any email address that I choose, and of course, I choose the email address that my Pi is listening to.

After the Pi receives the email it has a lot of data it needs to parse through to receive the number that sent the text and the message. One thing we don’t want to do is try and parse through every email though, so we listen for a certain keyword… “routeme”.

When it finds this keyword it will extract the words that came before it as the FROM address and then extract the words that came after it as the TO address and then send it to the Google Maps API to get the directions.

The cool thing about the Google Maps API is that it can take a simple name, coordinates, or a full address as it’s from and to locations. Sometimes when you don’t have data and you can’t find any street signs, coordinates may be easier to obtain than an address would be.

Sending The Directions

Now that we have the directions, you may be asking how are we going to send a text message back to the phone without paying a service… Well, the majority of the Cell phone providers in the United States tie your phone number to an email that they use for their service. I use Sprint, so if my number was 585–555–3366, Sprint would transform my number to 5855553366@pm.sprint.com. This makes it easy enough to send an email to my phone number email and when my email reaches Sprint they’ll take care of distributing it to whatever phone number is tied to that email. So using Nodemailer, we’ll sign in to our email address and send the directions out and voila!

We now have the directions on our phone without any data coming to or from our phone!

I have RouteMe running at all times literally because I never know when I will be without data and need it. It’s helped me out a handful of times throughout the two years it’s been running. This circumvents needing to pay for a service like Twilio or the likes and opens up endless possibilities. One thing that I may do is also tie it to google search by having another keyword that can send me back an answer to a question like the Ask Jeeves days :)

The Code

You can find the code with full steps on how to achieve this yourself at: https://github.com/AhadCove/routeme

I Want More

If you aren’t as interested in the Google Maps portion and mainly sending the Text messages I made a video on that previously as well:

Or if you just want to follow me to see what else I’m doing like my latest project where I make an AI Powered Infinity Stone, you can follow me on Twitter and Subscribe to my YouTube channel

As always… “Continue to embrace the SPARK”