LoraWAN and IOTA: Proof of Concept of storing data in real time in the Tangle

Harm van den Brink
Jan 3, 2019 · 3 min read

My wish for 2019 was to create a proof of concept around LoraWAN with IOTA. The obvious thing to do is to store data sent by a LoraWAN device directly into the Tangle. This would be awesome, so… I did!

Image for post
Image for post
The LoraWAN device I used bought at AliExpress → Link to the device

The process is super easy. You send a message using LoraWAN and The Things Network, listen to a specific application using MQTT, receive the message and send it to the Tangle using powsrv.io for lightning fast speeds.

I used The Things Network as free backend for receiving the messages. Although you don’t need to run your own gateway at The Things Network to use the network, at ElaadNL we run one.

Image for post
Image for post
The gateway at the ElaadNL premises
Image for post
Image for post
The data received from the LoraWAN device in The Things Network dashboard

This a visualization of how the message is received, parsed and sent to the Tangle in real time. We use, obviously, NodeJS to connect to the MQTT server of The Things Network and forward the message to the IOTA Tangle.

Image for post
Image for post

What does a transaction like that look like when you forward the full JSON message received via MQTT? Like this:

Image for post
Image for post
The transaction can be found using TheTangle.org → Transaction

This use case allows for real time data storage in the Tangle, which gives the user an immutable way of data storage. Think about cooling trucks, which have to prove that a certain good is kept below a certain temperature all the time. LoraWAN devices could be used to send the data, the Tangle could be used to store that data in an immutable and secure way. Let me know what kind of use cases you think about in the comments!

Thanks to Ton Smets for helping setting up the demo and hardware.

Image for post
Image for post
The LoraWAN device with antenna and FTDI programmer

The magic code

Feel free to use, change, adapt and spread the word!

🥕🥕🥕🥕🥕🥕🥕🥕🥕🥕🥕🥕🥕🥕

Keep in mind that this proof of concept doesn’t cover full end to end integrity of the data. Adding an additional digital signature at the LoraWAN devices to the message would solve that part. Making use of Masked Authenticated Messaging (MAM) would even make it better and secure!

Harm van den Brink

Written by

Cyber security, smart grids, electric vehicles, distributed ledger technology, hardware. Working for Enexis and ElaadNL. Articles on personal title.

Harm van den Brink

Written by

Cyber security, smart grids, electric vehicles, distributed ledger technology, hardware. Working for Enexis and ElaadNL. Articles on personal title.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store