Finally, after fighting for weeks and months we are finally there!
The Bosch XDK is now sending JSON data over MQTT to the IOTA Tangle via MAM.

Thank you to

First things first: A HUGE Thank you to:

The jargon

So let’s get on the jargon:

  • Bosch XDK – a programmable sensor device & a prototyping platform for any IoT use case you can imagine
  • JSON – is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value)
  • MQTT or Mosquitto – is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol
  • IOTA – The first open-source distributed ledger that is being built to power the future of the Internet of Things with feeless microtransactions and data integrity for machines
  • Tangle – IOTA’s distributed ledger, by contrast, does not consist of transactions grouped into blocks and stored in sequential chains, but as a stream of individual transactions entangled together
  • MAM (Masked Authenticated Messaging)  – is a second layer data communication protocol which adds functionality to emit and access an encrypted data stream, like RSS, over the Tangle (IOTA’s distributed ledger) regardless of the size or cost of device

The awesomeness of mqtt via MAM

Now let’s see what this is made of:

So here is the Bosch XDK pushing the (I call it fake JSON) sensor data like temperature, pressure and humidity to the mqtt broker. The original Bosch SendDataOverMQTT is in use here with some slight modifications like username and password authentication to the mqtt broker.
My Bosch XDK code to this one is available in this repo here.

Bosch XDK Code

This fake JSON is not necessary since Christopher Aldave‘s code transforms the input in real JSON, but you better try things out and add some complexity 🙂

This is MQTTlens (a Chromium addon) that I use to visualise the data as it is coming through.

MQTT Lens showing the messages

The first monster of Dr. FrankenCode:

Christopher Aldave adapted code pushing the data to the Tangle via MAM

I took the original code from Christopher Aldave‘s repository MAMExample on Github and adapted it to my purpose. So I’ve added an mqtt client connection, a mqtt topic subscription.

My Mqtt JSON to MAM code to this one is available in this repo here.

And the second monster of Dr. FrankenCode:

I took Rck’s SensorHub and slightly modified it to show just my data (not a huge modification but still, it’s his creation).

This is the result:

rck SensorHub

This is not only beautiful this is awesome!


Also published on Medium.