Raspberry PI

IN DEVELOPMENT AND UNEDITED

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

What's Covered:

  • Installing and configuration of either:
  • Connecting a hardware and software sensor to Nomad
  • Publishing your data stream
  • Possible Next steps
  • Demo Code
  • Our Favorite Projects

What you need:

  • Connection to the internet
  • Raspberry Pi of any generation

Configuring the raspberry pi

connest
Install raspbian
connect to i

https://www.fing.io/download/

pi@coder ~ $ sudo fing

get pi PI

control C ro stop

ssh [email protected]```

![](Screen Shot 2016-11-08 at 12.32.10 PMNQGS.png)


When prompted enter ( YES ) to confirm Key genoration
![](Screen Shot 2016-11-08 at 12.32.19 PMNQGS.png)

enter password (pi coder default is raspberry)
![](Screen Shot 2016-11-08 at 12.32.21 PMNQGS.png)

connected looks like
![](Screen Shot 2016-11-08 at 12.32.29 PMNQGS.png)

sudo raspi-config```

configure ip
exmpan
overlock


Next we need to update out Pi and remove outdated software.

sudo apt-get update```
![](Screen Shot 2016-11-08 at 12.42.10 PMNQSG.png)



When prompted click ( Y ) to confirm upgrade.

sudo apt-get upgrade```
IMAGE

sudo apt-get remove```
![](Screen Shot 2016-11-08 at 1.13.59 PMNQSG.png)

sudo reboot```

Reconnect to your pi```



---

##Installing stuff

ssh pi@MY_IP_ADDRESS```

Install support for possiable sensors

curl -sLS https://apt.adafruit.com/add | sudo bash```

N in a Node verion manager

npm install -g n```

Installing Node

sudo n stable```

Downloading IPFS to get the most updated link check [IPFS.io](https://dist.ipfs.io/#go-ipfs).

wget https://dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-arm.tar.gz```

Unzip

sudo gzip -d go-ipfs_v0.4.4_linux-arm.tar.gz```
![](Screen Shot 2016-11-08 at 1.51.36 PMNQSG.png)

sudo tar -xf go-ipfs_v0.4.4_linux-arm.tar 


Change directory to gp-ipfs

cd go-ipfs```

ls```

Install IPFS

sudo ./install.sh```

Check to make sure IPFS installed sucessfully.

ipfs```

Initiate new IPFS Project
```ipfs init```
Install nomad

npm install --save nomad-stream```


Configuring Nodes

Hardware Nodes

We are using RPI-GPIO to so the raspberry pi can use it gpio pins

npm install --save rpi-gpio```

Basic Hardare Analog Read

/*


*/
Var gpio = require('rpi-gpio');

const Nomad = require('nomad-stream') //Importing Nomad npm module

const nomad = new Nomad()

// const createMessage = () => {
// const idx = Math.floor(Math.random() * messages.length)
// return (messagesidx)
// }

let instance = null
nomad.prepareToPublish() //Prepare to publish (Runs once)
.then(function(n) {
instance = n
console.log('🤖 | Connected!')
return instance.publishRoot('Demo sensor is running')
})
.then(function() { // Publishing
console.log('DEMO: ROOT PUBLISHED!!!!')
setInterval(function() {

        gpio.setup(24, gpio.DIR_IN, readInput);

        function readInput() {
            gpio.read(24, function(err, value) {
                console.log('UV Level ' + value);
            });
        }
    }, 60000)
    return instance.publish('hello!')
})
.then(() => {
    // console.log('DEMO: PUBLLISHED!!!!', d)
})

/
var gpio = require('rpi-gpio');
gpio.setup(7, gpio.DIR_IN, readInput);
function readInput() {
gpio.read(7, function(err, value) {
console.log('The value is ' + value);
});
}
/```

results matching ""

    No results matching ""