How can data from IOT device be stored in Azure ethereum blockchain?

Category: azure blockchain


PSA7 on Sat, 08 Jul 2017 21:20:52

I have a scenario in which a IOT device reads values from various sensors(temperature,humidity etc) These values(JSON packet) need to recorded in the Azure ethereum block chain. How can this be done. I know how to send the data from the device to the Azure IOT Hub.  Is it required to send the data to the Hub? Is it possible to use the data from this hub and record it in the blockchain? How will I integrate IOT Hub and Ethereum blockchain? I am very new to the blockchain technology. I just understand that a webapp needs to be created which can take data from the IOT hub and the same application can be used as DAPP for the block chain.


Microsoft Azure Blockchain Team on Fri, 14 Jul 2017 07:53:58

Hi PSA7,

Storing data (or typically a hash representing some data) can be done by creating a smart contract that contains a mapping or other relevant data structure.  The smart contract would accept data as input and store it in its internal map which can be retrieved by calling the smart contract.  Specifically for IoT data, you would need to write code to create a transaction targeted at the smart contract with the data.  I am not aware of a ready-made adapter for such a purpose but I'll post back here if I find one.  Since you mentioned .Net, I recommend looking into using Nethereum which is a .NET library that allows you to write application code that interacts with an Ethereum network over RPC.  This could be incorporated in the webapp you mentioned.


Microsoft Azure Blockchain Team 

LaviHo on Thu, 18 Jan 2018 06:00:42

Hi,sir I am currently doing the same thing. I am a final year undergraduate student who is doing the final year project. I want to collect the sensor data from the online raspberry pi 3 simulator and update in a ethereum blockchain. Or maybe use a smart contract to interact with the raspberry pi lighting(change the blinking intervals,etc). Is there any way that I could integrate the the 3 services (simulator, iot hub and the ethereum blockchain) ? Best, Lavi