Bosch XDK Sensors

Sample application for the Bosch XDK device that shows raw numeric sensor data in real time. The data is gathered by the XDK device and transferred over Bluetooth Low Energy to the application running on the smartphone. The app displays the data in a simple numeric table.

The following three screenshots show how the app looks like initially, when it's connected, and when it's started showing sensor data.

Source code

You can browse the source code for this example at github.

The file index.html contains the HTML markup of the app and the app.js contains the logic.

What you need

This example runs in the Evothings Viewer on Android or iOS.

Yoyu need an iOS device or an Android device with support for Bluetooth 4.0 (which includes BLE). For Android version 4.3 or later is needed.

Obviously you need an XDK device from a retail distributor.

In order to be able to build and flash the device with the device side code, you also need to download and install the XDK Workbench 1.6.0 which is available for Windows 7 and later (not Linux or OSX).

How to get up and running

Bosch has made available several guides on how to install and get started with the Eclipse based XDK Workbench. However, below you find the specific steps you need to just get the firmware built and flashed:

  • Download and install the XDK Workbench. It needs to be version 1.6.0 or possibly newer. It's an easy installer. Then follow guide below to build and flash the firmware.
  • Run Evothings Studio on your computer and connect your Evothings Viewer on your phone to it.
  • Press Run on the Bosch XDK Sensors example in the Studio, either directly from the Examples tab or from your own copy under myApps.
  • Make sure the XDK is on and has power with the green light on (and you flashed it as described below).
  • Press Connect in the mobile app, and then eventually press Start after it has connected. You should be seeing numbers shown in the table as the screenshots show above.

Build and flash firmware

  1. Use the Copy button on the Bosch Sensors example in the Examples tab in Evothings Studio, to get your own copy of the code.

  2. Fire up the XDK IDE and connect the XDK device using a USB cord. Turn it on. Hopefully it will be discovered (I failed first due to a faulty cord) and then you will get the green icon and the "Flash" and "Boot" buttons appear, something like this:

  3. Then you select "New Project" from the IDE, and then under "C/C++", pick "Makefile Project with Existing Code":

  4. Find the xdk-firmware directory and import the code.

  5. Now you should be able to build and flash your XDK device, either using the "Flash" button or by first building, producing a .bin file under the debug directory, and then flashing that file. Log should show something similar to this:

  6. Success!