Get endNode running with 900HP-S3B and Node-RED?

I have a gateway up and running that’s connected to the 900HP-S3B and is happily communicating with a “Smart Industrial IoT Wireless Vibration Temperature Sensor”. I’d like to also interact with my new “Wireless 4-20mA 4-Channel Input endNode”, but I’m not seeing it connect to the modem.

I’m not using Alpha Station… just Node-RED.

How can I get the endNode connected to my system?

Thanks! :slight_smile:

Hi,

Can you share a screen shot of Node-Red so we can see the flow and the debug panel in Node-Red?

End Node units do not transmit unless requested to. Perhaps this is not your intended functionality. If you want units that transmit on interval like your vibration sensor then I would recommend one of these:

You can setup a flow in Node-Red to send a read request to the End Node unit on interval. If you would like to explore this please provide a link to the End Node product you have.

Thank you,
Travis Elliott

Ah! I didn’t know this. Here is the endNode I have. Are there any example flows anywhere? Where can I learn more?

OK, I’ve tried using the API Calculator to create the “Test 2-Way Communications” command to send to “all endNodes”. Here’s the flow and debug, and the code from the function node. I’m not seeing anything coming in.

const address = "00:13:a2:00:00:00:00:ff"

const str = "7E 00 13 10 00 00 13 A2 00 00 00 00 FF FF FE 00 C0 AA 02 FE 21 CB E8"
const data_array = str.split(" ").map( d => parseInt(d,16) )

return {
    payload: {
        data: data_array,
        address
    }
}

Is there something I’m doing incorrectly?

Here is a sample flow:

You’ll need to set the address to the serial address of your endnode device in the assign target node in order for it to work.

Also I don’t have a unit at my desk to test this so let me know what you find. Commands for the device can be found here under section 9.4:

Thank you,
Travis

Thank you, Travis. That’s still not getting me anything.

Is there maybe a step I need to take to get the endNode to “join” the network? I’ve only simply powered it up.

If you click the inject node do you see the LED on the End Node flash indicating it received data? Also are you sure you set the address in the assign target node correctly to the address of the End Node device?

When I trigger the flow you sent (with the definitely correct address), I see the LED go blue for about 1 second. I see no data coming into debug (and debug output is enabled).

On the "“Test 2-Way Communications” I shared above, when I trigger I see the green LED blink almost imperceptibly; also no data in debug.

Interestingly (to me), the “Test 2-Way Communications” seems to do nothing at all, either with the endNode or with the other device on the network (a Smart Industrial IoT Wireless Vibration Temperature Sensor).

The latter is sending normal sensor data in just fine, but neither one does any kind of acknowledgement of that “test” message.

@TravisE_NCD_Technica, are there any debugging steps I can take? I’m working through Node-RED through a USB gateway. I’m on a Mac and so I can’t run Alpha Station.

Hi @papakpmartin Could you share your current Node-RED flow so I can take a look at it? To do this, click on the main menu and select the Export option.

Then select the Current Flow option and click the Download button.

Could you attach the .JSON file to this thread, please?
Thank you,
Eduardo M.

Sure! Here you go. This is simply grabbing everything that comes in and storing it in an array.

This flow is working great to gather data from my vibration sensor by means of the USB modem. The endNode is powered up, but I don’t seem to be able to make it do anything.

Interestingly, I moved the USB modem to my Mac and installed X-CTU and on that configuration I’m able to see the USB modem and the endNode, but not the vibration sensor!

simple-ncd-flow.json (1.7 KB)

Hi @papakpmartin As Travis mentioned, to receive data from the EndNode device, you need to send a data request command each time. Once the device receives this command, it will respond with the requested values. I recommend importing the example flow that Travis shared in the previous post into your workspace.

The flow you shared with me only includes the Wireless Gateway node, two debug nodes, a function node, along with an inject and change node. This flow will allow you to receive data from your vibration sensor, as the sensor sends data periodically without needing a request. (but not from EndNode device)

You could try importing the flow that Travis shared, configure it, and then share some screenshots of the settings you’ve applied. One additional recommendation I have is to ensure that you select “/dev/ttyUSB0” as the ‘Serial Device’ property inside the Wireless Gateway node.

Please try this and let me know if you need further assistance!
Thank you,
Eduardo M.

Ah sure… I just gave you the one that gets some data. Here’s the one Travis shared, and it has the correct target assigned, and the configuration node is the same one as for the previous flow, and does have /dev/ttyUSB0 defined.

The previous flow proves (I think) that the connection to the USB modem is working fine, and that the modem can do something, since it’s receiving the vibration data just fine.

ncd-endnode-flow.json (3.1 KB)

Also, I added a debug to the flow Travis shared after the “Assign Target” node so you can see precisely what’s being sent (see pic).

Note that when I send this, the green LED on the endNode goes blue for about 1 second, but I see no data coming back in from it through the Wireless Gateway node.

Hi @papakpmartin Got it, thank you for the feedback! It looks like your setup is correct. Could you try importing this flow and testing it, please? Just make sure to select the correct serial port (/dev/ttyUSB0) in the Wireless Gateway node.

[{"id":"b8939b6d8dda5c38","type":"tab","label":"EndNode 4-20mA Input Example","disabled":false,"info":"","env":[]},{"id":"e748227717d1a963","type":"group","z":"b8939b6d8dda5c38","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["9b482dfa51a27c65","c4122250458ad048","559cd5f599c3e3be"],"x":534,"y":299,"w":432,"h":242},{"id":"63130894d3a55fdb","type":"group","z":"b8939b6d8dda5c38","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["6966003bfc36520b","f13dc22483fd2696"],"x":1014,"y":299,"w":472,"h":142},{"id":"f7dea52a82065166","type":"group","z":"b8939b6d8dda5c38","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["466b5b61fa269d89","ce1f5a90e8af3f9c","1936a330c5307f7a"],"x":54,"y":299,"w":432,"h":142},{"id":"6966003bfc36520b","type":"ncd-gateway-node","z":"b8939b6d8dda5c38","g":"63130894d3a55fdb","name":"","connection":"","unknown_devices":true,"outputs":2,"x":1150,"y":400,"wires":[["e3df83fd38dbf123"],["e3df83fd38dbf123"]]},{"id":"466b5b61fa269d89","type":"function","z":"b8939b6d8dda5c38","g":"f7dea52a82065166","name":"Set C1 4mA Cmd","func":"msg.payload = {};\nmsg.payload.data = [0xAA, 0x05, 0x35, 0x06, 0x01, 0x04, 0x00, 0xEF];\n// msg.payload.address = \"00:13:a2:00:41:db:8c:15\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":400,"wires":[["c4122250458ad048"]]},{"id":"ce1f5a90e8af3f9c","type":"inject","z":"b8939b6d8dda5c38","g":"f7dea52a82065166","name":"Read","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":400,"wires":[["466b5b61fa269d89"]]},{"id":"9b482dfa51a27c65","type":"comment","z":"b8939b6d8dda5c38","g":"e748227717d1a963","name":"Change address to match your endnode controller","info":"","x":750,"y":340,"wires":[]},{"id":"c4122250458ad048","type":"change","z":"b8939b6d8dda5c38","g":"e748227717d1a963","name":"Assign Target","rules":[{"t":"set","p":"payload.address","pt":"msg","to":"00:13:a2:00:41:db:8c:15","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":400,"wires":[["6966003bfc36520b","559cd5f599c3e3be"]]},{"id":"e3df83fd38dbf123","type":"debug","z":"b8939b6d8dda5c38","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1580,"y":400,"wires":[]},{"id":"f13dc22483fd2696","type":"comment","z":"b8939b6d8dda5c38","g":"63130894d3a55fdb","name":"Edit the Wireless Gateway to assign your serial device","info":"","x":1260,"y":340,"wires":[]},{"id":"1936a330c5307f7a","type":"comment","z":"b8939b6d8dda5c38","g":"f7dea52a82065166","name":"Read Inputs 1-4","info":"","x":160,"y":340,"wires":[]},{"id":"559cd5f599c3e3be","type":"debug","z":"b8939b6d8dda5c38","g":"e748227717d1a963","name":"endNode req payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":500,"wires":[]}]

Please try this and share us your results.
Thank you,
Eduardo M.

That answered back! :slight_smile:

I changed the debug to “complete msg object” so you can see the whole thing.

So what does this tell me?

I’m suspecting that the sample flow was wrong, declaring the wrong number of bytes in the command?

Great! Yes, it was a typo. Let me explain: in the msg.payload.data, the 0 and 1 elements represent the header message, while the 4-20mA data for the four channels are contained in elements 2 to 9 of the array.

The data is formatted as shown below:

MSB Channel 1, LSB Channel 1, MSB Channel 2, LSB Channel 2, MSB Channel 3, LSB Channel 3, MSB Channel 4, LSB Channel 4
image

Now you can convert the returned values into real-world 4-20mA values. I’ve created a Node-RED flow that allows you to extract the individual values.

[{"id":"a0c9e72b55f333f9","type":"debug","z":"8c51d1a367a55d26","name":"Channel 1","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1190,"y":660,"wires":[]},{"id":"299b622ba518300a","type":"function","z":"8c51d1a367a55d26","name":"ncd-convert-hex-to-real-world","func":"let msg1 = {};\nlet msg2 = {};\nlet msg3 = {};\nlet msg4 = {};\n\nlet adc_1 = msg.payload.data.slice(2, 4).reduce(msbLsb);\nlet adc_2 = msg.payload.data.slice(4, 6).reduce(msbLsb);\nlet adc_3 = msg.payload.data.slice(6, 8).reduce(msbLsb);\nlet adc_4 = msg.payload.data.slice(8, 10).reduce(msbLsb);\n\nmsg1.payload = adc_1;\nmsg2.payload = adc_2;\nmsg3.payload = adc_3;\nmsg4.payload = adc_4;\n\n/*\n    msg1.payload = adc_1 * 0.0013568521031208\n    msg2.payload = adc_2 * 0.0013568521031208\n    msg3.payload = adc_3 * 0.0013568521031208\n    msg4.payload = adc_4 * 0.0013568521031208\n*/\n\nfunction msbLsb(m, l) { return (m << 8) + l; }\n\nreturn [msg1, msg2, msg3, msg4];","outputs":4,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":760,"wires":[["a0c9e72b55f333f9"],["ca51e8c0a0fe4083"],["515e267b1890b806"],["f0fe1e523ece4feb"]]},{"id":"ca51e8c0a0fe4083","type":"debug","z":"8c51d1a367a55d26","name":"Channel 2","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1190,"y":720,"wires":[]},{"id":"515e267b1890b806","type":"debug","z":"8c51d1a367a55d26","name":"Channel 3","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1190,"y":780,"wires":[]},{"id":"f0fe1e523ece4feb","type":"debug","z":"8c51d1a367a55d26","name":"Channel 4","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":1190,"y":840,"wires":[]},{"id":"2278f8e6f902d601","type":"switch","z":"8c51d1a367a55d26","name":"ncd-filter-by-addr","property":"payload.addr","propertyType":"msg","rules":[{"t":"eq","v":"00:13:a2:00:42:3d:0c:4d","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":760,"wires":[["299b622ba518300a"]]},{"id":"70176ab8b7c56f39","type":"switch","z":"8c51d1a367a55d26","name":"ncd-filter-by-topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"unknown_data","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":760,"wires":[["2278f8e6f902d601"]]}]

Could you copy and import the flow into your workspace? Then, connect the second output of the Wireless Gateway node to the input of the ncd-filter-by-topic node. After that, click the Deploy button to save and apply the changes. You should see something like this:

Next, when you send the request command and the EndNode returns values, you should see something like this:

At this step, please apply a specific mA value to one of the EndNode inputs, send the request command, and share the value displayed in the corresponding Debug node. Additionally, let me know the mA value you applied. This will help determine the correct formula to convert the data into mA values.

Thank you,
Eduardo M.