From d8d9b04ebbdfff0dd3d952d2658f117d47730c9d Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Sat, 20 Jun 2020 00:47:01 +0100 Subject: add a README explaining config and theory of operation --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6111741 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ + + +# Catbus Wake-On-LAN + +A simple daemon that emits [Wake-On-LAN "magic packets"](https://en.wikipedia.org/wiki/Wake-on-LAN) when triggered by [Catbus](https://ethulhu.co.uk/catbus). + +## Config + +```json +{ + "mqttBroker": "tcp://broker.local:1883", + "devices": { + "TV": { + "mac": "aa:bb:cc:dd:ee:ff", + "topic": "home/living-room/tv/power" + } + } +} +``` + +## Wake-On-LAN + +Wake-On-LAN is a protocol to wake or boot devices over LAN using "magic packets". +The magic packet is, in big endian: + +- 6 bytes of `0xFF`. +- the MAC address of the device you are waking, 16 times. + +For example, for a device with a MAC address `aa:bb:cc:dd:ee:ff`, the packet will be, in hex: + +``` +ffffffffffffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeffaabbccddeeff +``` + +This is broadcast over UDP on port 9. -- cgit v1.2.3