Movesense 2.0 and Android
Test Movesense using the showcase app
There is a Showcase app at https://bitbucket.org/movesense/movesense-mobile-lib/downloads/ Links to an external site. (not yet available at Google Play). Download the latest .apk file to your Android device, then open the file in the Files app on the device to install it.
In the showcase app you can test your Movesense, e.g. display IMU data in graphs or update the sensor with new profiles and firmware (DFU files).
DFU files
The firmware for different Bluetooth profiles on the sensor is packaged into DFU files. Install (instructions below) Movesense-gatt_sensordata_app_w_bootloader.zip Download Movesense-gatt_sensordata_app_w_bootloader.zip. This DFU contains both the new firmware and the sensor data profile (do not unzip the file).
If you want to try other DFU:s, look at https://bitbucket.org/suunto/movesense-device-lib/src/master/samples/bin/release/ Links to an external site..
Upload and install a DFU
- Upload the DFU file (zip-format) to the Android device. You can connect to your computer via USB, or you could upload the file from your computer to Google Drive, and then download the file via the Google Drive app on the Android device, https://support.google.com/drive/answer/2424368 Links to an external site..
- Open the Showcase app and install the DFU file following these instructions, starting from “Using Showcase app for DFU upgrade”, http://www.movesense.com/docs/esw/dfu_update/ Links to an external site.
Problems when updating DFU
If you have problems when downloading a DFU to your Movesense device, try the instructions at http://www.movesense.com/docs/esw/dfu_update/ Links to an external site., under DFU Recovery Mode.
Code examples of BLE communication, Android – Movesense 2.0
This project demonstrates how to scan for Movesense devices, connect to a device, and then subscribe for data from a sensor (i.e. enable notifications): https://gits-15.sys.kth.se/anderslm/Ble-Gatt-Movesense-2.0. In this example, only accelerometer data is read, at 13 Hz (/Meas/Acc/13). You have to figure out how to subscribe to, parse, and interpret, the data relevant in assignment 3, part B.
How to use an Android Service and a BroadcastReceiver to get BLE data, possibly in the background, https://gits-15.sys.kth.se/anderslm/Ble-Gatt-with-Service. This example is not specific to Movesense.
Pull data files from an Android device
In assignment 3, part A, data should be written to an internal file when lifting the arm. You can pull the file from the device in Android Studio, refer to https://developer.android.com/studio/debug/device-file-explorer Links to an external site. Links to an external site..
If you write data to the internal application storage (using openFileOutput, with mode private), you will find the file in the directory data/data/your_applications_packagename/files.
In a real-world application though, the file would be uploaded to a dedicated server, or data continuously streamed to the server.