A VPN running on a router can serve devices across a network, but controlling it shouldn’t require every device to have a browser. Blair Wyatt’s VPN Light Switch on Hackaday.io gives that router-based OpenVPN client a momentary button and an RGB status light. The ESP8266 handles the interface; the router still does the VPN work.
Created on May 21, 2015, the project progressed from an ESP-01 prototype to a dedicated PCB, with the latest supplied build logs dated January 27, 2016. Its enduring appeal is the small, specific job it gives a connected device: make one otherwise hidden network service visible and controllable.
A button talks to OpenVPN, not the mains
Despite the name, this isn’t a switch for household lighting. Wyatt uses Lua-based NodeMCU firmware to connect over Wi-Fi to the OpenVPN client daemon’s management interface. In the January 2016 script, the destination is a local router at 192.168.1.1, on TCP port 7505.
A repeating timer requests the daemon’s state once per second. Incoming text drives the LED: CONNECTED selects green, AUTH lights red and blue together for purple, and RECONNECTING selects blue. A management-socket disconnection turns the LED red. Wyatt’s demo log labels these colors as enabled, initializing, standby and disabled, respectively.
The button does more than flip a local indicator. After a 200-millisecond debounce delay, the script sends one of two command sequences:
That distinction matters: pausing the VPN isn’t the same as killing its daemon. In the August 2015 script log, Wyatt explains that the service remains running in standby even though the VPN is no longer used. The button is an interface to the daemon’s control state, not a power switch for the router.
More GPIO makes room for the full interface
The early hardware exposed a very ordinary constraint: not enough accessible pins. In the August 15 prototype report, Wyatt described testing the LED and button in separate steps, disabling one LED channel during button tests because of the ESP-01’s limited GPIO access.
The later PCB design specified an ESP-03 module, an RGB LED, a tactile switch and a 3.3 V regulator. Wyatt described the board as one inch square in the October 10 design log, then reported that the PCBs had arrived on December 30. The January script assigns separate GPIO outputs to all three LED channels and an interrupt input to the button.
The hardware notes also record a less glamorous part of making a design repeatable: parts disappear. The December bill of materials was updated after the original LED and switch became obsolete, naming an Osram RGB LED and an APEM switch as replacements. The revised LED resistor values and designations matter to anyone working from the shared OSH Park board; the January code explicitly targets the Osram version.
A status light needs a precise meaning
The useful limitation is right there in the implementation. Green means the script received a CONNECTED response from OpenVPN. It doesn’t independently test the route taken by another device’s traffic. Likewise, red is triggered by losing the management connection, which isn’t necessarily proof that the VPN itself has stopped.
That doesn’t make the display unhelpful—it defines what it can tell you. This is a compact remote control and daemon-status indicator, not a network-wide privacy test. Anyone adapting it should also treat access to the management port as part of the design: the shown script uses a plain TCP connection and contains no authentication exchange.
The strongest lesson is to keep service state, control-connection state and actual traffic behavior distinct. A future version could give loss of management contact its own indication, rather than folding it into “VPN disabled.” That would preserve the project’s one-glance simplicity while making the light more honest about what it knows.
Source: VPN Light Switch