IBM IoT for Automotive (Bluemix) - Fleet Management Starter Application
This repository is no longer supported because of the withdrawal of IBM Watson IoT for Automotive Experimental Bluemix service.
For more Information, see this page.
You can use the Fleet Management Starter Application together with an instance of the IBM IoT for Automotive SaaS offering on IBM SoftLayer. See IBM for Automotive (SaaS) - Fleet Management Starter Application.
The IBM IoT for Automotive - Fleet Management Starter Application demonstrates how quickly you can build an app on IBM Bluemix to manage and monitor a fleet of vehicles in real time.
The Fleet Management Starter Application uses services in IBM Bluemix to provide a sample solution for fleet operation management and personnel. By using the application, you can easily track and view the following information:
- Availability of a fleet of cars on a map
- Location of vehicles
- Overall health of the entire fleet
- Health diagnostics and conditions of a specific vehicle in the fleet
- Condition of vehicles by order of severity or risk
- Event history for the entire fleet
- Event history for a specific vehicle in the fleet
The Fleet Management Starter Application uses the following services that are available on IBM Bluemix:
You can also use the Fleet Management Starter Application together with an instance of the IBM IoT for Automotive SaaS offering on IBM SoftLayer. For more information, see IBM for Automotive (SaaS) - Fleet Management Starter Application.
Deploying the app on Bluemix
You can automatically deploy an instance of the Fleet Management Starter Application on Bluemix by clicking . You can also deploy the app manually. Note that you have to do the service activation step mentioned below after the automatic or manual deployment.
To manually deploy your own instance of the Fleet Management Starter Application on Bluemix, complete all of the following steps:
- Register an account on Bluemix or use an existing valid account.
- Download and install the Cloud-foundry CLI tool.
- Clone the Fleet Management Starter Application to your local environment by using the following console command:
git clone https://github.com/ibm-watson-iot/iota-starter-server-fm.git
- Change to the directory that you created.
- Edit the
manifest.ymlfile and change the values of
<host>to something unique.
applications: : host: iota-starter-server-fleetmanagement name: iota-starter-server-fleetmanagement memory: 512M path: . instances: 1 :
The host value is used to generate your application URL, which is in the following syntax:
- Install the NPM package by using the following command. The installer observes the dependencies that are specified in your
$ cd ./webclient $ npm install
$ npm run tsc $ npm run gulp $ cd ..
- By using the command line tool, connect to Bluemix and log in when prompted:
$ cf api https://api.ng.bluemix.net $ cf login
- Create an instance of the IBM IoT for Automotive service in Bluemix:
$ cf create-service iotforautomotive free_shared FleetIoTForAuto
- Create an instance of the Cloudant NoSQL DB service in Bluemix:
$ cf create-service cloudantNoSQLDB Lite FleetCloudantDB
- Push the starter app to Bluemix by using the following command. Because you will need to perform more steps when the app is deployed, you must add the option
--no-startwhen you run the
$ cf push --no-start
Your very own instance of the IBM IoT for Automotive - Fleet Management Starter Application is now deployed on Bluemix.
Activating the Bluemix services
Before you can use the IBM IoT for Automotive - Fleet Management Starter Application, you need to do the following tasks:
If the app is already running on Bluemix, stop the app.
Open the Bluemix dashboard in your browser.
Open the IBM IoT for Automotive service and then wait for a few seconds until the user credentials display.
To secure the app, authentication is enabled by default for the IoT for Automotive - Fleet Management Starter Application. The default user credentials are as follows:
To change the user name or password that is used by the app, edit the values that are specified for the
To remove authentication, set both the
APP_PASSWORDenvironment variables to 'none'.
- To start the Fleet Management Starter Application, open the Bluemix dashboard and start the app.
Congratulations! You are now ready to use your own instance of the IBM IoT for Automotive - Fleet Management Starter Application. Open
http://<host>.mybluemix.net in your browser.
(Optional) Connecting to an OBDII dongle plugged in to your car
The starter app provides a mobile app to connect to an OBDII dongle plugged in to your car. The mobile app sends data from an OBDII dongle to the Fleet Management Starter Application via IoT Platform service and you can see the data in the app. Follow the steps below to enable this optional feature.
Bind the IoT Platform service to the app
Open the Bluemix dashboard in your browser.
Open the IBM IoT for Automotive service.
Select Connections tab at the left navigation bar.
Click Connect New
Select Internet of Things Platform service and click Create to bind the service
Create a device type for your device
When you start a mobile app for the first time, your device is registered to the IoT Platform service automatically with a device type OBDII. The device type needs to be prepared beforehand.
Launch the IoT Platform dashboard on Bluemix.
Open Device page
Open Device Types tab at top of the page
Click +Create Type
Click Create device type
Input 'OBDII' in Name field
Leave the other fields as default and click Next at the bottom right until a device type is created.
Set up the OBDII Fleet Management App
Refer IBM IoT for Automotive - OBDII Fleet Management App for Android to build and install a mobile app to your Android phone. Once you get ready to use it, start the mobile app on your phone.
Connect the device to the IoT for Automotive service
When you start the mobile app for the first time, a device is registered automatically to the IoT Platform service that you have specified in the mobile app, and corresponding vehicle is created automatically when you connect your device to the IoT Platform. Now, your device is connected to the Fleet Management Starter Application. Go to Map or Car Status page in the app and see the status.
If you no longer need a device, go to IoT Platform dashboard and delete your device manually. Then, after you delete it, update vehicles in the IBM IoT for Automotive service as follows.
Open the Fleet Management Starter Application on your browser.
Select Vehicle tab at the left navigation bar.
Click Sync with IoT Platform at top right of the page.
A vehicle corresponding to deleted device must be removed from a table. Also, if you have added new device to IoT Platform manually, new vehicle is added to the table.
To report a defect with the IoT for Automotive - Mobility Starter Application mobile app, go to the Issues section section.
To debug problems, check the Bluemix app logs. To view the logs, run the following command from the Cloud Foundry CLI:
$ cf logs <application-name> --recent
For more information about how to troubleshoot your application, see the Troubleshooting section in the Bluemix documentation.
The IoT for Automotive - Fleet Management Starter Application includes code to track deployments to IBM Bluemix and other Cloud Foundry platforms.
For each instance that you deploy, the following information is sent to a Deployment Tracker service:
- Application name (
- Space ID (
- Application version (
- Application URIs (
- Labels of bound services
- Number of instances for each bound service
The tracked data is collected from the
VCAP_SERVICES environment variables in IBM Bluemix and other Cloud Foundry platforms. We use the data to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples so that we can continuously improve the content that we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service are tracked.
Disabling deployment tracking
You can disable the Deployment Tracker service by removing
require("cf-deployment-tracker-client").track(); from the beginning of the
app.js server file.
Questions, comments or suggestions
For your questions, comments or suggestions to us, visit [Watson IoT for Automotive Application community site] (https://www.ibm.com/developerworks/community/groups/service/html/communitystart?communityUuid=3b06ca1c-fd7c-4a59-a888-e5e3a8384091).