Skill: kingofqin2026/wake-lan (version 1.2.0)

--- name: wake-on-lan description: "Wake devices on your LAN using Wake-on-LAN magic packets. Supports saved devices (by alias or MAC) and ad-hoc wake commands via CLI or Python. Works on Linux, macOS, and Termux/Android. Use when: (1) waking a sleeping/suspended device, (2) managing WOL device aliases, (3) sending magic packets to specific MAC/IP. 🖥️ emoji = wake desktop." version: 1.2.0 author: kingofqin2026 license: MIT metadata: openclaw: tags: [WOL, wake-on-lan, network, magic-packet, BIOS, wake] --- # Wake-on-LAN (WOL) Send magic packets to wake sleeping/suspended devices on your local network. ## Prerequisites ```bash pip install wakeonlan ``` ## Quick Usage ### Wake by alias (requires device to be saved first) ```bash python3 <skill_dir>/scripts/wol.py <alias> ``` ### Wake by MAC directly ```bash wakeonlan -i <ip> -p <port> <mac> # or python3 <skill_dir>/scripts/wol.py --mac <mac> --ip <ip> [--port <port>] ``` ### Wake via Python ```python from wakeonlan import send_magic_packet send_magic_packet("<mac>", ip_address="<ip>", port=9) ``` ## Managing Saved Devices The script stores device aliases in `references/devices.json`. **No devices are pre-configured** — add yours: ```bash # Add a device python3 <skill_dir>/scripts/wol.py add <alias> --mac <mac> --ip <ip> [--port <port>] # Example python3 <skill_dir>/scripts/wol.py add desktop --mac aa:bb:cc:dd:ee:ff --ip 192.168.1.100 # List saved devices python3 <skill_dir>/scripts/wol.py list # Remove a device python3 <skill_dir>/scripts/wol.py remove <alias> ``` ## How It Works The `wol.py` script sends magic packets via **two methods** for reliability: 1. **`wakeonlan` CLI** — standard tool 2. **Raw UDP sockets** — fallback for environments where CLI fails (e.g. Termux/Android) Both broadcast (`255.255.255.255`) and specific IP are targeted on ports 9 and 7. ## Troubleshooting ### Termux / Android — Known Issue The `wakeonlan` CLI alone may NOT work on Termux — Android's Wi-Fi stack can block broadcast UDP. The `wol.py` script works around this by also sending raw UDP socket packets to broadcast + specific IP on ports 9 and 7. ### Target PC Won't Wake 1. **BIOS settings**: Enable "Wake on LAN" / "Power On by PCI-E" in BIOS 2. **OS settings** (Windows): `powercfg /h off` / disable fast startup - Also run in admin cmd: `powercfg -deviceenablewake "Realtek PCIe GbE Family Controller"` 3. **OS settings** (Linux): `sudo ethtool -s eth0 wol g` 4. **Router**: Static DHCP lease for the target (so IP doesn't change) 5. The target must be in S3 (sleep) or S5 (shutdown with WOL enabled), not unplugged from power 6. **Wireless WOL**: Most Wi-Fi cards don't support WOL — use Ethernet ### Verify WOL works manually ```python python3 -c " import socket, time mac = bytes.fromhex('AABBCCDDEEFF') packet = b'\xff' * 6 + mac * 16 for target in ['255.255.255.255', 'YOUR_DEVICE_IP']: for port in [9, 7]: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.sendto(packet, (target, port)) sock.close() time.sleep(0.2) print('Magic packets sent!') " ```


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)