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

  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.
    1. Find a step-by-step description at Manage your private and public key.
    2. Submit the public key to our service.
    3. 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: Copy your tenant name and the technical user ID in your cliploard. The Things service will use these, when checking your permissions to read, update or delete a specific Thing entity.
  5. Set up your workspace according to section Set-up your IDE.

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

config.properties
## config.properties ##
 
## Find your values at 'Manage your Solution'
solutionId=918904f5-xxxx-xxxx-xxxx-cb73a5ba9dbf
apiToken=xxxx78615b764186a078d5554baxxxx
namespace=org.example02
 
## The client ID is composed at line 108 DeviceIntegration.java
## clientId=solutionId:connector
 
## Use your credentials from Bosch IoT Permissions
userid=8c36bc60-xxxx-xxxx-xxxx-4ed6ce7ed64c
username=my-eval-user
password=my-eval-xxxx-xxxx
tenantName=87BxxxxxxxxxxxxxxxxB5
 
## Use your company proxy settings
proxyHost=localhost
proxyPort=3128
 
## Use your public and private key generated for this solution
keystoreLocation=things-client.jks
keystoreAlias=things
keystorePassword=xxxxxxxxx
keystoreAliasPassword=xxxxxxxxx
  1. Import the mini-device-integration Maven project to your workspace.
  2. Add resources at scr/main/resources:
    1. config.properties - needs to be added by you.
      This file contains all credentials needed (e.g. solution ID, API token, user, keystore, proxy etc.).
    2. logback.xml - is already provided and can be adjusted if you need another log level.
    3. 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
  3. Run As > Maven clean and Maven install
  4. Run DeviceIntegration.java

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.

The example works still with API 1, thus the access rights are stored as ACL entries within the Thing entity.


thing log

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

Congratulations,
and hopefully you had fun integrating your first Hello World Thing.