ICP 5 - Gnkhakimova/CS5590-IoT GitHub Wiki

ICP 5

Source Code
Video

Introduction

Node-Red is easy to use flow-based UI tool IoT development. Instead of focusing on programming language it helps developer to concentrate on logic of application. Node-Red has a lot of very useful Nodes each of which perform different type of operations/functions. Which helps to decrease development time. In this in class project we used different type of Nodes which helped us to understand Node-red more.

Objectives

Purpose of this project was to create meaningful flow by using following Nodes: Switch, Change, Range, RBE, MQTT, Web Socket, HTTP request/response, File, Twitter, Weather API and etc. First we had to implement each node individually and then connect them into one flow. I decided to create a flow which will read data form Open Weather API - perform different operations on response, such as changing values and storing them in WebSocket and in MQTT. At the end results will be displayed in three websites(weather,icp5 and UI) and in console.

Approach/Method

First we started by implementing each Node individually and tried to understand how each component work, so we created 8 different small flows which would perform different operation based on Node. After that I had to think about final flow idea and decided to impalement weather web site. We had to read and do some research on each Node in order to fully understand it, so we could try different combinations other then the open which were given in class. Created web site using bootstrap so it will have user friendly UI, I also decided to display other values from each Node in dashboard (UI) and in debug console. At the end final message will be displayed on my Twitter account.

Flow Diagram



Outputs

Web site weather were current weather is displayed.

Dashboard UI

File Web site

Twitter

Workflow

  1. Created a flow using Switch Node, by defining two cases.
  2. Created a flow using Change Node, changing weather description based on temperature.
  3. Created a flow using RBE Node, blocking any outputs if values increased by 75%
  4. Created a flow using MQTT Node, configured MQTT using HIVEMQ

  5. Created a flow using WebSocket Node, configured Web Socket.
  6. Created a flow using HTTP Request/Response Node - created web site to display weather condition.
  7. Created a flow using Twitter Node, set up developer account and created application and was able to post tweets.
  8. Created a flow using Weather API Node, created account and got API key to get weather condition.
  9. Created a flow using Range Node, ranging out humidity.
  10. Created a flow using File Node, displaying different images based on temperature value, if it is called will display picture with a snow on it, if it gets warmer image with sun and green grass will be displayed.
  11. Connected all flows into one meaningful flow which will display weather condition based on several filters performed in a flow using given nodes.
  12. Displaying result in Weather site using bootstrap.
  13. Displaying result in Dashboards.
  14. Displaying result in ICP 5 site by changing image.
  15. Displaying result in Debug Console.

Parameters

For this in class project I used Node-Red, bootstraps, Switch node, Change node, Range node, Http Request node, MQTT node, WebSocket node, Twitter node, Weather API node, RBE node and different helper functions.

Conclusion

Successfully competed ICP# 5 by learning new features of Node Red and discovered new nodes and how they can be connected with each other.For future works will go over new feather of node red and will try to discover new nodes.