User avatar
By RichardS
#43052 User
marklein

Description

The WakeWidget is a standalone Wake-on-LAN (WoL) server. The device allows the user to remotely turn on computers that support WoL. This functionality is built-in to many, but not all, home internet routers.

To make construction of the device as simple as possible for bedroom manufacturing it uses only a standard NodeMCU board and a plastic project box. No other components and no soldering are required to complete a device. I can make one a year or 100 per day just as easily, just flash the board and drop it into a box! The buttons included on the NodeMCU board are available to the user to reboot the unit or reset to factory default settings.

Software Notes

My webserver code is based on the hard work of John Lassen (user name proteus74, thanks!), with all new HTML as well as some trimming of unneeded functions.

The core Wake-on-LAN code amazingly is only 7 lines of code if you omit the webpage handling portions and variable declarations.

WoL code:
#include <WiFiUdp.h>
byte mac = 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF; //MAC address of the target computer
byte bc = 192,168,1,255; //Broadcast address of the LAN
byte preamble[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
char i;
Udp.beginPacket(bc, 7);
Udp.write(preamble, sizeof(preamble));
for (i=0; i<16; i++) Udp.write(mac, 6);
Udp.endPacket();

Features:
All webpages formatted for finger friendly mobile access.
Easy Wifi config via SoftAP captive portal. Anyone with a cell phone or laptop can easily join the device to their wifi network.
Standard micro-USB power from any cell phone charger or computer USB port. Uses on-board NodeMCU power supply. Because there are no additional components it uses just 100mA of power, low enough for any USB power source.
About the size of a Zippo lighter when complete
Optional password protection of settings pages. Authentication status is stored on user’s browser in a cookie, the random number for this is changed every hour on the device (user is automatically logged out after 1 hour or on device reboot). A user configurable timeout could easily be added to the interface.
Stores up to 10 devices for one-touch waking (could store more, I just picked 10 because it seemed like “enough”) in EEPROM

NodeMCU physical buttons are exposed to the user for Reboot and Factory Reset functions.

Parts

Links
Demo

Video

Images
Attachments
ww-small2.jpg
ww-small3.jpg
ww-small4.jpg