20
node-red with Raspberry Pi

Node red for Raspberry Pi

Embed Size (px)

Citation preview

Page 1: Node red for Raspberry Pi

node-redwith Raspberry Pi

Page 2: Node red for Raspberry Pi

What is Node-red?

Node-Red in its simplest form is an open source visual editor for wiring the internet of things produced by IBM.

Page 3: Node red for Raspberry Pi

More..

Node-RED is a visual tool for wiring the Internet of Things (IoT).

Node-RED is platform-independent.

Page 4: Node red for Raspberry Pi

Node-RED takes care of the technicalities and lets you concentrate on the logic of your workflow. !

Traditional IoT development can be very technical: Access to the GPIO and other hardware requires skills in C or assembler, output of data to web services or sending tweets and emails requires the use of complex APIs.

Page 5: Node red for Raspberry Pi

While most programming in Node-RED is done visually using pre-defined functions (“nodes”), any additional functionality can be added in JavaScript.

Page 6: Node red for Raspberry Pi

How to Start with Raspberry Pi?

Desktop: Menu->Programming->Node-RED

Visit http://127.0.0.1:1880 in browser and get your dashboard.

Page 7: Node red for Raspberry Pi
Page 8: Node red for Raspberry Pi

Basic Nodes

Page 9: Node red for Raspberry Pi

Flow 1: Twitting sensor dataStep 1 Drag and drop rpi input node to flow dashboard

Step 2 Double click to configure it and select the pin number

Step 3 Drag and drop twitter output node from social

Step 4 Double click the node to configure it, authenticate your twitter account

Step 5 Connect both the nodes

Step 6 Deploy the project by clicking on the top right button Deploy

Step 7 Check your tweets on your twitter account, done by sensor.

Page 10: Node red for Raspberry Pi

Installing Thingspeak NodeStep 1 Stop the node-red running server by closing it or by “stop node-red”

Step 2 Use “sudo npm install node-red-contrib-thingspeak” to install thingspeak node

Step 3 Start node-red server, you will find thingspeak node in functions at the end of the list

Step 4 Visiting thingspeak.com and signup for an account

Step 5 Create a channel and get Write API Key

Page 11: Node red for Raspberry Pi

Flow 1: Uploading sensor data on thingspeakStep 1 Drag and drop rpi input node to flow dashboard

Step 2 Double click to configure it and select the pin number

Step 3 Drag and drop thingspeak node from function

Step 4 Double click the node to configure it, enter your write API Key, Don’t forget to enter the field id as “1”

Step 5 Connect both the nodes

Step 6 Deploy the project by clicking on the top right button Deploy

Step 7 Check your private view in your thingspeak channel

Page 12: Node red for Raspberry Pi

Flow 1: IBM Watson IoT Demo Step 1 Drag and drop rpi input node to flow dashboard

Step 2 Double click to configure it and select the pin number

Step 3 Use “Sudo npm install node-red-contrib-ibm-watson-iot

” to install the node

Step 4 Double click the node to configure it, select quickstart mode, click on the edit symbol(pencil) next to it to get the dashboard.

Step 5 Connect both the nodes

Step 6 Deploy the project by clicking on the top right button Deploy

Step 7 Check your on the IBM Watson iot dashboard opened.

Page 13: Node red for Raspberry Pi

node-red Shortcodes for repositoreisnode Cmd command

Google Chart Sudo npm install node-red-contrib-googlechart

IBM IoT App Sudo npm install node-red-contrib-scx-ibmiotapp

IBM Watson IoT Sudo npm install node-red-contrib-ibm-watson-iot

ThingSpeak Sudo npm install node-red-contrib-thingspeak

Watson Sudo npm install node-red-node-Watson

MySQL Sudo npm install node-red-node-mysql

Alexa Sudo npm install node-red-contrib-alexa

Facebook Sudo npm install node-red-contrib-facebook

Arduino Sudo npm i node-red-node-Arduino

Page 14: Node red for Raspberry Pi

Cayenne Cloud by mydevices

Page 15: Node red for Raspberry Pi

Cayenne is the first of its kind drag and drop IoT project builder that empowers developers to quickly create and host their connected device projects.

Cayenne was designed for the Internet of Things.

It can control hardware remotely, it can display sensor data, it can store data, analyze and do many other cool things.

Page 16: Node red for Raspberry Pi

Connecting your Raspberry Pi

1. Signup for a free Account on Cayenne Cloud

2. Once you’re signed up you will need to register/connect the Pi up to the account you just created. To do this simply copy the 2 command lines shown after you sign up. Enter these into the terminal for your Pi. (These files are unique for every new install)

3. It will take a few minutes to install onto your Pi depending on how fast your internet connection is. The web browser or app should automatically update with information on the installation process.

Page 17: Node red for Raspberry Pi

Once installed the dashboard will display and should look like something below.

Page 18: Node red for Raspberry Pi

Controlling LED1. Go to add new in the upper left corner of the dashboard

2. Now search for digital output and select it

3. For this device select your Pi, widget type is button, icon can be whatever you want, and then select integrated GPIO. Finally channel is the pin/channel that our LED is connected to. For this example it is pin #17. (This is the GPIO numbering of the pins)

4. Now press the add sensor button

5. You can now turn the GPIO pin high & low from the dashboard and also use it in a trigger

Page 19: Node red for Raspberry Pi

Explore more..https://www.hackster.io

https://pimylifeup.com

http://codearduino.com

And google..

Page 20: Node red for Raspberry Pi

A BIG THANK YOU