Im trying to perform a UDP broadcast to find a heatmiser neohub on the network.
My node red is running in a docker container on a device and has a port mapped to 50080.
This is the text from the heatmiser document
Finding neoHubs on the users local network has now become easier. UDP Broadcasting ‘hubseek’ on
port 19790 will prompt hubs to respond with their IP if they are available. This is all done over UDP
broadcast and so 3rd party systems would both need to be able to broadcast and listen for UDP on port
19790
Request example - echo -n "hubseek" | nc -b -u 255.255.255.255 19790
Response Example - {“ip”:”192.168.0.19”, “device_id”:” D8:80:39:AD:0D:F0”}
I want to perform this step if the connection to the neohub API fails, as the device is in DHCP mode only I cant rely on a fixed IP address.
Ive tried to send this command also from Windows Powershell but it didnt like the 'nc' in the command so not sure I really have a way to test.
This isnt my network so I thought I would attempt this before trying to liaise with the network management people.
Here is my flow that I have tried. I have attempted various versions of the commands but the UDP broadcast does seem to do anything ( I think maybe its not leaving the container ), and the exec command doesnt seem to error but also doesnt respond with the message Id like.
Any help appreciated, thanks
[
{
"id": "9035b297947e3291",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ccaacc4978c32ba1",
"type": "inject",
"z": "9035b297947e3291",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 160,
"wires": [
[
"3735b298d1b523b1"
]
]
},
{
"id": "78f6245457b523fe",
"type": "debug",
"z": "9035b297947e3291",
"name": "debug 125",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 690,
"y": 240,
"wires": []
},
{
"id": "3aa5137fe3f12d4c",
"type": "udp out",
"z": "9035b297947e3291",
"name": "",
"addr": "255.255.255.55",
"iface": "",
"port": "19790",
"ipv": "udp4",
"outport": "",
"base64": false,
"multicast": "broad",
"x": 680,
"y": 160,
"wires": []
},
{
"id": "3735b298d1b523b1",
"type": "function",
"z": "9035b297947e3291",
"name": "function 30",
"func": "msg.payload = 'echo -n \"hubseek\" | nc -b -u'\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 160,
"wires": [
[
"3aa5137fe3f12d4c"
]
]
},
{
"id": "07800e0fedb557ed",
"type": "udp in",
"z": "9035b297947e3291",
"name": "",
"iface": "",
"port": "19790",
"ipv": "udp4",
"multicast": "false",
"group": "",
"datatype": "buffer",
"x": 240,
"y": 240,
"wires": [
[
"78f6245457b523fe"
]
]
},
{
"id": "a229f82f969bc237",
"type": "inject",
"z": "9035b297947e3291",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 400,
"wires": [
[
"2add065f1ab44994"
]
]
},
{
"id": "2add065f1ab44994",
"type": "exec",
"z": "9035b297947e3291",
"command": "echo -n \"hubseek\" | nc -b -u 255.255.255.255 19790",
"addpay": "",
"append": "",
"useSpawn": "true",
"timer": "30",
"winHide": false,
"oldrc": false,
"name": "",
"x": 500,
"y": 400,
"wires": [
[
"b69114f29e0a6018"
],
[
"d5b69c5bb741b7ff"
],
[
"b2b0339a58f670c7"
]
]
},
{
"id": "b69114f29e0a6018",
"type": "debug",
"z": "9035b297947e3291",
"name": "debug 126",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 360,
"wires": []
},
{
"id": "d5b69c5bb741b7ff",
"type": "debug",
"z": "9035b297947e3291",
"name": "debug 127",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 400,
"wires": []
},
{
"id": "b2b0339a58f670c7",
"type": "debug",
"z": "9035b297947e3291",
"name": "debug 128",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 440,
"wires": []
}
]