In this tutorial we will provide you with a step by step guide to enable pushing and plotting data from Wearable Sensor System (Shimmer)
- Android device
- Shimmer sensor device (http://www.shimmersensing.com/)
- Eclipse IDE
- We assume you have already been granted an account on Labeeb IoT platform
Step by step Guide
Step 1: Configure your device and related device and date models on Labeeb IoT platform
First you have to define a Data Type for your sensor: navigate to "Data Type" sub-menu under "Platform Management" and click on + to add all the needed Data types as shown below.
First, you have to create a Data Model for your sensor: navigate to "Data Models" sub-menu under "Platform Management" and click on + to add all the needed Data Models as shown below.
Second, attach the data types to your Data Model, then set the accuracy profile. For example, if you set the accuracy level to 90, the time period to 1 second and the action Mark Data Model as Malfunctioning then the received data belonging to this Data Model should pass all the filters for 90% of the packets over a period of 1 second. Otherwise, the Data Model will be marked as Malfunctioning.
Finally, click on "Save" to make sure your new data model is created.
Finally, click on "Save" to make sure your new device template is created.
Now, once the new device template has been created with data model, you just need to create a new device: navigate to "Device" menu and click on + to add the new device as shown below:
Finally, click on "Save" to make sure your new device is created. Now your new device is now successfully created and listed in my list of devices.
You will have to use the generated MQTT topic and the login password you have set when creating the Device Template in order to push data from this device over MQTT.
You can check the device status and the data statistics under "My Account" menu as shown below:
Step 2: Create and configure a new Android Application
- ShimmerDriver project (to be added as a library)
- The Labeeb IoT Java SDK (JAR file) should be copied to a local folder
- Under Eclipse, create a new Android application Project and click on Next, as shown below:
- Define a project name, named "LabeebIoTShimmer", and click on Finish, as shown below:
- Once the project is created, right click --> Properties –> Java Build --> Libraries, click on "Add External Jars", locate the Labeeb IoT SDK JAR file (labeeb-iot-sdk-jar-with-dependencies.jar), and click on Open.
- Select project : right click --> Properties –> Android --> add Libraries, click on "Add", locate the ShimmerAndroidInstrumentDriver and click on OK.
- You must define a shimmer object and explicitly define sensor to be used like : SENSOR_ACCEL for Accelerometer and SENSOR_GYRO for Gyrometer
- You must also define a handler object to to enable sensor data management