Back to Hub
HARDWARE INTEGRATION • MAY 2026

Interfacing Industrial Hardware via Web Serial.

While the WebUSB API is fantastic for modern devices with custom endpoints, the vast majority of legacy industrial equipment—CNC machines, PLCs, robotic arms, and diagnostic scanners—still rely on legacy RS-232 serial communication (UART). Historically, communicating with these devices required native C++ or Python scripts running on the host OS.

NitroIDE bridges the gap between the modern web and legacy manufacturing by implementing the Web Serial API, allowing developers to write control software and pipe serial telemetry directly into the browser IDE.

Bypassing the OS Abstraction

When you request a serial port in NitroIDE, the browser negotiates directly with the operating system's COM ports (Windows) or TTY devices (Linux/macOS). Once connected, we can configure the baud rate, data bits, and parity mathematically, opening a raw, bidirectional data stream to the physical hardware.

// Requesting access to an RS-232 Serial Port (e.g., COM3)
const port = await navigator.serial.requestPort();

// Opening the connection at an industrial 115200 baud rate
await port.open({ baudRate: 115200, dataBits: 8, stopBits: 1 });

// Pumping the incoming byte stream into the UI
const reader = port.readable.getReader();
while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  console.log('Raw UART Bytes:', value);
}

TransformStreams for Parsing: RS-232 data often arrives in fragmented chunks. NitroIDE utilizes the TransformStream API to pipe the raw bytes through a custom TextDecoderStream and a LineBreakTransformer, converting raw hexadecimal fragments into clean, parsed JSON strings before they ever hit the main thread.

The Browser as an HMI

This API transforms NitroIDE from a standard code editor into a fully functional Human-Machine Interface (HMI). Engineers can write a script to control a robotic arm, execute it in the browser, and instantly read the servo telemetry back through the serial monitor without ever leaving the tab.

Connect to the Real World.

Plug in a serial device and write control scripts directly from the browser.

Launch IDE