Reading values from endNode in Node-RED

I’m working on trying to read values from an ASM1-6 Analog to Digital EndNode, and have been trying to piece together the proper input for the Wireless Gateway node from other posts (like EndNode 4ch Relay Input Commands Node red - #2 by TravisE_NCD_Technica).

I’ve come up with this so far, but unfortunately, I’m still not getting any output from the Wireless Gateway node.

Any advice?

Thanks in advance!

[
    {
        "id": "53ee41c1.bd371",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "5011ad9e.68fc74",
        "type": "ncd-gateway-node",
        "z": "53ee41c1.bd371",
        "name": "",
        "connection": "837142ce.132b28",
        "unknown_devices": true,
        "outputs": 2,
        "x": 790,
        "y": 440,
        "wires": [
            [
                "e76cd18b.8ffd3"
            ],
            [
                "bd6ed65e.b78308"
            ]
        ]
    },
    {
        "id": "bd6ed65e.b78308",
        "type": "debug",
        "z": "53ee41c1.bd371",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 1010,
        "y": 460,
        "wires": []
    },
    {
        "id": "e76cd18b.8ffd3",
        "type": "debug",
        "z": "53ee41c1.bd371",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 1020,
        "y": 420,
        "wires": []
    },
    {
        "id": "99814a71.f0a798",
        "type": "inject",
        "z": "53ee41c1.bd371",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 130,
        "y": 380,
        "wires": [
            [
                "46756e84.86d5f"
            ]
        ]
    },
    {
        "id": "46756e84.86d5f",
        "type": "function",
        "z": "53ee41c1.bd371",
        "name": "Set address and command",
        "func": "msg = {};\nmsg.payload = {};\nmsg.payload.address = \"00:13:A2:00:41:FF:43:AE\";\nmsg.payload.data = [0x35, 0x09, 0x01, 0x01, 0x00];\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 340,
        "y": 400,
        "wires": [
            [
                "52515058.9698"
            ]
        ]
    },
    {
        "id": "52515058.9698",
        "type": "function",
        "z": "53ee41c1.bd371",
        "name": "Add Checksum",
        "func": "var command = msg.payload.data;\nvar sum = 0x00;\nfor(i = 0; i < command.length; i++){\n    sum+=command[i];\n}\ncommand.push(sum&0xFF);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 580,
        "y": 420,
        "wires": [
            [
                "5011ad9e.68fc74"
            ]
        ]
    },
    {
        "id": "837142ce.132b28",
        "type": "ncd-gateway-config",
        "z": "",
        "name": "",
        "comm_type": "serial",
        "ip_address": "",
        "tcp_port": "2101",
        "port": "/dev/ttyS1",
        "baudRate": "115200",
        "pan_id": "7FFF",
        "rssi": true
    }
]

Update - I’ve realized that I was missing the first two bytes from the command, but after adding those, I’m still getting no response/output from the Wireless Gateway node.

Updated flow:

[
    {
        "id": "53ee41c1.bd371",
        "type": "tab",
        "label": "EndNode Test",
        "disabled": false,
        "info": ""
    },
    {
        "id": "5011ad9e.68fc74",
        "type": "ncd-gateway-node",
        "z": "53ee41c1.bd371",
        "name": "",
        "connection": "837142ce.132b28",
        "unknown_devices": true,
        "outputs": 2,
        "x": 790,
        "y": 440,
        "wires": [
            [
                "e76cd18b.8ffd3"
            ],
            [
                "bd6ed65e.b78308"
            ]
        ]
    },
    {
        "id": "bd6ed65e.b78308",
        "type": "debug",
        "z": "53ee41c1.bd371",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 1010,
        "y": 460,
        "wires": []
    },
    {
        "id": "e76cd18b.8ffd3",
        "type": "debug",
        "z": "53ee41c1.bd371",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 1020,
        "y": 420,
        "wires": []
    },
    {
        "id": "99814a71.f0a798",
        "type": "inject",
        "z": "53ee41c1.bd371",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 130,
        "y": 380,
        "wires": [
            [
                "46756e84.86d5f"
            ]
        ]
    },
    {
        "id": "46756e84.86d5f",
        "type": "function",
        "z": "53ee41c1.bd371",
        "name": "Set address and command",
        "func": "msg = {};\nmsg.payload = {};\nmsg.payload.address = \"00:13:A2:00:41:FF:43:AE\";\n//Command without checksum\nmsg.payload.data = [0xAA, 0x05, 0x35, 0x09, 0x01, 0x01, 0x00];\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 340,
        "y": 400,
        "wires": [
            [
                "52515058.9698"
            ]
        ]
    },
    {
        "id": "52515058.9698",
        "type": "function",
        "z": "53ee41c1.bd371",
        "name": "Add Checksum",
        "func": "var command = msg.payload.data;\nvar sum = 0x00;\nfor(i = 0; i < command.length; i++){\n    sum+=command[i];\n}\ncommand.push(sum&0xFF);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 580,
        "y": 420,
        "wires": [
            [
                "5011ad9e.68fc74",
                "32cf60b4.bb5ff"
            ]
        ]
    },
    {
        "id": "32cf60b4.bb5ff",
        "type": "debug",
        "z": "53ee41c1.bd371",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "x": 870,
        "y": 340,
        "wires": []
    },
    {
        "id": "837142ce.132b28",
        "type": "ncd-gateway-config",
        "z": "",
        "name": "",
        "comm_type": "serial",
        "ip_address": "",
        "tcp_port": "2101",
        "port": "/dev/ttyS1",
        "baudRate": "115200",
        "pan_id": "7FFF",
        "rssi": true
    }
]

Hi DJ,

Everything in your flow looks correct. All bytes are there and the checksum appears to be correct.

Can you verify whether the LED on the End Node device flashes when you press the Inject button in the flow?

Hey Travis -

I’m not seeing any flashes of the end node device. The light remains solid green.

I did test with a USB cable to ensure the device was working properly, and I have no problem connecting with it that way.

Are you using an IoT Edge Computer or are you running Node-Red on a computer connected to a USB or Ethernet modem?

If you’re using a USB modem connected to a computer you could try running X-CTU and see if you can discover the EndNode wireless module. I have a video here about how to use X-CTU for range testing and troubleshooting:

1 Like

Hey Travis -

We are currently using Node-Red on an IoT Edge computer. Is there another solution we could try on there?

Hey Travis -

I swapped the radio from the EndNode into the IOT edge computer, powered it back on, and node red is now showing “failed to connect” for the Wireless Gateway node.

Does this indicate erroneous settings? Or a faulty radio?

I also ordered a USB modem with next-day shipping so I use X-CTU if needed.

Thanks!

@TravisE_NCD_Technica - I received the USB Modem today and fired up XCTU.

When I run a scan, the only module showing up is the one inside of our IoT edge computer. We are not seeing the module in the endNode. I tried power cycling the end node and clicking the configuration button while the scan was running, but it still didn’t appear.

How should we proceed from here?

EDIT: I swapped the radio from the USB modem and the end-Node, and my flow immediately starting working (after updating the address, of course). So it seems like the radio that shipped in the end-node is faulty?

Hi,

Install the module from the EndNode board into the Zigmo board. Then launch X-CTU, select the COM port, Set baud rate to 115200 and click OK. Then click the settings cog in the software to read the settings out of the module. Settings which are not default will highlight. Let me know what settings you see which are not default and let me know what they are set to.

@TravisE_NCD_Technica

Thanks for the reply.

When I install the radio module from the endNode into the Zigmo, I’m not able to discover it at 19200 or 115200. However I can discover it at 9600.

Perhaps this baud rate is the reason it wasn’t communicating with the endNode?

Am I able to change the baud rate with XCTU? If so, what should it set it to in order to work properly in the endNode?

Yep, that’s the problem. The baud rate needs 115200. The other setting I would check is sleep mode, you want to make sure that is set to 0(Normal Mode). Try that and install back in the EndNode device and let me know what you find.

Hey @TravisE_NCD_Technica -

I tried adjusting the baud rate to 115200 and re-installing it into the endNode, but still no luck.

I noticed when I was in XCTU that a message popped up about the module being in Transparency mode, so I wondered if some other settings were off.

I took a profile of the module that came with the Zigmo, and then applied that profile to the module that came in the endNode, but even that hasn’t solved the issue.

Are there some other settings I could check that wouldn’t have been set by the profile?

can you send a screenshot of the module settings?

Hi @Bhaskar -

Here you go! These are the settings from the non-working module that came in the endNode after I applied the settings profile from the (working) module that came in the Zigmo.



all the settings look good.

  1. if you scan for the remote XBee, does the end node xbee shows up?

Thanks

@Bhaskar

Just tried scanning again to confirm.

When I perform a scan using the (working) original Zigmo module, I see the module installed on the Zigmo, and the module installed in the IoT Edge computer, but I do not see the module installed in the EndNode.

I tried power cycling the endNode again during the scan, but it still didn’t show up.

EDIT: If I do a scan using the non-working EndNode radio module on the Zigmo, no other modules show up.

connect the non-working radio module to xctu and share screenshots of the settings

Hey @Bhaskar -

Sorry, maybe there was a miscommunication.

The screenshots above are from the non-working radio module out of the endNode.

Please send me a meeting invite at bhaskar@ncd.io

The encryption key was not set. Default key is 55AA55AA55AA55AA55AA55AA55AA55AA