Bridging Bosch and IOTA

Bosch and the XDK Cross Domain Development Kit

Bosch is, without a doubt, a leading enterprise when it comes to research and development of technology designed for the Internet of Things (IoT). According to Bosch, the IoT is creating new types of businesses, centred around services and user experience, and they predict we’ll have more than 15 billion devices connected to the internet by 2020.

These connected devices will provide real time data, and send this data back to businesses that can remotely and automatically control the underlying physical infrastructure. Imagine your car sensors performing periodical data relay to Volkswagen in exchange for payment. Imagine how much your car company could learn with this data!

As devices get more connected to the internet, heading to the “data as new oil” era, some companies like Bosch are creating powerful tools to experiment in this sandbox. Such is the case for the Bosch XDK 110, a programmable sensor device and a prototyping platform for any IoT use case imaginable.

This amazing piece of hardware includes an accelerometer, gyroscope, magnetometer, environmental sensors (humidity, temperature, air pressure), ambient light and a microphone for noise detection, together with WiFi, BLE and SD.

The XDK was originally created for Bosch Connected Devices and Solutions to create IoT products, but ended up being not only a prototyping platform, but also a sensor node solution. Therefore, Bosch decided to commercialize it in order to help others who want to shape their own IoT projects.

Bosch XDK and IOTA, a first approach

Bosch plays such a big role in the development of the IoT via hardware, proof of concept implementation, and even financial investments via Robert Bosch Venture Capital.

Considering all of this, and after having seen the live presentation of Masked Authenticated Messaging (MAM) done by Paul Handy at Chicago Connectory, we thought it would be a good idea to get our hands on one of these XDKs (Paul even mentioned them while he was introducing this new second layer feature to allow messaging over the Tangle).

So we bought one online and found a way to get it into Argentina with a friend returning from Europe. We did a quick unboxing, downloaded the XDK Workbench (an Eclipse based IDE with the needed libraries), and started flashing the Examples included. It was awesome! The way Bosch handled this little piece of hardware is just amazing, and you understand why it is so useful for prototyping. Get one in your own hands and you’ll see just how much that little box can do.

The XDK Workbench examples serve as a guide to get you started

After testing different sensors and methods to send and receive data successfully, we thought it was time to start using all this with IOTA. This was the start of XDK2MAM journey and, we must say, it was not all fun.

Being part of the solution

It turns out that, despite the relation between Bosch and IOTA, there was no open source code available to connect this two pieces. We did a lot of research and spent long hours on the XDK Forum just to find pieces of code that would send some data via MQTT. It was something, but somehow neither Bosch nor IOTA had provided the code needed to get this working out of the box with its full potential.

Maybe because this was a solution that involved developing mixed software: C programming on the XDK side and Node.js at IOTA endpoint to publish the sensor’s data on the Tangle via MAM. So we had a clear mission: we were going to provide an open source and well documented solution to connect the XDK with IOTA through its various methods (HTTP/MQTT/BLE being the most important). And so XDK2MAM was born.

Got an advisor? Daniel Trauth onboard.

Daniel Trauth is Chief Engineer and Head of the Machine Learning in Production Engineering working group at the WZL at the Aachen University and a pioneer on the field of the Internet of Production. According to his vision:

Within our vision of the Internet of Production, data from distributed sources along the product life-cycle will be multilateral accessible and usable. Data-based empirical evidence and systematic learning across locations, domains and industry branches will lead to new level of efficiency for producing industries.

The combination of the fact that he was already using XDK with IOTA, and the previously established connection to him through work with the IOTA Evangelist Network, he was our first move when we sought out an adviser. We were lucky enough to get him on board as XDK2MAM Advisor (yeah, wow!). If anyone could test and validate our code’s efficiency, it was Daniel and his amazing engineering team.

We started working on a HTTP based solution that would allow us to send all the sensor’s data via WiFi to a Node.js based server running in our laptops or Raspberry. This server would be in charge of publishing the data using MAM. The goal was simple: anyone should be able to get it working, selecting which sensors to use. No need to be a programmer, just follow the guide instructions and watch it get published on the Tangle Explorer.

After a lot of work and testing, the HTTP package was ready and Trauth’s guys were able to test it on their XDKs. When they were done testing, Daniel’s Tweet officially launched XDK2MAM.

While we were still testing and documenting our HTTP package, we started working on a MQTT solution that should retain our principles: anyone should be able to get it working just by following instructions.

Participation on the Data Market

Even though the XDK might not be the classic kind of sensor complex you want to plug into the Data Marketplace (because of its price), we needed to provide an easy to implement template to allow sensors driven by our XDK2MAM C software to stream data in the IOTA DMP.

After going through the on boarding process, initial tests concluded that our HTTP pckg was ready to be used on the DMP out of the box. Just a few fixes were needed on the Node.js template provided by the DMP.

Again, we co-tested the code with Daniel Trauth’s engineering team, publishing our Argentinian streams when we were happy with the test results.

Data feed from Buenos Aires and Entre Ríos (click on the state name to see data)

XDK2MAM current state and road map

A few months after finding this gap between the XDK and IOTA, XDK2MAM has provided full solutions to publish a sensor’s data on the Tangle quickly and easily.

Despite the long road ahead, we are on the right path, and know exactly what needs to be done in order to keep providing tools to enhance the XDK-IOTA experience. Recognition by Bosch Connectivity and other large participants has strongly reaffirmed our beliefs.

Today at the #ProgrammersDay is a good time to share the ambitious project @XDK2MAM: an open source software, that allows the interaction between our #BoschXDK and the @iotatangle. Check it out: https://t.co/TSEyAJqGnZ #IOTA — Bosch Connectivity (@Bosch_BCDS) September 13, 2018

MAM and the IOTA protocol itself are continuously evolving, so we hope to develop concurrently with those changes to ensure bridges between these technologies are always strong and up-to-date.

Since IOTA handles MAM through a javascript library, all the packages we offer relay on a Node.js server that listens to the sensor’s data and publishes it to the Tangle.

Although this can be beneficial, as it allows the manipulation of data in various ways prior to the decentralization process, it requires a second instance to handle/publish the XDK data.

Our roadmap considers both scenarios:

XDK&Node.js with queue system: the amount of sensor data capable of being put into the Tangle is limited by the proof-of-work that Nodes must do in order to publish the transaction. Storing all of this data requires storage on a database (Mysql/MongoDB) running on the Node server before publishing to the Tangle. This is a more centralized solution that forms a buffer-like queue waiting to be published. XDK All-in-one: To publish directly to the Tangle without needing a Raspberry or a VPS running a server with Node, just having an additional instance to publish via MAM is not useful at all. This is why our road map includes a solution that will allow the XDK to publish directly using a built in C Library with the ability to publish through MAM.

Code & Show

To be working with such cutting-edge technologies is amazing and, due to the practical nature of the stack we use, showing how XDK works with IOTA is quite easy. Yes! Explaining DLT, how IOTA works, and the future of IoT might finally be more difficult than setting up XDK sensors and sending their data to the Tangle via MAM.

Because we’ve found this experience to be helpful as an intro to IOTA as an IoT protocol, we are committed to doing as many workshops and talks/meetups as possible.

This is just the beginning, and we’re truly convinced of XDK 110’s importance to the development of concepts and prototypes using IOTA. You’ll be able to find us giving workshops and talks at Block Crypto Brazil, invited by Serguei Popov and the CILS Argentina (International Free Software Conference) 2018, in which we will have the honor to meet maddog Hall.

Stay tuned!