• VS Code Build Lights: Broadcasting Success And Failure Over UDP

    02/27/2026 at 18:41 0 comments

    Make Your Editor Talk To Your Hardware

    Most developers rely on on-screen notifications to know whether a build succeeded or failed. But if you’re working across multiple monitors, running CI pipelines, or doing embedded work with long build times, you sometimes want something more physical — like a blinking LED, a buzzer, a display, or even a small dashboard that lights up when things break.

    So I built a simple tool that lets VS Code broadcast UDP messages every time a task completes — success or failure — allowing any hardware on your network to react instantly.

    This lets you create your own build lights, IoT indicators, or automation triggers with almost zero setup.

    Repo: https://github.com/sdrshnptl/notifybuildresult

    🛠 What It Does

    The extension watches VS Code tasks. Whenever a task ends, it sends a UDP broadcast packet to your LAN.

    Example payload:

    {  "task": "Build Firmware",  "status": "success"
    }
    

    Anything that can listen on UDP (ESP32, Raspberry Pi, Node.js, Python, Arduino, home automation, etc.) can act on it.

    This means you can build:

    • A green/red RGB LED build status light
    • A desktop notifier on your Pi
    • A wall-mounted display
    • A Slack/Discord notifier (via a UDP-listening script)
    • A relay-triggered siren when a build fails (yes, you can…)

    ⚙️ Why UDP?

    UDP broadcast is:

    • Zero configuration
    • No pairing or auth needed
    • Instant and connectionless
    • Supported by every IoT chip, MCU, and OS

    If your LAN has devices listening on port 10203, they will instantly react to VS Code builds.

    UDP is perfect here — even CI systems sometimes use beacons to announce events.

    🔧 How It Works Internally

    The extension hooks into VS Code’s task lifecycle using its extension API.

    When a task finishes, it:

    1. Collects task name
    2. Determines status (success / fail)
    3. Formats a JSON message
    4. Sends a broadcast UDP packet

    Simplified Flow Diagram

    +-------------+       +--------------------+      +-----------------------+
    | VS Code     |------>| notifybuildresult  |----->| UDP Broadcast (10203) |
    | Task Finish |       | Extension          |      | JSON Payload          |
    +-------------+       +--------------------+      +-----------------------+                                                             |                                                             v                                            +-----------------------------+                                            | Any Device Listening on LAN |                                            +-----------------------------+
    

    📡 Example: ESP32 Build Light

    Here’s the simplest ESP32 listener:

    #include <WiFi.h>
    #include <WiFiUdp.h>
    #include <ArduinoJson.h>
    
    WiFiUDP udp;
    
    void setup() {  WiFi.begin("ssid", "password");  udp.begin(10203);
    }
    
    void loop() {  char buffer[256];  int len = udp.parsePacket();  if (len > 0) {    udp.read(buffer, len);    StaticJsonDocument<256> doc;    deserializeJson(doc, buffer);
        String status = doc["status"];    if (status == "success") digitalWrite(LED_BUILTIN, HIGH);    else digitalWrite(LED_BUILTIN, LOW);  }
    }
    

    The LED instantly flips green/red based on your build result.

    💻 Node.js Listener (Desktop or Pi)

    import dgram from "dgram";
    
    const socket = dgram.createSocket("udp4");
    socket.bind(10203, () => console.log("Listening for VS Code build results..."));
    
    socket.on("message", (msg) => {  console.log("Build Event:", msg.toString());
    });
    

    One script, infinite possibilities.

    🔨 How To Install the Extension

    Install from GitHub:

    git clone https://github.com/sdrshnptl/notifybuildresult
    

    Or load it manually via VS Code → Extensions → "Install from VSIX".

    Full instructions are in the repo.

    🧱 Use Cases

    ✔ Build light for embedded developers ✔ Notify a CNC system (Fanuc, Modbus, ESP32 gateways) ✔ Update a wall display or dashboard ✔ Flash LEDs on your workbench ✔ Trigger home automation when CI breaks ✔ Play sound effects when builds fail

    If you can listen to UDP, you can automate it.

    🎯 Why I Built It

    I work with a lot of embedded, IoT, and automation systems. Builds can take time, and I wanted a simple visual indicator that didn't require switching windows. Most notification systems are cloud-based or require too much overhead.

    UDP broadcast is a beautifully simple local-only...

    Read more »