Git Product home page Git Product logo

iot-things-examples's Introduction

Examples for Bosch IoT Things

This repository contains examples for using Bosch IoT Things. It is part of the Bosch IoT Suite which is the cloud-based IoT platform provided by Bosch.IO. The service is based on and powered by the open source project Eclipse Ditto.

The example code provided here shows a selection of the Bosch IoT Things service functionality. Thus, the examples do not cover the complete service offering.

If you need more information, please visit the links above or contact us.

This concept shows an end-to-end scenario for digital twins based on Bosch IoT Things / Eclipse Ditto.

This example shows a usage scenario for an integration of IoT devices with Bosch IoT Things / Eclipse Ditto. It is focused on distinguishing between the current reported state of device information and a desired, target state for that device. This is mainly required for configuration parameters of devices that are connected either sporadically or unstably.

This example shows how to connect an ESP8266 based IoT board via Bosch IoT Hub to Bosch IoT Things and how to update a digital twin via "telemetry" data sent from the device.

This example is a local Node.js simulator which you can use as a replacement for octopus-firmware if you don't have access to an Octopus.

This example shows how to send command-and-control messages via the HTTP API of Bosch IoT Things to Bosch IoT Hub to the physical device.

With this tool, you can upload a large number things into your cloud service instance at once. The example uses the things-client for uploading the things from a local file.

License

The examples are available under the terms of Bosch SI or Bosch.IO Example Code License. See individual files for details.

iot-things-examples's People

Contributors

danielbohn avatar danielfesenmeyer avatar dependabot[bot] avatar derschwilk avatar dguggemos avatar ffendt avatar geglock avatar ghandim avatar ihsansensoy avatar jbartelh avatar lukasreussner avatar mahdi-ebrahimi avatar marianne-klein avatar martinkiebler avatar martinreitz71 avatar thjaeckle avatar vadimgue avatar willi-io avatar yannic92 avatar yufei-cai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iot-things-examples's Issues

Octopus Example - TLS not working

Great to see this easy to use example with the Bosch IoT Suite and real embedded HW :)

Unfortunately I noticed that the example is not working, because the certificate fingerprint is outdated:
/* SHA-1 fingerprint of the server certificate of the MQTT broker, UPPERCASE and spacing */ #define MQTT_SERVER_FINGERPRINT "7E 8E 7E FF 65 3E C0 02 88 F4 43 AE C5 FE E0 ED 89 C6 E2 06"
The certificate fingerprint is:
65 04 DC 0E 76 74 C7 FE 40 74 CE 79 04 16 6F 13 C4 0B 1D AD

However it looks like they are using Let's Encrypt certs with only three months until they expire. Wouldn't it be better to validate the certificate against a CA and be less dependent on the cycles they use to rotate the certs?

Tested new Arduino libraries successfully

Test on Mac 10.15.4 (19E287) and Arduino 1.8.12 following new versions work fine:

  1. Adafruit Unified Sensor Library (tested with 1.1.2)
  2. Adafruit BME680 library (tested with 1.0.7)
  3. Adafruit BME280 library (tested with 2.0.1)
  4. Adafruit BNO055 library (tested with 1.1.6 | 1.1.10 | 1.1.11)
  5. Adafruit NeoPixel library (tested with 1.1.7 | 1.3.5)
  6. PubSubClient library (tested with 2.7.0)
  7. ArduinoJson (tested with 5.13.4 | 5.13.5 does not work with 6.x.y) see issue #55
  8. ESP8266-Ping (tested with 2.0.1)

and
ESP8266 Platform to the IDE, see ESP8266 Arduino Platform (tested with 2.4.1 | 2.6.3)

http-forwarder doesn't compile with typescript version 3.6.x

Versions used

NPM: 6.4.1
NodeJs: v10.5.3
typescript: 3.6.3

What is happening

$ tsc
../../../home/user/.nvm/versions/node/v10.15.3/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6 - error TS2300: Duplicate identifier 'IteratorResult'.
41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
        ~~~~~~~~~~~~~~
  node_modules/@types/node/index.d.ts:73:11
    73 interface IteratorResult<T> { }
                 ~~~~~~~~~~~~~~
    'IteratorResult' was also declared here.
node_modules/@types/node/index.d.ts:73:11 - error TS2300: Duplicate identifier 'IteratorResult'.
73 interface IteratorResult<T> { }
             ~~~~~~~~~~~~~~
  ../../../home/user/.nvm/versions/node/v10.15.3/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6
    41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
            ~~~~~~~~~~~~~~
    'IteratorResult' was also declared here.

Found 2 errors.

What should happen

When running tsc a successful build is expected.

sources for the libraries

Hi,

In your examples you have:

final Thing updated = thing.setAclEntry(aclEntry);

marked as deprecated.

But when I click it to see what's the new way to do it, I cannot see the sources. It's stuck at searching and when I click download from maven it gives me

Sources for 'cr-model-5.0.0.jar' not found

My environment...

IntelliJ IDEA 2016.3.2

Gradle Example

Thanks for enabling the issues.

What: I'm trying to do: Import the libraries with Gradle instead of Maven
Why: Gradle is much nicer to read and also supports custom things

What I do:

+buildscript {

  • repositories {
  •    mavenCentral()
    
  •    maven {
    
  •        url "https://maven.bosch-si.com/content/repositories/bosch-releases"
    
  •    }
    
  • }
    +}
  • compile("com.bosch.iot.things:things-client:3.0.0.RC8")

Standard gradle way ?

on gradlew build I get

+FAILURE: Build failed with an exception.
+
+* What went wrong:
+Could not resolve all dependencies for configuration 'detachedConfiguration5'.
+> Could not find com.bosch.iot.things:things-client:3.0.0.RC8.

  • Searched in the following locations:
  •  https://repo1.maven.org/maven2/com/bosch/iot/things/things-client/3.0.0.RC8/things-client-3.0.0.RC8.pom
    
  •  https://repo1.maven.org/maven2/com/bosch/iot/things/things-client/3.0.0.RC8/things-client-3.0.0.RC8.jar
    
  • Required by:
  •  project :
    

Why is it searching on maven.org and not on bosch-si.com ?

My guess. I'm setting up something wrong, but what and how to correct it, I don't know.

Octopus-Things example: Set TLS certificate before establish the connection to the MQTT broker

Thanks for the easy to use example, to connect the Octopus prototype board to the Bosch IoT Suite.

While playing around with this example I had to change the order to of the "wiFiClient.connect" and "wiFiClient.setCACert" calls at "connect" method of the"boschIotHub" class to establish a secure connection. So that the certificate is available before the connect call takes place.

It would be great if you could fix this to make the example work out of the box ;)

plans about data persistence

not an issue:

Scenario: some sensors send data every x seconds.
Internet fails for 1 hour.
Data has to be kept in sync.

Do you have any plans to implement persistence... (like Firebase), or it's our the responsibility ?

Some improvements octopus-hub

While running through this How-To I stumbled over some smaller issues. Here are my improvements

  • "auto" set-up of some #DEFINE and adding more information about configuration settings into setings-template.h
  • Additional Arduino monitor messages for all configurations settings octopus-hub.ino

Both should make configuration and debugging easier.

x

x

octopus-hub does not support ArduinoJson V6.x: needs upgrade

until ArduinoJson V5.13.5 octopus-hub works fine. With V6.0.0 - V6.15.1 will not compile with this error message:

Arduino: 1.8.12 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new can abort), All SSL ciphers (most compatible), 4MB (FS:none OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 921600"

sensorPublish:43:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<600> jsonBuffer;
           ^
sensorPublish:59:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<200> jsonBuffer;
           ^
sensorPublish:74:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<200> jsonBuffer;
           ^
sensorPublish:89:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<200> jsonBuffer;
           ^
exit status 1
StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6

Needs a hero to upgrade arduinojson.org/upgrade

Missing error message octopus-hub

While octopus-hub is connected to Bosch IoT Suite and the service quota is eaten up, messages are not accepted by the server any more. But instead a successful delivery is reported:

21:46:57.467 -> [Bosch IoT Hub]     {"topic":"io.bosch.stefferber/octopus2/things/twin/commands/modify","headers":{"response-required":false,"content-type":"application/vnd.eclipse.ditto+json"},"path":"/features/magnetometer/properties","value":{"status":{"xValue":58.25,"yValue":-46.0625,"zValue":79.6875,"sensorUnits":"uT"}}}
21:46:57.500 -> [Bosch IoT Hub]     Publishing on topic: telemetry

I would expect

  • error code like #429 Too Many Requests or #507 Insufficient Storage or #509 Bandwidth Limit Exceeded
  • RED NeoPixel color

Provide example of how to use CompletionStages based API

Currently we have rather simple Things Client examples which use blocking .get() with a specified timeout a lot.
Better would be examples which use CompletionStages which are orchestrated together to form a more "what is happening" instead of a "how is it happening" programming style.

improve docu

the octopus simulator documentation is unclear and needs improvement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.