2. 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
11. Create a Twitter Flow
• Create inject, debug, httpRequest, function, and
twitter nodes.
• Create tweet some informations about the live UK
total electricity consumption
12. Create a Twitter Flow
• Add a inject node and change its parameter, by
double click
13. Create a Twitter Flow
• Change the repeat into “interval” and every 5 minutes
to allow inject automatically every 5 minutes
Automatic
every 5 minutes
14. Create a Twitter Flow
• Add httpRequest node (in part “function”) to request
to web site, then double click to change parameter
15. Create a Twitter Flow
• Enter URL : http://www.nationalgrid.com/ngrealtime/realtime/systemdata.aspx
• To request UK electricity consumption
Request URL
16. Create a Twitter Flow
• Add a function node with and change output to 2
output by double click to change parameter
17. 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
19. 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
21. 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
22. Create a Twitter Flow
• Wire the 3rd of UK electricity to twitter then deploy
The tweet data