Wednesday, August 23, 2017

Playing with Node Red on my MAC

For this semester I'll be teaching two courses at NUST. One is an undergraduate course whereas the other is a graduate course. This is my first time with both of these courses, so there is a bit of excitement and apprehension if I'll be able to deliver my lectures in a great way. There are only a couple of weeks left in the classes so I've started playing around with technologies that I might be utilizing in delivering my lectures. Today I'm playing with Node-Red to build basic web applications. The idea is to play with it on my laptop then shift to an embedded computer like the Raspberry PI to build a practical daily use application.

The first step I did was to navigate to the node-red website and install the node and npm package using the pkg file on the website. Since I'm using MAC I needed this one.

https://nodejs.org/en/download/



Since I have npm installed on my MAC the other method of installing node-red was to use the following command in terminal


sudo npm install -g --unsafe-perm node-red

Once node-red is installed, run the node-red command to see the following output

$ node-red

Welcome to Node-RED
===================

25 Jun 22:51:09 - [info] Node-RED version: v0.17.4
25 Jun 22:51:09 - [info] Node.js  version: v6.11.1
25 Jun 22:51:09 - [info] Loading palette nodes
25 Jun 22:51:10 - [warn] ------------------------------------------
25 Jun 22:51:10 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
25 Jun 22:51:10 - [warn] ------------------------------------------
25 Jun 22:51:10 - [info] Settings file  : /home/nol/.node-red/settings.js
25 Jun 22:51:10 - [info] User Directory : /home/nol/.node-red
25 Jun 22:51:10 - [info] Server now running at http://127.0.0.1:1880/
25 Jun 22:51:10 - [info] Creating new flows file : flows_noltop.json
25 Jun 22:51:10 - [info] Starting flows
25 Jun 22:51:10 - [info] Started flows

If you see this output that means node-red was successfully installed and now you can  run it in your browser by typing the following in your browser bar

http://localhost:1880

If you know the ip address of your laptop then you can remotely run Node-red over the network. 



In order to make your first flow using node-red use the following tutorial. In fact I've followed it to explore node-red for the first time on my own and run my first two examples. 


Total credits for this blog post are to be given to : https://nodered.org/docs/getting-started/first-flow 
My next step to follow the same tutorial to deploy Node-Red on a Raspberry PI and make some physically interactive application. Till then Allah Nigehbaan!


No comments:

Post a Comment