I have multiple Pi's connected to a miner in a private network, where one pi is collecting sensor data, and am able to send ether from all the devices and they are all synchronised with the private blockchain.

How can a smart contract request data from pi B and Pi A sends the data back automatically


What you want to achieve can be implemented using an oracle.

  • Your smart contract generates an event RequestData(uint id), where id can be an identification of the raspberry pi.
  • An application is listening for events in your blockchain. When a RequestData(uint id) arrives it will make the request to the corresponding raspberry pi.
  • When the data is acquired it will be send by the application to your smart contract, for example it will call a function sendData(id, data).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.