Octopus device control

The Octopus device will use the telemetry and command and control pattern.

About

The Demo UI shows how an authenticated user is given access to read and set data on an Octopus device.

Prepare the Octopus

You will need to have an Octopus device registered at our Bosch IoT Suite services.

The complete step-by-step guide on how to connect an Octopus device to Bosch IoT Hub and Bosch IoT Things is provided at https://github.com/bosch-io/iot-things-examples/tree/master/octopus-bidirectional.

Authentication

The example UI supports authentication with a JWT - token issued by Bosch IoT Suite authorization component - as well as with username and password of a Bosch IoT Permission user - Basic Auth.

Suite Auth token

octo-demo-login

This type of authentication works for example for all customers of the Bosch IoT Suite for Asset Communication package.
Find details at Create a Suite Auth client.

Basic Auth

In case you prefer Basic Auth please log in with your tenantname, username and password.

The application provides only two fields for authentication. Therefore, you will need to set the tenant name in the same field as the username separated by a backslash: E.g. YourTenantName\YourUserName .

Login

Read Octopus data

As soon as your authentication was successful, the Things service will check the authorization on any Thing entities.

You will see the Octopus data.

As soon as you have managed to run the preparing Java programm the initial revision should be visible.

Octo-ui-login-first-revision

In case your Octopus device is sending data you should see all changes, as by default the server sent events - short SSE - are active in the demo UI.

Click the left entry to see the details.

Octo-ui-revision 2 and
greater

Set Octopus data

Use the last UI section to toggle the LED on or off, or even set a specific color.

Send message

Your message is sent via the Things API and via Hub and to the device.

The response will be visible on the device’s LED.

Troubleshooting

Login problems

Re-check the user credentials which you have configured for the device registration.

In your project it should be located at

iot-things-examples-master\octopus-bidirectional\src\main\resources\application.properties

No device visible

In case the demo user was authenticated successfully but you see no device, re-check the results of the Java program for the Thing ID, etc.

  • Try to read the thing with the given ID via a plain GET ​/things request
  • Try to read the policy with the given ID via a plain GET ​/policies​/{policyId} request

    The user should be empowered to read the thing/ resource
    The subject integration:your-things-solution-id:octopus should be empowered to read and write the thing/

  • In case these entities have been created, re-check the connection and make sure the authorization subject is set.
    Both Sources sections should have the entry
    integration:your-things-solution-id:octopus

Network

In case of a network error message please re-check the policy and the connection.

octo-command-error

  • Try to read the policy with the given ID via a plain GET ​/policies​/{policyId} request

    The user and the hub need read and write permission on message/

  • Re-check the connection and make sure the entry
    integration:your-things-solution-id:octopus is also set in the Target section.

Feedback welcome

Thanks for joining the demo, and please do not hesitate to give us feedback.

Imprint Legal info Privacy statement