Here is Getting Started Guide with Node-RED for ESP32 Arduino to Learn on localhost & IBM Cloud. Node-RED is a way to visualize data on IBM Watson IoT platform. In our earlier guides, we supplied the required sketches/snippets for ESP32 Arduino to send data to IBM Watson IoT platform. But any user will not be satisfied with only sending data to IBM Watson IoT platform, they will expect to see real-time graphs.
Node-RED was originally created by IBM emergenging technology. It is an open source software. It is a flow-based development tool for visual programming for wiring together hardware devices, APIs and online services as part of the Internet of Things. You will Node-RED not only for ESP32, but also for several other boards. As step of learning, we should first install it on localhost to get used with the basics. Later, we can easily launch instance of Node-RED on IBM Cloud and connect our ESP32.
Installing Node-RED on localhost
Node-RED has following different components. Node-RED visual tool for wiring the Internet of Things :
---
1 | https://github.com/node-red/node-red |
Node-RED Dashboard UI :
1 | https://github.com/node-red/node-red-dashboard |
Node generator command line tool to generate Node-RED node modules from several various sources, including Open API document and function node’s source :
1 | https://github.com/node-red/node-red-nodegen |
Node-RED command Line Tool to remotely administer a Node-RED instance :
1 | https://github.com/node-red/node-red-admin |
In case of IBM Cloud’s Node-RED we are getting them running in preconfigured manner. Node-RED has dedicated website with detailed guide. Like for installation of Node-RED on Microsoft Windows 10 :
1 | https://nodered.org/docs/platforms/windows |
First we will download and install Node.js for Windows :
1 | https://nodejs.org/en/ |
Then we will launch Windows Powershell, and issue the following commands :
1 2 3 4 5 6 7 8 9 | # check whether node & npm installed node --version; npm --version # install node-red npm install -g --unsafe-perm node-red |
Starting Node-RED will require only node-red
command :
1 | https://nodered.org/docs/platforms/windows#running-on-windows |
You can open http://localhost:1880
on your browser to view the web UI. You will get guide to create flow :
1 | https://nodered.org/docs/getting-started/first-flow |
You can add normal Arduino (like UNO, not ESP32) with Node-RED :
1 | https://nodered.org/docs/hardware/arduino |
Playing around Node-RED will make you used with the thing and help to become easy to work with Node-RED on IBM Cloud as production instance.
Installing Node-RED on IBM Cloud
Go to control panel of IBM Cloud/Bluemix (I use console.bluemix.net
). We will use Bluemix Node-RED Starter.
Go to catalogue and search for “Node-RED Starter”. Choose “Node-RED Starter” and fill information. You’ll get 375 GB/hr per month free. With that, you can easily test, run and delete the instance after working. Here is documents for Node-RED on IBM Cloud :
1 | https://cloud.ibm.com/docs/runtimes/nodejs?topic=Nodejs-getting-started#getting-started |
Click “Create” button and wait for 10-15 minutes to get the things deployed (you’ll get 404 Not Found out of doing hurry). As soon the instance gets deployed, you can add username, password through the web wizard and login to Node-RED flow editor.
Now, we need to connect our Node-RED starter instance with our already created IBM Watson IoT Platform service of our previous guide. From dashboard and Cloud Foundry Apps, go the Node-RED app dashboard. Go to “Connections” > “Connect Existing Compatible Service”. Add “Internet of Things” app and you’ll get thing kind of message :
1 2 3 | Restage app Your 'thecustomizewindows' app must be restaged to use the new 'Internet of Things Platform-sc' service. Restaging makes this service available for use. Do you want to restage it now? |
Click “Restage”. It will take some time. Now you can play with IBM Cloud’s Node-RED flow editor making ESP32 active.
Tagged With node red esp32 , node-red esp32 , esp32 nodered cloud , nodered esp32 , esp32 nodered , nodejs for esp32 , esp32 node-red , esp32 node red , ibm cloud iot dashboard devicelist , node-RED