cancel
Showing results for 
Search instead for 
Did you mean: 

Node-Red - DatalayerContrib nodes

MauroRiboniMX
Established Member

Node-Red - DatalayerContrib nodes

Hi, 

I tried to use the "node-red-contrib-ctrlx-automation" nodes to setup a connection between node-red dashboard and the Datalayer. 

It works Flawlessly in the CtrlX-core using localhost as IP: 

2021-02-08_11h01_40.png

 I have some problem when i try to do the same thing using node-red in another device (external to ctrlx)

2021-02-08_11h02_40.png

 Is there something i am missing? Do i have to set some permissions in the CtrlX side?

10 REPLIES 10
CodeShepherd
Community Moderator

Re: Node-Red - DatalayerContrib nodes

There are quite less information about your settings of the communication. How did you set the Rexroth communication node?

In the ctrlX CORE there has nothing special to be done. You just need a user with the necessary rights but that's the same than on localhost.

MauroRiboniMX
Established Member

Re: Node-Red - DatalayerContrib nodes

Hi, 

The CtrlX ip address is the default one : 192.168.1.1. 

The user is the default "boschrexroth" which is the one working in localhost

Node-red is able to ping 192.168.1.1

Edit: the node-version is 1.2.1

Edit2: I was able to request a token and use plain rest api from node-red, without using the official nodes set. Thus the problem is inside the 
node-red nodes or i have done some wrong configuration. 

MauroRiboniMX_0-1612779716334.png

 

Krauskopf
Established Member

Re: Node-Red - DatalayerContrib nodes

Do you have the possibility to look into the log files of Node-RED? Maybe we can find additional hints there.

Depending on where you installed (linux, node-red) this might look different. E.g. on raspberry pi you can enter 'node-red-log'.

On linux you can also show the log by entering

sudo journalctl -f -u nodered -o cat

EDIT: It might also be interesting to know which nodejs version is installed on your system. Use 'node --version" for this.

 

 

MauroRiboniMX
Established Member

Re: Node-Red - DatalayerContrib nodes

I have done the following tries:

-standard node-red snap node-red 1.1.3, nodejs? something like 10, easily repeatable.

-my node-red snap: node-red 1.2.9, nodejs 10.22 (version catched while compiling) 

-windows node-red 1.2.9 node-js 14

EDIT:

The windows node-red starded working after a reboot. so i decided to investigate. moving from 

nodejs 10 to 14.15.4 in my snap solved the problem!

Here my snapcraft.yaml in case someone has same problem.

https://github.com/mauringo/node-red-industrial-snap/blob/master/snapcraft.yaml 

 

sudo snap node-red logs:

tmp.png

I am attaching also windows log in new2.txt and as screenshoot 

2021-02-08_21h46_47.png

Krauskopf
Established Member

Re: Node-Red - DatalayerContrib nodes

Thanks for the investigations and the detailed info. 👍

Will add a note to the readme, that at least nodejs 12.x is needed. This is also recommended by node-RED (https://nodered.org/docs/faq/node-versions).

MauroRiboniMX
Established Member

Re: Node-Red - DatalayerContrib nodes

Hi , 

In these days i am testing The node-red nodes because i am going to use them for a production demo with a customer.

The nodes works flawlessly and they are also working after several uptime hours, great job! 🚀

The only problem is that sometimes  the Node-Red snap is booting just before the Datalayer is ready and the nodes have difficulty to autenticate (i'm attaching a video and a picture). This happens with Node-red installed inside the CtrlX core and the behavior is happening 1 time over 5 reboots. 

is it possibe to add a node to trigger an autentication?

is it possible to add a node to get the authentication state? E.g that sends true if the system is authenticated or not?

This could be helpful also to manage the connection il the Node-red snap is not installed insidethe device. 

Really thanks for your time 😊

 

2021-02-14_16h29_22.png

carlo.mariani
Member

Re: Node-Red - DatalayerContrib nodes

Hello,

I agree with @Mauro, it could be useful to be able to perform authentication on demand.

I looked in the code but I haven't touched it, I would like to know your opinion so I write an issue on GitHub:

https://github.com/boschrexroth/node-red-contrib-ctrlx-automation/issues/14

btw: I really like the node it will be a very good tool for our customer, thanks!

 

Best regards

Carlo

Krauskopf
Established Member

Re: Node-Red - DatalayerContrib nodes

Hey guys,

thanks for the feedback.

Regarding the authentication:

  • The nodes are programmed in way, that they try a reauthentication and reconnect whenever the node is triggered. So intention is that the flows are "self healing".
  • Unfortunately, there is a bug, which brings this mechanism to stop in case the Data Layer is not available when the flow starts. But this will be fixed in the upcoming version 1.8 which will also introduce a new node for subscription (does not need to be triggered, but will emit a msg whenever the data has changed). The nodes will be released with the upcoming RM21.03.
    Krauskopf_0-1614094549689.png
  • Regarding the authentication information to be readable. Have you tried to catch the authentication issue with the catch node?

Krauskopf_1-1614094573946.png

 

Regards

Sebastian

 

carlo.mariani
Member

Re: Node-Red - DatalayerContrib nodes

Hello,

good to know that the node will be robust and will keep on trying to reconnect.

I was thinking more to allow authentication without using the node-red frontend (the config part of the node). How about giving the credentials through a message? I wrote an example and a more detailed description on GitHub.

Thanks

 

Regards

Carlo

Krauskopf
Established Member

Re: Node-Red - DatalayerContrib nodes

Hey Carlo,

let's continue the discussion in the github issue:

https://github.com/boschrexroth/node-red-contrib-ctrlx-automation/issues/14

Best Regards,

Sebastian

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist