Last winter was an especially annoying time of snow in Buffalo. The south towns were especially hit hard. I wanted to build an app that mashed up the real-time location of municipal snow plows and the real-time weather data that is abundantly available to bring us a map of what routes and streets are clear, which haven't been plowed in some time, and those that need another pass.
What it does
An Intel-Edison board connected to an adafruit GPS receiver sends it's latitude and longitude coordinates to an AT&T M2X instance. Imagine that this device is carried on a municipal snow plow.
At the same time, the M2X platform is also receiving device data from a weather api to store real-time precipitation and severity.
To make all this data available to the user, an adapter pulls the latest device data from M2X into a small Firebase store at periodic intervals. The web application accesses the data to dynamically update a Google Map instance showing the real-time snow fall and the affect it has on paths that were cleared by municipal snowplows.
How I built it
First was getting the necessary device data - the GPS coordinated and the localized weather conditions.
The registration and storing of the device data was made easy with the AT&T M2X IoT platform. I didn't need to write any data storage myself which was pretty amazing.
I then wrote a Firebase adapter to pull the latest data out of M2X to make it available for a web application.
A front-end web application was written using the Google Maps API and Google Maps Roads API for the snapping of the GPS waypoints onto actual roads. Logic for handing the colors of the roads was handled by the web application and weather data.
A periodic clock then kept the data on Firebase and the web application in sync to show the most up to date information. All historical data can be seen in M2X.
Challenges I ran into
The Intel-Edison board I had was nearly bricked. Intel only provides flashing scripts through Unix and I had to rewrite some of their scripts to have it work through a Mac OS. A blog post should probably be written on how to fix the boards using a Mac.
Other than that, it was smooth sailing. I wasn't storing data myself so I didn't have to worry about any of that. I was just reading, requesting, and posting data to services that were already available.
Accomplishments that I'm proud of
That Intel-Edison board, first time I used one and it was fun. M2X was easy to get devices and their data into the platform to be used where ever.
What I learned
What's next for Buffalo Snow
Hopefully this project would pique the interests of others who may want to get together to continue building it. It's a neat multi-disciplinary project.
And honestly, the Intel-Edison isn't even necessary - if you have anything that can get GPS coordinates, just send it into M2X and the platform handles everything. No need to write your own device software as you can "normalize" everything in M2X and pull it out from there.
Also, the weather api used super-local weather station devices for it's weather - so incorporating their exact locations and conditions would be pretty neat. I used a more general area for my dynamic mapping.