Skip to content

iota-community/raspberrypi-pubsub

Repository files navigation

IOTA Raspberry Pi Demo

This application allows you to use one command to start sending sensor data (the current temperature in Celsius) to the Devnet Tangle.

Prerequisites

To use this demo, you need the following:

For help setting up a Raspberry Pi, you can follow these instructions.

For help setting up the Enviro Phat, you can follow the Soldering guide and the Getting started guide.

Run the application

  1. Clone this repository
git clone https://github.com/iota-community/raspberrypi-pubsub
  1. Change into the raspberrypi-pubsub directory
cd raspberrypi-pubsub
  1. Install the dependencies
npm install
  1. Run the code
node index.js

In the console, you should see that the current temperature in Celcius is sent as a transaction to a node on the Devnet.

Response data

Note: To check that your transaction is on the Devnet Tangle, you can copy the value of the hash field and paste it into the search bar of the Devnet explorer.

Devnet Tangle explorer

The message field contains the temperature data in trytes. To convert the trytes to ASCII characters, use one of the converter functions in the client libraries.

Learn how to convert data between trytes and ASCII characters.

Response

Starting app
Current temp: 35.4805409354
Sending transaction
Transfer successfully sent
{ hash:
   'GTJICLAKCQOANGP9WZRCYIQQIJTQCMPLTAKEFWPXOSOUWALGNBBDYOWTWQSM9MRLEIMVHGMLDALYLH999',
  signatureMessageFragment:
   'ODGAHDTCADDDTCFDPCHDIDFDTCGADBJCODGAJDPC9DIDTCGADBUAQAGAPCSCSCFDTCGDGDGADBGANBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCKBCBKBNBNBACOBBCBCCBNBKBCCGAQAGAADTCGDGDPCVCTCGADBGAYBNBQBKBRBNBCCMBKBNBNBNBCCMBPBNBZBMBRBNBSBNBPBNBCCMBQBKBNBLBQBKBGCKBICKBBCKBHCKBLBLBDCKBICKBHCKBDCKBMBLBGCKBICKBHCKBQBKB9CNBGAQDLCQD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999',
  address:
   'DATA9ADDRESS9DATA9ADDRESS9DATA9ADDRESS9DATA9ADDRESS9DATA9ADDRESS9DATA9ADDRESS9DAT',
  value: 0,
  obsoleteTag: 'MPA999999999999999999999999',
  timestamp: 1558702721,
  currentIndex: 0,
  lastIndex: 0,
  bundle:
   'LTIKJHINULXQ9FZ9UE9LZUZYUJTA9PGAZGHUFNKVHVFJVXFAN9HJBXLDJSVYALUVPCT9BJWYJETIYIOHB',
  trunkTransaction:
   'BIAVEQYFHWWQK9VUM9VSIJFZCKIPNRYXUUBLCHLJGVGTAGJEZWGCIIYXMQYXKWFCBAMAWPKAJTUGFJ999',
  branchTransaction:
   'BIAVEQYFHWWQK9VUM9VSIJFZCKIPNRYXUUBLCHLJGVGTAGJEZWGCIIYXMQYXKWFCBAMAWPKAJTUGFJ999',
  tag: 'MPA999999999999999999999999',
  attachmentTimestamp: 1558702724384,
  attachmentTimestampLowerBound: 0,
  attachmentTimestampUpperBound: 3812798742493,
  nonce: 'IDXRJXHLAVHPUJY9ZBWAFFJH9TR'}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages