[How Is] MyDriving - Azure, Mobile IoT App from Build

Description

Today's project is one you might have seen at Build, another end-to-end with great setup details (including a 147 page pdf to help you get started), all open source...

MyDriving – An Azure IOT and Mobile sample application

Building IoT and Mobile solutions is fun and exciting. This year at //Build, we wanted to show the amazing scenarios that can come together when these two are combined. So we developed a sample application. The MyDriving Azure IoT and Mobile sample application enables you to record trips in your car using the MyDriving mobile application and off the shelf OBD devices. It uses Azure Services in the backend to analyze car telemetry data for both real-time insights like fuel consumption, and long term patterns and trends like driver rating.

To help jumpstart your efforts, we open-sourced all the code, and put out an extensive reference guide and documentation, that we believe will make it easy for you get started on your own projects.

The IoT device in MyDriving

This solution uses On-board diagnostics (OBD) data from your car to analyze your driving. Most modern cars have a standard OBD-II Data Link Connector in the cabin. By plugging in an OBD-II compliant dongle, vehicle data can be made available to other local devices via USB, Bluetooth, or WiFi. Depending on the make, model, and age of your car, you can collect various types of OBD telemetry such as speed, fuel efficiency, and engine RPM.

One of the goals of this exercise was to enable developers to try this solution out on their own with cheap off the shelf OBD devices, hence your Phone itself is used as the Field gateway here and used to send the data collected from the OBD device to the Azure IOT Hub through the MyDriving mobile application. To find the right device for your car, take a look at our getting started article here. ...

Powering the backend with Azure

Within the backend—the heart and soul of MyDriving—we sought to showcase how multiple Azure Services combine into a meaningful whole without the need to write a lot of code or build such services from scratch. We built the backend primarily through the configuration and interconnection of services like IoT Hub, Stream Analytics, SQL databases, HDInsight, Machine Leaning, and App Services, along with external services like Power BI. ...

Mobile Apps for iOS, Android and Universal Windows Platform

While it is possible to develop a native app for each platform individually and deliver a great user experience, the costs of doing so can be prohibitive both in terms of time to market and total cost of ownership across the app’s lifetime. We choose to build the mobile apps part of the solution with our Xamarin platform. ...

Mobile DevOps

While building the MyDriving solution, we utilized a rapid DevOps cycle to build, test and distribute the app. Furthermore, we were able to monitor usage, get crash logs and verbatim feedback from the users, and use that insight to better plan and execute future developmental cycles. We set up builds and testing on Visual Studio Team Services for continuous integration. This means that every code commit in our repository hosted in GitHub, triggered a build for all platforms and runs tests on each. The results of all the this is shown on the project dashboard below. ...

Try out MyDriving

Over $6 trillions dollars will be spent on IoT solutions over the next 4-5 years. The total revenue across all app stores is estimated to reach $100 billion dollars. The opportunity is amazing – but even if you’re not enticed by the business – it’s really fun to play with gadgets!

We want you all to go and try this solution out. We hope you will be pleasantly surprised by how easy it is get started on building your own IoT and Mobile solutions. To recap, here are some resources that will get you started on trying out and building your own solution.

MyDriving

What is the MyDriving IoT sample application?

At Build 2016, we showcased a scalable, performant, highly available, and cross platform IoT service and application. MyDriving uses a wide range of Azure services to process and analyze car telemetry data for both real-time insights and long-term patterns and trends. Play with the app in a sandbox environment or deploy it to your own Azure subscription now.

image

image

Guide

image

Azure-Samples/MyDriving

image

MyDriving - An Azure IOT and Mobile Sample Application

This repository contains the MyDriving sample that demonstrates the design and implementation of a comprehensive Internet of Things (IoT) solution that gathers telemetry from devices, processes that data in the cloud, and applies machine learning to provide an adaptive response. The demonstration logs data about your car trips using both your mobile phone and an On-Board Diagnostics (OBD) adaptor that collects information from your vehicle's control system. The Azure backend uses this data to provide feedback on your driving style in comparison to other users.

Quick Start and Reference Guide

In addition to the readme documentation included in this repository, please see:

Repository contents ...

Building and Deploying the MyDriving Solution to your environment

MyDriving is an Internet of Things (IoT) solution that gathers data from your car, processes it using machine learning, and presents it on your mobile phone. The backend consists of a variety of services provided by Microsoft Azure, and the clients can be Android, iOS or Windows 10 phones.

We created the MyDriving solution to give you a jumpstart in creating your own IoT system. From the repo you can get Azure Resource Manager scripts to deploy the backend architecture into your own Azure account, from which point you can reconfigure the different services, modify the queries to suit your own data, and so on. You can find these scripts along with code for the mobile app, the Azure App Service API project, and more on https://github.com/Azure-Samples/MyDriving.

If you haven't tried the app yet, look at the Get started guide.

What do you have to create?

There's a detailed account of the architecture in the MyDriving Reference Guide. In summary, there are several pieces we set up, and that you would set up to create a similar project:

  • Client app. It runs on Android, iOS and Windows 10 phones. We use the Xamarin platform to share much of the code, which is stored on GitHub under src/MobileApp. The app actually performs two distinct functions:
    • Relay telemetry from the OBD device and from its own location service to the system's cloud backend.
    • User interface that allows users to query about their recorded road trips.
  • Cloud service that ingests the road trip data in real time and processes it. The main work of creating this service is to choose, parameterize and wire up a variety of Azure services. Some of the parts require scripts to filter and process the incoming data. We use an Azure Resource Management (ARM) template to configure all the parts.
  • Mobile service app. This is the web service behind the user interface part of the device app. Its main job is to query the database of stored processed data. Its code is on GitHub under src/MobileAppService.
  • Visual Studio with Xamarin is our development environment. Xamarin - which exists both a component of Visual Studio and as a stand-alone IDE - is used to build the cross-platform device code. To build the iOS code, it's necessary to have an instance of Xamarin running on an OSX machine, though if required it can be run as an agent, managed from Visual Studio.
  • Unit testing of the device apps is performed in Xamarin Test Cloud.
  • GitHub is the repository where we store all the code, scripts and templates.
  • Visual Studio Team Services is a cloud service used to manage the continuous build and test of the web service and device apps.
  • HockeyApp is used to distribute releases of the device code. As well as managing distribution, it collects crash and usage reports and user feedback.
  • Application Insights monitors the mobile web service.

So let's see how we set up all of that. Note that many of the steps are optional.

Sign up for Accounts

...

Estimated operational costs

It's remarkably inexpensive to run an app like this one at small scale. Many of the services have free entry-level tiers, so that development and small-scale operation costs very little. And of course, your own apps don't have to use all the features demonstrated in MyDriving.

Here's a rough estimate of the costs of setting up the development configuration for MyDriving.

We also note some alternatives that we did not use. #

We assume:

  • A team of no more than five (+ observing stakeholders).

  • Running for about a month.

  • 100 users with 4 trips per day.

  • ... [Click through for more]

Looks like a cool weekend project, doesn't it? :)



The Discussion

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.