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:
- Raspbian - Flavor of Linux optimized for Raspberry pi
- NOOBS (Coming Soon!)
- Snappy Ubuntu Core (Coming Soon!)
- Windows IOT (Coming Soon!)
- Installing Node.js
- Installing IPFS
- Installing Nomad
- 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
pi@coder ~ $ sudo fing
get pi PI
control C ro stop
ssh [email protected]```

When prompted enter ( YES ) to confirm Key genoration

enter password (pi coder default is raspberry)

connected looks like

sudo raspi-config```
configure ip
exmpan
overlock
Next we need to update out Pi and remove outdated software.
sudo apt-get update```

When prompted click ( Y ) to confirm upgrade.
sudo apt-get upgrade```
IMAGE
sudo apt-get remove```

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```

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);
});
}
/```