Tag: node-red

Node-red 1.1 released with several new features

 

Uncategorized

I am creating a server (Centos 8) to develop a system that will use an application using REACT as a front end to show data from different sensors. I will use NGINX as a webserver and Node-red as a back end. In this first post I describe how to install NGINX.

Install nginx package using the yum command on CentOS 8:

sudo yum update
sudo yum install nginx

Update firewall settings and open TCP port 80 and 443. Run:

sudo firewall-cmd –permanent –zone=public –add-service=https –add-service=http
sudo firewall-cmd –reload

Enable nginx service by running systemctl command so that it starts at server boot time:

sudo systemctl enable nginx

start the service, run:

sudo systemctl start nginx

Commands to start/stop/restart nginx server

Run command as per your needs.

sudo systemctl start nginx  <– start the server ##
sudo systemctl stop nginx  <– stop the server ##
sudo systemctl restart nginx  <– restart the server ##
sudo systemctl reload nginx  <– reload the server ##
sudo systemctl status nginx  <– get status of the server ##

You must open and enable port 80 and 443 using the firewall-cmd command:

sudo firewall-cmd –permanent –zone=public –add-service=http –add-service=https
sudo firewall-cmd –reload
sudo firewall-cmd –list-services –zone=public

Now nginx is installed. Bellow are some important directories (defaults) i

Config directory – /etc/nginx/
Maibn global config file – /etc/nginx/nginx.conf
TCP ports opened by Nginx – 80 (HTTP), 443 (HTTPS)
Default web document root directory – /usr/share/nginx/html
Access log file – /var/log/nginx/access.log
Error log file – /var/log/nginx/error.log

IoT Linux web

Node-Red 1.0 released today.

Some new features:

Asynchronous message passing

This release changes the message passing between nodes to be always asynchronous rather than it being sometimes asynchronous and sometimes synchronous depending on the implementation of individual nodes.

Node Send API

Nodes now have a new API available for how they handle messages in the runtime. This API allows them to tell the runtime when they have finished with a message.

This will help the runtime to track nodes as they flow through the system – enabling future features such as automatic timeouts of nodes.

To go along with this change, we’ve introduced a new Complete node. This node can be targeted at another node, like the Catch node, and it will be triggered when the targeted node finishes handling a message.

Cloning messages

A knock-on effect of the async messaging change is a change to how the Function node clones messages. It used to avoid cloning messages if it could, but this led to hard to detect issues once the async message change was introduced.

So now the Function node will also clone all of the messages you pass to node.send().

If you have a flow that depends on the message not being cloned, you’ll need to update your flow to request the runtime not to do the cloning.

 

Read  more information here

 

IoT

One of my apps does not start after a restart. I changed several things on the Node-Red app and i think the restart will be a good idea.

On the logs view there was no good messages to see what is happening with Node-Red

So i start the terminal and go to use IBM cloud CLI

to get the app log just logon and type ibmcloud cf logs [appname] > log.txt

I saw the following messages

[CELL/0] OUT Cell a64da35a-93fb-4f76-abd8-219869380b84 creating container for instance 6b30e79e-2853-4199-4c3e-1cc0
2019-09-04T13:54:47.36-0300 [CELL/0] OUT Cell a64da35a-93fb-4f76-abd8-219869380b84 successfully created container for instance 6b30e79e-2853-4199-4c3e-1cc0
2019-09-04T13:54:55.45-0300 [CELL/0] OUT Starting health monitoring of container
2019-09-04T13:55:06.64-0300 [APP/PROC/WEB/0] OUT > [email protected] start /home/vcap/app
2019-09-04T13:55:06.64-0300 [APP/PROC/WEB/0] OUT > node –max-old-space-size=180 index.js –settings ./bluemix-settings.js -v
2019-09-04T13:55:06.98-0300 [APP/PROC/WEB/0] OUT 4 Sep 16:55:06 – Starting Node-RED on IBM Cloud bootstrap
2019-09-04T13:55:06.98-0300 [APP/PROC/WEB/0] OUT 4 Sep 16:55:06 – Loading bluemix-settings.js
2019-09-04T13:55:07.18-0300 [APP/PROC/WEB/0] OUT 4 Sep 16:55:07 – Failed to find Cloudant service: /^IoT-Cool.cloudantNoSQLDB/
2019-09-04T13:55:07.19-0300 [APP/PROC/WEB/0] ERR module.js:478
2019-09-04T13:55:07.19-0300 [APP/PROC/WEB/0] ERR throw err;
2019-09-04T13:55:07.19-0300 [APP/PROC/WEB/0] ERR ^
2019-09-04T13:55:07.19-0300 [APP/PROC/WEB/0] ERR Error: Cannot find module ‘./node_modules/node-red/red/runtime/storage/localfilesystem’

Node-Red was unable  connect to Cloudant. But not was changed on Cloudant side.

I changed the Title of the app to another name before the restart, that was the cause of the problem.

I think there is a relation between the APP name and the Cloudant Service linked to the app

After i change the app name to the old one, Node-Red starts again.

 

 

 

IoT Uncategorized

This is the first public beta release of Node-RED 1.0.

The changes in this release are mostly focused on the editor – and there are some significant changes in there.

More info here

Installing the beta

If you want to try out the beta, you will need specify node-red@next when you use npm to update. Without the @next you’ll still get 0.20.x.

So on a Pi you’d do:

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

IoT

Uncategorized