Wake on Lan setup

I am looking to setup an old desktop that hosts game servers and other stuff that can be turnt on remotely (via discord). I have found a janky way (via tcp nodes) to get 2 node red session across the lan to talk basically. This will make starting the server and getting status of it easy but at times the host machine is off (to save power when no one is online or it goes to sleep) and I want a way for it to be able to be woken remotely (WoL). The wake on lan part is not hard as I can do that from my phone easily, I just need a palette that is able to do this relatively easy. I have seen some other chats here but they seem old or about broken palettes

Is the node red server on the same network as the machine you want to power up?

I will have node red (or my own api ish thingy) on each device that needs to controlled, but for the purpose of this chat both devices will have Node red yes

Have you tried node-red-node-wol (node) - Node-RED ?

No, I have not tried any. I was more asking for advise of which one to go with. I have the feeling that some older palettes just slip under the rug and dont get touched again

Far more controllable using MQTT or even a HTTP endpoint. Raw TCP can be problematic (firewalls, missed data etc)

One way to find out :wink:

Thanks for the info, I will give it a go. I heard with MQTT you need a broker, can NR do that itself. Also this setup may have to be over the internet at somepoint (as the host device will be offsite), I am guessing this will complicate communication massivley, but whats the best way to do it (securely)

I guess so, I hope it works. I will have to play in the morning when I am not half asleep.....

Strictly speaking, yes Node-red can run it's own mqtt broker.
It's called [Edit] Aegis (if I recall correctly) Aedes - (it's a genus of mosquito) but it is much better to use a seperate broker.

You can run Mosquitto broker on many platforms, even on a Raspberry Pi Zero 2 W.
It just has to be on the same network as the clients and have a fixed IP address.

For access over the internet there are cloud based brokers such as Hivemq.

Also on hivemq's website is an excellent blog series explaining all about mqtt

I have heard of this one, I will have to look into it. I may try nord meshnet too and see how well that works as I will probably have it already setup for 2 nas's to talk and a RDP session setup

I use the WOL node to wake up my QNAP NAS on the same home network as Node-RED.



You will need to enter the MAC and IP for your target device.

Can I get away with Just mac?

is that using this node-red-node-wol (node) - Node-RED?

Sorry for delay - been very busy.
Just tried the WOL node and can confirm it works with just a MAC address (leave the IP entry blank). I have fixed IP addresses on my two NAS units - that's why I used it.

all good

Isn't IP address in a WoL for a different layer WoL request but Mac is the most relable and preferred as they don't change (unless spoofed)

Hello!

Can you share the flow?. I'm trying to make it work but no luck.

Regards!

This is what I did... just entered the MAC address for my NAS in the 'node' and cleared the entry for the Target IP Address.

[{"id":"489860f8ee429eca","type":"wake on lan","z":"3606f55e7b3410ba","mac":"FF-FF-FF-FF-FF-FF","host":"","udpport":9,"numpackets":3,"interval":100,"name":"Wake on LAN","x":560,"y":380,"wires":[]},{"id":"39cbec9352b1fb36","type":"inject","z":"3606f55e7b3410ba","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":340,"y":380,"wires":[["489860f8ee429eca"]]}]

Mmmm, strange....im using Docker and it seems to not reach the IP that i want to wake. Maybe a network issue related.

If using docker then you need to somehow let it broadcast udp packets out of the container... eg see this for example - python - Send a wake on lan packet from a docker container - Stack Overflow

I'm not using Docker and have no experiemce of the set-up issues.
Looking at the countless reports on this forum, I suspect it's a IP/Routing issue.