UIBuilder Sender Node no Response

I am trying to get a response from the UIBuilder instance, after using a injection node to a sender node to a debug node.

I have set the originator in the response message but I am not getting the hang of it. Receiving messages from front-end to node-red is no issue.
I just would like to see a good example of how to set up the response message for the sender node.

I used the following JS code:

import '../../uibuilder/uibuilder.esm.min.js'
uibuilder.onChange('msg', (msg) => {
     console.log(msg);
     if(msg._uib && msg._uib.originator)
     {
         let response = {
              topic: 'CHECK',
              payload: 'pong',
              _uib: { 
                    originator: msg._uib.originator
              },
      };
      console.log(response);
      uibuilder.send(response);}
})

Do i need to set up a different parameter aswell or something else? I checked out UIBUILDER Documentation v7 but to no avail.

Everything in the screenshot works, except receiving the response data in the response data debug node. Which is where I am trying to return the Send Ping injection with a Pong:

Cheers,

Rob

I could be wrong, but you have…

_uib: { 
          originator: msg._uib.originator
         },

shouldn't you have included the sender node's id, something like;

_uib: { 
          originator: "7e0daf8bed068cfe"
         },

The node readme say's;
When returning a message, include the _uib.originator property with a value of the sender node's node ID. You can get that by sending a message through the sender node.

Hi Rob and welcome to the forum.

How to use the originator is documented here:

If all messages should go back to the same originator, you can set it using uibuilder.setOriginator('xxxxxxxxxxxx') or, for a specific message, you can use uibuilder.send(msg, 'xxxxxxxxx') where the x's are the originator ID from msg._uib.originator

Hi and thank you and @Paul-Reed for the quick response!

I have tried both methods of setting the originator and set it message specific.
I am however having trouble receiving this particulair message. I do not seem to realise anything that is off. I confirmed the originator is set properly and simular as the original message.

See screenshot of console.log:

I have also shared my simple test flow with my current code. I believe it should be copy’able.

Rob

[
    {
        "id": "eb3b78bce9daaeed",
        "type": "tab",
        "label": "UI Navigation",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "02fa133eee9ba3be",
        "type": "group",
        "z": "eb3b78bce9daaeed",
        "name": "UI Communication Example",
        "style": {
            "label": true
        },
        "nodes": [
            "49c9aee1fb65d9db",
            "daaf17478b89feb0",
            "f5fac2d4f61ede18"
        ],
        "x": 108,
        "y": 59,
        "w": 944,
        "h": 308
    },
    {
        "id": "daaf17478b89feb0",
        "type": "group",
        "z": "eb3b78bce9daaeed",
        "g": "02fa133eee9ba3be",
        "name": "Send Command/Data / Receive Command/Data",
        "style": {
            "label": true
        },
        "nodes": [
            "3e3ccf70407e0492",
            "6756c553dbc5c3e0",
            "0993ceca16973cba"
        ],
        "x": 134,
        "y": 139,
        "w": 892,
        "h": 82
    },
    {
        "id": "f5fac2d4f61ede18",
        "type": "group",
        "z": "eb3b78bce9daaeed",
        "g": "02fa133eee9ba3be",
        "name": "Send Command/Data (and get response)",
        "style": {
            "label": true
        },
        "nodes": [
            "f669e9c29c0ed4f1",
            "3ba738b136ed6003",
            "3fc1ae1b57e4f07d"
        ],
        "x": 134,
        "y": 259,
        "w": 892,
        "h": 82
    },
    {
        "id": "3e3ccf70407e0492",
        "type": "debug",
        "z": "eb3b78bce9daaeed",
        "g": "daaf17478b89feb0",
        "name": "Receive Data",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 900,
        "y": 180,
        "wires": []
    },
    {
        "id": "f669e9c29c0ed4f1",
        "type": "inject",
        "z": "eb3b78bce9daaeed",
        "g": "f5fac2d4f61ede18",
        "name": "Send Ping",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            },
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "CHECK",
        "payload": "ping",
        "payloadType": "str",
        "x": 240,
        "y": 300,
        "wires": [
            [
                "3ba738b136ed6003"
            ]
        ]
    },
    {
        "id": "3ba738b136ed6003",
        "type": "uib-sender",
        "z": "eb3b78bce9daaeed",
        "g": "f5fac2d4f61ede18",
        "url": "communication",
        "uibId": "6756c553dbc5c3e0",
        "name": "Sender",
        "topic": "",
        "passthrough": false,
        "return": true,
        "outputs": 1,
        "x": 480,
        "y": 300,
        "wires": [
            [
                "3fc1ae1b57e4f07d"
            ]
        ]
    },
    {
        "id": "3fc1ae1b57e4f07d",
        "type": "debug",
        "z": "eb3b78bce9daaeed",
        "g": "f5fac2d4f61ede18",
        "name": "Response Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 900,
        "y": 300,
        "wires": []
    },
    {
        "id": "49c9aee1fb65d9db",
        "type": "comment",
        "z": "eb3b78bce9daaeed",
        "g": "02fa133eee9ba3be",
        "name": "Documentation",
        "info": "https://totallyinformation.github.io/node-red-contrib-uibuilder/",
        "x": 240,
        "y": 100,
        "wires": [],
        "icon": "font-awesome/fa-commenting-o"
    },
    {
        "id": "0993ceca16973cba",
        "type": "inject",
        "z": "eb3b78bce9daaeed",
        "g": "daaf17478b89feb0",
        "name": "Send Hello World",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "hello world!",
        "payloadType": "str",
        "x": 260,
        "y": 180,
        "wires": [
            [
                "6756c553dbc5c3e0"
            ]
        ]
    },
    {
        "id": "6756c553dbc5c3e0",
        "type": "uibuilder",
        "z": "eb3b78bce9daaeed",
        "g": "daaf17478b89feb0",
        "name": "Communication Example",
        "topic": "",
        "url": "communication",
        "okToGo": true,
        "fwdInMessages": false,
        "allowScripts": false,
        "allowStyles": false,
        "copyIndex": true,
        "templateFolder": "blank",
        "extTemplate": "",
        "showfolder": false,
        "reload": true,
        "sourceFolder": "src",
        "deployedVersion": "7.2.0",
        "showMsgUib": false,
        "title": "",
        "descr": "",
        "editurl": "vscode://file\\Users\\Interko\\.node-red\\uibuilder/communication/?windowId=_blank",
        "x": 590,
        "y": 180,
        "wires": [
            [
                "3e3ccf70407e0492"
            ],
            []
        ]
    }
]

Let me try out your flow. It is perfectly possible that I've broken the feature somewhere along the way as I rarely use it myself. :smiley:

No worries! I wouldnt be surprised if I messed up thing myself :slight_smile:

Thank you for the bizarre quick responses though!

OK, I have reproduced the same issue - it's not you!

You get what you pay for .... no, wait, what! :smiley:

:rofl:

All good, thank you for the testing too. Now I know I can let this bug pass my mind instead of going crazy :wink:

Cheers!

I have found and fixed the issue. But do you need the fix asap or can it wait until v7.5 is released?

Hi, I do not have alot of haste. Its already good that you were able to solve it!
Up to you!

1 Like

Thanks for the confirmation - v7.5 it will be :smiley:

Got a few juicy things to finish off for the new release but they are well under way.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.