Using Data from a Mobile Device in Insights Hub - Developer Documentation
Skip to content

Using Data from a Mobile Device in Insights Hub - via MindConnect IoT Extension

Insights Hub allows to import data from mobile devices. This is achieved in two steps:

  1. Use the Cumulocity IoT Sensor App to connect the mobile device to Insights Hub via the MindConnect IoT Extension.
  2. Use Asset Management and Device Management to receive and display data from the mobile device.

General Information

Duration: 30 mins
Tested with Insights Hub version: Release 24th September 2018.
This guide uses a Samsung Galaxy S6 smartphone, but can also be applied for other smartphones or tablets.

Connect a Smartphone to Insights Hub via MindConnect IoT Extension

Overview

The Cumulocity IoT Sensor App is a free smartphone application available for iOS and Android smartphones. It is the successor of the previous Cloud Sensor App.

The app is designed to collect measurements from your smartphone, nearby Bluetooth device sensors, and vehicle On-board Debug (OBD) sensors, and send them to the MindConnect IoT Extension platform. Supported smartphone sensors include:

  • Accelerometer and motion sensor
  • Gyroscope
  • Barometer
  • Magnetometer and compass
  • GPS location
  • Microphone and voice
  • WiFi strength (selected Android devices only)

Prerequisites

  • A smartphone with Android v5.0 or higher / iOS 11.0 or higher.
  • The MindConnect IoT Extension Upgrade - this allows to use the MindConnect IoT Extension. To get the upgrade, ask your tenant admin to contact their assigned Account Executive or Customer Success Manager.
  • A user account is created in MindConnect IoT Extension → "Administration" → "Accounts" → "Users". Refer to Managing users for further information.
  • The following roles must be assigned to your user
    • mdsp:core:TenantAdmin, assigned in Settings
    • mdsp:core:mcie.user or mdsp:core:mcie.admin, assigned in Settings
    • Devicemanagement User, assigned in MindConnect IoT Extension
  • The Cumulocity IoT Sensor App is installed on the smartphone. The application is available for both Android and iOS.

    App Store * The Cumulocity IoT Sensor App is registered either using the QR code or manually. For more information, refer the Cumulocity IoT documentation.

    Connect Smartphone

Sending sensor data to MindConnect IoT Extension

Measurements from your smartphone, OBD devices and connected Bluetooth sensors are sent to MindConnect IoT Extension automatically as soon as the device is connected or started and as long as the app is in foreground. Measurements from the sensors of your smartphone are displayed in the "Measurements" tab within MindConnect IoT Extension.

Measurements Tab

Viewing sensor data

You can find an overview of all sensor data on the main page of the app. Your smartphone’s internal sensors, such as its gyroscope, barometer, location, and magnetic field, are shown in cards at the top of the page. Swipe left and right to inspect them.

MApp Dashboard

Tap a card to show some sensor details, including when the last measurement was last updated.

Managing devices

For information such as connecting, configuring, controlling disabling, removing devices (Bluetooth/OBD), refer the Cumulocity IoT documentation.

Receive and Visualize Smartphone Data in Insights Hub

This section illustrates how to forward the data from the MindConnect IoT Extension to use it in Insights Hub. An asset is created using Asset Management to represent the smartphone in Insights Hub. The incoming data is mapped to the asset using Device Management in the MindConnect IoT Extension.

Create an Asset

Create an Aspect

  1. Open the Asset Manager from the Launchpad.
  2. Go to "Library" and click "Aspect Types".
  3. Click on "Create aspect" to create a new aspect.
  4. Enter the required data, e.g.:
    • Name: "GalaxyS6Properties"
    • Description: "Connect Galaxy S6 to MindConnectIoTExtension"
  5. Add variables for the sensor data provided by the smartphone, e.g.:

    Variable name Data Type Unit
    Acceleration_X INT g
    Acceleration_Y INT g
    Acceleration_Z INT g
    Gyroscope_X INT °/s
    Gyroscope_Y INT °/s
    Gyroscope_Z INT °/s
    MagnenticField_X INT uT
    MagnenticField_Y INT uT
    MagnenticField_Z INT uT
    SignalStrength INT dBm
    Luxometer INT lux
    Barometer INT mBar
  6. Click on "Save".

Create an Asset Type

  1. Go to "Library" and click "Asset Types".
  2. Click on "Create type" to create a new asset type.
  3. Enter the required data, e.g.:
    • Name: "GalaxyS6MCIoTExtension"
    • Description: "Asset type for GalaxyS6"
  4. Add the previously created aspect and click on "Save".

Create an Asset

  1. Go to "Assets" and click on "Create asset" to create a new asset.
  2. Select the previously created asset type and click on “Create”.
  3. Enter the required data, e.g.:
    • Name: "GalaxyS6Asset"
    • Description: "Asset from asset type for GalaxyS6"
  4. Click on "Save"

Now the new asset is ready for asset mapping between data collection in MindConnect IoT Extension and Insights Hub.

Device Mapping in MindConnect IoT Extension

Device mapping is required for linking assets in Insights Hub to the data received from the device registered in MindConnect IoT Extension. This functionality is provided in the Device Management of the MindConnect IoT Extension.

  1. Open the MindConnect IoT Extension from your Launchpad.
  2. Go to "Device Management" and select "Device Mapping".
  3. Select your smartphone from the listed devices.
  4. Select the prepared asset from the listed assets. asset mapping
  5. Add a mapping for aspect to be shown in Insights Hub:

    • Click on "Add Mapping".
    • Select "Source" and "Target" in the new dialog and click on "Add". asset mapping

      Info

      Source: Measurements arriving at MindConnect IoT Extension
      Target: Insights Hub asset

  6. Click on "Commit Changes" and "Apply".

All mappings should be displayed with status "ACTIVE". asset mapping

Verify "Sensor data" in Insights Hub Monitor

  1. Open the Insights Hub Monitor from your Launchpad.
  2. Select the asset for your smartphone.
  3. Click on "Aspects".

The data from your smartphone are visualized in Insights Hub Monitor.

Note

Variables declared as INT are presented as chart, STRING variables are presented in the tabular form.

Configure Rules for Asset in Insights Hub Monitor (optional)

  1. Go to "Rules" and click on "Create".
  2. Select a variable for which you want to define a rule.
  3. Define a condition, on which the event shall be triggered. If required, enable "Hysteresis" and "Debouncing time". The "Debouncing time" sets the minimum duration, for which the defined condition must hold true.
  4. Select the Severity and add a Description for the event.
  5. Enable additional actions, if desired. To receive notifications, enable the "Email" checkbox and enter a valid e-mail address. set additional rules
  6. Enter a name for the rule.
  7. Click on "Save".
Test Event Notification
  1. Create a rule for the luxometer of your smartphone
    • Set the condition to check if the luxometer value larger than 2000.
    • Enable e-mail notifications for this rule and set it to trigger only up to one event per minute.
  2. Place the front or main camera of your smartphone into bright light for more than 1 minute.
  3. Open the Insights Hub Monitor and check the asset values. A warning message is displayed, when the luxometer value exceeds 2000. fleet-manager-warning-message
  4. Open your e-mail client and check your new e-mails. An automatic e-mail should have arrived:

Except where otherwise noted, content on this site is licensed under the Development License Agreement.


Last update: June 15, 2023