Upload
mrnukoon-phimsen
View
160
Download
1
Embed Size (px)
Citation preview
Node-RED• Node-RED is a visual tool for wiring the Internet of
Things (IoT).
• Traditional IoT development can be very technical, but Node-RED takes care of the technicalities and lets you concentrate on the logic of your workflow.
• While most programming in Node-RED is done visually using pre-defined functions (“nodes”), any additional functionality can be added in JavaScript
Create a Twitter Flow
• Create inject, debug, httpRequest, function, and twitter nodes.
• Create tweet some informations about the live UK total electricity consumption
Create a Twitter Flow• Change the repeat into “interval” and every 5 minutes
to allow inject automatically every 5 minutes
Automatic every 5 minutes
Create a Twitter Flow• Add httpRequest node (in part “function”) to request
to web site, then double click to change parameter
Create a Twitter Flow• Enter URL : http://www.nationalgrid.com/ngrealtime/realtime/systemdata.aspx
• To request UK electricity consumption
Request URL
Create a Twitter Flow• Add a function node with and change output to 2
output by double click to change parameter
Create a Twitter Flow• Create function to parse the http response output to extract power
demand, frequency and time msg to output 1 , frq50 to output 2
Produce 2 Output
Create a Twitter Flow• Add a twitter node (part “social”) and double click to
edit property by double click (you need twitter account)
Set Account
Create a Twitter Flow• Modify function to send some data to twitter by create 3rd
variable and change output to 3, the 3rd output will tweet
The 3rd output to twitter