mini-device integration

In the course of this tutorial part you will create a thing and learn to appreciate the Java integration view on this little thing.

Estimated time to go through: 10 minutes

A. Recap the perparatory steps

  1. Register for a Free service account How to book the service?
  2. Click Dashboard to get directed to the user interface Manage your solution
  3. Prepare a Keystore and a Truststore for your solution.
    In order to comply with high security standards a private/public-key based challenge-response mechanism is used.
    • Find a step-by-step description at Manage your private and public key.
    • Submit the public key to our service.
    • The file things-client.jks holds also the private key. This one, you will need to add it to your things-client application
  4. Sign up for a free user account at Register a user.
    Tip: The Things service will use the technical user ID in your thing’s policy.
  5. Set up your workspace according to section Set-up your IDE.

Cheatsheet config properties

This is an example on how your config properties file could look like.

## ##
## Find your value at the 'credentials' section after booking
# for an instance on BIC this would be 
# endpoint_ws=wss://

## Find your values at 'Manage your Solution'

## The client ID is composed at line 112
## clientId=solutionId:connector

## Use your credentials from Bosch IoT Permissions

## Use your company proxy settings

## Use your OAuth-client generated for this solution

## Use your public and private key generated for this solution
### Deprecated

B. Java API - Create your first Thing

  1. Clone the GitHub repository
  2. Import the mini-device-integration Maven project to your workspace.
  3. Add resources at scr/main/resources:
    • - needs to be added by you.
      This file contains all credentials needed (e.g. solution ID, API token, user, keystore, proxy etc.).
    • logback.xml - is already provided and can be adjusted if you need another log level.
    • things-client.jks - needs to be added by you.
      This is the public/private key pair.
      Your project would now look like in the following screenshot
      project structure
  4. Run Maven clean and install mvn clean install
  5. Execute the new jar from the target mvn exec:java.
    Additionally to the thing, its policy, with the same name, will be created.

C. Check your work

The Thing ID will be logged out at the console after the first run.
In order to avoid ambiguity, our service will prevent you from creating 2 Things with the completely same ID. Thus in each run you will create a new thing.

thing log

In Things notation this would look like in the following snippet

 "thingId": "<your.namespace>:<your-device-name>",
 "policyId": "<your.namespace>:<your-device-name>",
 "features": {
  "counter": {
    "properties": {
      "value": 42

tip The user who’s credentials were configured in will have permission to read, write and administrate the thing with the given ID.
Find details in the next tutorial section mini-webui.

and hopefully you had fun integrating your first thing.

Imprint Legal info Privacy statement