Flow works in one lineup, but not in others

Newbie here. Love Node-RED, lots of success so far but this (seemingly) simple issue has me stumped.

I am using the 'cast' node from here https://github.com/Hypnos3/node-red-contrib-cast and I have the demo code up and running, making our Google Home device announce things to us. The working flow is [timestamp inject] -> [change node with rules] -> [cast node]

BUT....whenever I try to initiate a cast announcement through any other means other than the timestamp inject, it fails. Even when I use a trigger node with timestamp....which should be identical triggers, right? The debug outputs from the different methods are exactly the same, yet the cast node fails with the same error when using anything other than a timestamp inject (as far as I have determined)


5/10/2019, 9:41:29 PMnode: af389812.9b0e18
msg : string[59]
"Client error reported:connect ECONNREFUSED 192.168.1.106:68"


Note that when this fails as above, the port seems to be incorrect...I believe when it works it is using default cast port 8009.

I seem to be missing a big picture item here; but I can't for the life of me figure out what I am doing wrong. Any ideas? Thanks to all.

Edit: I realize I may be leaving out details, but I don't know what to add until someone asks....as to me this seems analogous to pushing a button and having it work with your thumb, but it doesn't work when you use a finger. To me I see no difference; to you old timers it is probably obvious...

I suggest you export and post your flow (or a sanitised/simplified version of it) for others to import and have a look see if something is configured incorrectly.

Remember to post flow like this...

```
Post you flow between 3 back ticks
```

Thanks Steve. Per your direction:

[{"id":"aa7f2a72.9a2d38","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"980b9a02.33289","type":"cast-to-client","z":"aa7f2a72.9a2d38","name":"","url":"","contentType":"","message":"","language":"en","ip":"192.168.1.106","port":"","volume":"","x":840,"y":360,"wires":[["1b2dbe25.89c78a"]]},{"id":"ad0a4e8.243483","type":"inject","z":"aa7f2a72.9a2d38","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":360,"y":360,"wires":[["72a3d52f.dff36c"]]},{"id":"72a3d52f.dff36c","type":"change","z":"aa7f2a72.9a2d38","name":"","rules":[{"t":"set","p":"ip","pt":"msg","to":"192.168.1.106","tot":"str"},{"t":"set","p":"message","pt":"msg","to":"Hello world","tot":"str"},{"t":"set","p":"language","pt":"msg","to":"En-gb","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":360,"wires":[["980b9a02.33289"]]},{"id":"1b2dbe25.89c78a","type":"debug","z":"aa7f2a72.9a2d38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1070,"y":360,"wires":[]}]

Above is the functioning, stand-alone test flow that sends a message to our Google cast device.

Below is the combined flow that doesn't work, and results in the debug error mentioned in my original post:

[{"id":"675e4bcc.a2c7b4","type":"tab","label":"Google cast attempt","disabled":false,"info":""},{"id":"210d5621.adcd92","type":"udp in","z":"675e4bcc.a2c7b4","name":"","iface":"","port":"67","ipv":"udp4","multicast":"false","group":"","datatype":"buffer","x":110,"y":140,"wires":[["7d6b5a14.7cd88c"]]},{"id":"7d6b5a14.7cd88c","type":"function","z":"675e4bcc.a2c7b4","name":"","func":"var mac = Buffer.alloc(6);\nmsg.payload.copy(mac, targetStart=0, sourceStart=28, sourceEnd=34);\nmsg.mac = mac.toString('hex');\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":200,"wires":[["4df44bfd.99f17c"]]},{"id":"4df44bfd.99f17c","type":"switch","z":"675e4bcc.a2c7b4","name":"","property":"mac","propertyType":"msg","rules":[{"t":"eq","v":"74c2463c74c9","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":450,"y":140,"wires":[["799fc2ad.0f511c"]]},{"id":"799fc2ad.0f511c","type":"delay","z":"675e4bcc.a2c7b4","name":"","pauseType":"rate","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":660,"y":220,"wires":[["d8ccb61a.0843f"]]},{"id":"a612c1e7.1ed8c","type":"cast-to-client","z":"675e4bcc.a2c7b4","name":"","url":"","contentType":"","message":"","language":"en","ip":"192.168.1.106","port":"","volume":"","x":840,"y":620,"wires":[["1ecd8b33.c66805"]]},{"id":"8662a156.55972","type":"change","z":"675e4bcc.a2c7b4","name":"","rules":[{"t":"set","p":"ip","pt":"msg","to":"192.168.1.106","tot":"str"},{"t":"set","p":"message","pt":"msg","to":"test","tot":"str"},{"t":"set","p":"language","pt":"msg","to":"En-gb","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":540,"wires":[["a612c1e7.1ed8c"]]},{"id":"d8ccb61a.0843f","type":"trigger","z":"675e4bcc.a2c7b4","op1":"","op2":"","op1type":"date","op2type":"nul","duration":"250","extend":false,"units":"ms","reset":"","bytopic":"all","name":"","x":860,"y":380,"wires":[["8662a156.55972"]]},{"id":"1ecd8b33.c66805","type":"debug","z":"675e4bcc.a2c7b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1130,"y":540,"wires":[]}]

Note; the purpose is to take a UDP MAC address detection and cause Google Home to announce.

Hi.

Firstly, your UDP node is attempting to connect to port 67 (not 68)

Secondly, is PORT 67 (or 68 for that matter) ready for connection on IP 192.168.1.106?

The error message tells me there is no UDP server at that port.

What is 192.168.1.106? Is there an application running there with port 67 or 68 opened ready waiting connection?

Lastly, if this is a PI/linux You cannot connect to lower port numbers without sudo. (if you can) use port numbers > 1024 ref

Thanks Steve.

Yes, port 67 is used for UDP listening; the Linux machine sees when certain MAC addresses connect.
NodeRed is running as root.
This part of the code works perfectly. Again, I am taking two perfectly functioning flows and trying to connect them together....at which time the error happens.

I have no idea where the port 68 comes from; it's a mystery. Port 67 is used for UDP listening; port 8009 is used to connect to the Google Home device.
Any ideas?
Edit: the IP x.106 is the Google Home device; that IP must be specified in the Cast node so that it can find it and send the text to speech data.
.

I will check on that issue. Maybe this will taken some time.

Thank you. In a nutshell, I can't figure out why an inject node sending a timestamp works to trigger an announcement via cast, but using the MAC address detect flow always fails.

For some unknown / mysterious reason, the cast node always defaults to port 68 (and therefore does not work) when triggered by the MAC address detect flow.

The reason is very easy. The UDP node sets msg.port which will also use the cast node. Please add a change node in front of the cast node, which deletes msg.port and it should work.

Thank you, it works now!